Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
6716fc51
"vscode:/vscode.git/clone" did not exist on "92f2ea89ac4fed31f804bc6a22cd9ae55e6f620e"
Unverified
Commit
6716fc51
authored
Apr 25, 2019
by
Francisco Massa
Committed by
GitHub
Apr 25, 2019
Browse files
Make CocoDataset ids deterministically ordered (#868)
parent
9a481d0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
torchvision/datasets/coco.py
torchvision/datasets/coco.py
+2
-2
No files found.
torchvision/datasets/coco.py
View file @
6716fc51
...
...
@@ -49,7 +49,7 @@ class CocoCaptions(VisionDataset):
self
.
target_transform
=
target_transform
from
pycocotools.coco
import
COCO
self
.
coco
=
COCO
(
annFile
)
self
.
ids
=
list
(
self
.
coco
.
imgs
.
keys
())
self
.
ids
=
list
(
sorted
(
self
.
coco
.
imgs
.
keys
())
)
def
__getitem__
(
self
,
index
):
"""
...
...
@@ -98,7 +98,7 @@ class CocoDetection(VisionDataset):
self
.
target_transform
=
target_transform
from
pycocotools.coco
import
COCO
self
.
coco
=
COCO
(
annFile
)
self
.
ids
=
list
(
self
.
coco
.
imgs
.
keys
())
self
.
ids
=
list
(
sorted
(
self
.
coco
.
imgs
.
keys
())
)
def
__getitem__
(
self
,
index
):
"""
...
...
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