Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
再见难再见
fcos
提交
0ea6ea06
F
fcos
项目概览
再见难再见
/
fcos
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fcos
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0ea6ea06
编写于
10月 08, 2019
作者:
H
Hao Chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
compatibility for torchvision 0.4.0
上级
bb6e97bc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
6 deletion
+10
-6
fcos_core/data/datasets/coco.py
fcos_core/data/datasets/coco.py
+3
-3
fcos_core/data/transforms/transforms.py
fcos_core/data/transforms/transforms.py
+5
-2
fcos_core/structures/segmentation_mask.py
fcos_core/structures/segmentation_mask.py
+2
-1
未找到文件。
fcos_core/data/datasets/coco.py
浏览文件 @
0ea6ea06
...
@@ -61,7 +61,7 @@ class COCODataset(torchvision.datasets.coco.CocoDetection):
...
@@ -61,7 +61,7 @@ class COCODataset(torchvision.datasets.coco.CocoDetection):
v
:
k
for
k
,
v
in
self
.
json_category_id_to_contiguous_id
.
items
()
v
:
k
for
k
,
v
in
self
.
json_category_id_to_contiguous_id
.
items
()
}
}
self
.
id_to_img_map
=
{
k
:
v
for
k
,
v
in
enumerate
(
self
.
ids
)}
self
.
id_to_img_map
=
{
k
:
v
for
k
,
v
in
enumerate
(
self
.
ids
)}
self
.
transforms
=
transforms
self
.
_
transforms
=
transforms
def
__getitem__
(
self
,
idx
):
def
__getitem__
(
self
,
idx
):
img
,
anno
=
super
(
COCODataset
,
self
).
__getitem__
(
idx
)
img
,
anno
=
super
(
COCODataset
,
self
).
__getitem__
(
idx
)
...
@@ -90,8 +90,8 @@ class COCODataset(torchvision.datasets.coco.CocoDetection):
...
@@ -90,8 +90,8 @@ class COCODataset(torchvision.datasets.coco.CocoDetection):
target
=
target
.
clip_to_image
(
remove_empty
=
True
)
target
=
target
.
clip_to_image
(
remove_empty
=
True
)
if
self
.
transforms
is
not
None
:
if
self
.
_
transforms
is
not
None
:
img
,
target
=
self
.
transforms
(
img
,
target
)
img
,
target
=
self
.
_
transforms
(
img
,
target
)
return
img
,
target
,
idx
return
img
,
target
,
idx
...
...
fcos_core/data/transforms/transforms.py
浏览文件 @
0ea6ea06
...
@@ -57,9 +57,12 @@ class Resize(object):
...
@@ -57,9 +57,12 @@ class Resize(object):
def
__call__
(
self
,
image
,
target
=
None
):
def
__call__
(
self
,
image
,
target
=
None
):
size
=
self
.
get_size
(
image
.
size
)
size
=
self
.
get_size
(
image
.
size
)
image
=
F
.
resize
(
image
,
size
)
image
=
F
.
resize
(
image
,
size
)
if
target
is
None
:
if
isinstance
(
target
,
list
):
target
=
[
t
.
resize
(
image
.
size
)
for
t
in
target
]
elif
target
is
None
:
return
image
return
image
target
=
target
.
resize
(
image
.
size
)
else
:
target
=
target
.
resize
(
image
.
size
)
return
image
,
target
return
image
,
target
...
...
fcos_core/structures/segmentation_mask.py
浏览文件 @
0ea6ea06
...
@@ -414,7 +414,8 @@ class PolygonList(object):
...
@@ -414,7 +414,8 @@ class PolygonList(object):
else
:
else
:
# advanced indexing on a single dimension
# advanced indexing on a single dimension
selected_polygons
=
[]
selected_polygons
=
[]
if
isinstance
(
item
,
torch
.
Tensor
)
and
item
.
dtype
==
torch
.
uint8
:
if
isinstance
(
item
,
torch
.
Tensor
)
and
\
item
.
dtype
==
torch
.
uint8
or
item
.
dtype
==
torch
.
bool
:
item
=
item
.
nonzero
()
item
=
item
.
nonzero
()
item
=
item
.
squeeze
(
1
)
if
item
.
numel
()
>
0
else
item
item
=
item
.
squeeze
(
1
)
if
item
.
numel
()
>
0
else
item
item
=
item
.
tolist
()
item
=
item
.
tolist
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录