Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nikhil_rayaprolu
food-pytorch-baseline
Commits
c5b207c4
Commit
c5b207c4
authored
Dec 20, 2019
by
nikhil_rayaprolu
Browse files
fixing issues with test script
parent
3c1a50ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/test.py
View file @
c5b207c4
...
...
@@ -30,7 +30,7 @@ for item in glob.glob(test_images_path+'/*.jpg'):
height
,
width
,
__
=
img
.
shape
id
=
int
(
os
.
path
.
basename
(
item
).
split
(
'.'
)[
0
])
image_dict
[
'id'
]
=
id
image_dict
[
'file_name'
]
=
os
.
pa
h
t
.
basename
(
item
)
image_dict
[
'file_name'
]
=
os
.
pat
h
.
basename
(
item
)
image_dict
[
'width'
]
=
width
image_dict
[
'height'
]
=
height
annotations
[
'images'
].
append
(
image_dict
)
...
...
@@ -349,7 +349,7 @@ def main():
checkpoint
=
load_checkpoint
(
model
,
args
.
checkpoint
,
map_location
=
'cpu'
)
# old versions did not save class info in checkpoints, this walkaround is
# for backward compatibility
model
.
CLASSES
=
[
category
[
'name'
]
for
category
in
ann
[
'categories'
]]
model
.
CLASSES
=
[
category
[
'name'
]
for
category
in
ann
otations
[
'categories'
]]
if
not
distributed
:
model
=
MMDataParallel
(
model
,
device_ids
=
[
0
])
outputs
=
single_gpu_test
(
model
,
data_loader
,
args
.
show
)
...
...
@@ -384,5 +384,4 @@ def main():
if
__name__
==
'__main__'
:
try
:
main
()
main
()
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