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
d451368a
Commit
d451368a
authored
Jul 17, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MaskRCNN] inference speed test
parent
9c6e39c5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
examples/FasterRCNN/modeling/generalized_rcnn.py
examples/FasterRCNN/modeling/generalized_rcnn.py
+2
-1
examples/FasterRCNN/predict.py
examples/FasterRCNN/predict.py
+9
-0
No files found.
examples/FasterRCNN/modeling/generalized_rcnn.py
View file @
d451368a
...
@@ -89,7 +89,8 @@ class GeneralizedRCNN(ModelDesc):
...
@@ -89,7 +89,8 @@ class GeneralizedRCNN(ModelDesc):
ns
=
G
.
get_name_scope
()
ns
=
G
.
get_name_scope
()
for
name
in
self
.
get_inference_tensor_names
()[
1
]:
for
name
in
self
.
get_inference_tensor_names
()[
1
]:
try
:
try
:
G
.
get_tensor_by_name
(
'/'
.
join
([
ns
,
name
+
':0'
]))
name
=
'/'
.
join
([
ns
,
name
])
if
ns
else
name
G
.
get_tensor_by_name
(
name
+
':0'
)
except
KeyError
:
except
KeyError
:
raise
KeyError
(
"Your model does not define the tensor '{}' in inference context."
.
format
(
name
))
raise
KeyError
(
"Your model does not define the tensor '{}' in inference context."
.
format
(
name
))
...
...
examples/FasterRCNN/predict.py
View file @
d451368a
...
@@ -111,6 +111,7 @@ if __name__ == '__main__':
...
@@ -111,6 +111,7 @@ if __name__ == '__main__':
"This argument is the path to the output json evaluation file"
)
"This argument is the path to the output json evaluation file"
)
parser
.
add_argument
(
'--predict'
,
help
=
"Run prediction on a given image. "
parser
.
add_argument
(
'--predict'
,
help
=
"Run prediction on a given image. "
"This argument is the path to the input image file"
,
nargs
=
'+'
)
"This argument is the path to the input image file"
,
nargs
=
'+'
)
parser
.
add_argument
(
'--benchmark'
,
action
=
'store_true'
,
help
=
"Benchmark the speed of the model + postprocessing"
)
parser
.
add_argument
(
'--config'
,
help
=
"A list of KEY=VALUE to overwrite those defined in config.py"
,
parser
.
add_argument
(
'--config'
,
help
=
"A list of KEY=VALUE to overwrite those defined in config.py"
,
nargs
=
'+'
)
nargs
=
'+'
)
...
@@ -145,3 +146,11 @@ if __name__ == '__main__':
...
@@ -145,3 +146,11 @@ if __name__ == '__main__':
elif
args
.
evaluate
:
elif
args
.
evaluate
:
assert
args
.
evaluate
.
endswith
(
'.json'
),
args
.
evaluate
assert
args
.
evaluate
.
endswith
(
'.json'
),
args
.
evaluate
do_evaluate
(
predcfg
,
args
.
evaluate
)
do_evaluate
(
predcfg
,
args
.
evaluate
)
elif
args
.
benchmark
:
df
=
get_eval_dataflow
(
cfg
.
DATA
.
VAL
[
0
])
df
.
reset_state
()
predictor
=
OfflinePredictor
(
predcfg
)
for
img
in
tqdm
.
tqdm
(
df
,
total
=
len
(
df
)):
# This include post-processing time, which is done on CPU and not optimized
# To exclude it, modify `predict_image`.
predict_image
(
img
[
0
],
predictor
)
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