Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
274c7544
Commit
274c7544
authored
Feb 25, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix FasterRCNN horovod evaluation
parent
dbc50068
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
examples/FasterRCNN/dataset.py
examples/FasterRCNN/dataset.py
+4
-4
No files found.
examples/FasterRCNN/dataset.py
View file @
274c7544
...
@@ -82,7 +82,7 @@ class COCODetection:
...
@@ -82,7 +82,7 @@ class COCODetection:
Returns:
Returns:
a list of dict, each has keys including:
a list of dict, each has keys including:
'id', 'file_name',
'i
mage_i
d', 'file_name',
and (if add_gt is True) 'boxes', 'class', 'is_crowd', and optionally
and (if add_gt is True) 'boxes', 'class', 'is_crowd', and optionally
'segmentation'.
'segmentation'.
"""
"""
...
@@ -95,6 +95,7 @@ class COCODetection:
...
@@ -95,6 +95,7 @@ class COCODetection:
imgs
=
self
.
coco
.
loadImgs
(
img_ids
)
imgs
=
self
.
coco
.
loadImgs
(
img_ids
)
for
img
in
tqdm
.
tqdm
(
imgs
):
for
img
in
tqdm
.
tqdm
(
imgs
):
img
[
'image_id'
]
=
img
.
pop
(
'id'
)
self
.
_use_absolute_file_name
(
img
)
self
.
_use_absolute_file_name
(
img
)
if
add_gt
:
if
add_gt
:
self
.
_add_detection_gt
(
img
,
add_mask
)
self
.
_add_detection_gt
(
img
,
add_mask
)
...
@@ -113,9 +114,9 @@ class COCODetection:
...
@@ -113,9 +114,9 @@ class COCODetection:
Add 'boxes', 'class', 'is_crowd' of this image to the dict, used by detection.
Add 'boxes', 'class', 'is_crowd' of this image to the dict, used by detection.
If add_mask is True, also add 'segmentation' in coco poly format.
If add_mask is True, also add 'segmentation' in coco poly format.
"""
"""
# ann_ids = self.coco.getAnnIds(imgIds=img['id'])
# ann_ids = self.coco.getAnnIds(imgIds=img['i
mage_i
d'])
# objs = self.coco.loadAnns(ann_ids)
# objs = self.coco.loadAnns(ann_ids)
objs
=
self
.
coco
.
imgToAnns
[
img
[
'id'
]]
# equivalent but faster than the above two lines
objs
=
self
.
coco
.
imgToAnns
[
img
[
'i
mage_i
d'
]]
# equivalent but faster than the above two lines
# clean-up boxes
# clean-up boxes
valid_objs
=
[]
valid_objs
=
[]
...
@@ -163,7 +164,6 @@ class COCODetection:
...
@@ -163,7 +164,6 @@ class COCODetection:
img
[
'boxes'
]
=
boxes
# nx4
img
[
'boxes'
]
=
boxes
# nx4
img
[
'class'
]
=
cls
# n, always >0
img
[
'class'
]
=
cls
# n, always >0
img
[
'is_crowd'
]
=
is_crowd
# n,
img
[
'is_crowd'
]
=
is_crowd
# n,
img
[
'image_id'
]
=
img
.
pop
(
'id'
)
if
add_mask
:
if
add_mask
:
# also required to be float32
# also required to be float32
img
[
'segmentation'
]
=
[
img
[
'segmentation'
]
=
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment