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
1cdd2e9e
Commit
1cdd2e9e
authored
Jul 26, 2019
by
HJYOO
Committed by
Yuxin Wu
Jul 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feat. extract graph (#1284)
parent
e63d8b7e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
examples/FasterRCNN/predict.py
examples/FasterRCNN/predict.py
+9
-0
No files found.
examples/FasterRCNN/predict.py
View file @
1cdd2e9e
...
@@ -15,6 +15,7 @@ assert six.PY3, "This example requires Python 3!"
...
@@ -15,6 +15,7 @@ assert six.PY3, "This example requires Python 3!"
import
tensorpack.utils.viz
as
tpviz
import
tensorpack.utils.viz
as
tpviz
from
tensorpack.predict
import
MultiTowerOfflinePredictor
,
OfflinePredictor
,
PredictConfig
from
tensorpack.predict
import
MultiTowerOfflinePredictor
,
OfflinePredictor
,
PredictConfig
from
tensorpack.tfutils
import
get_model_loader
,
get_tf_version_tuple
from
tensorpack.tfutils
import
get_model_loader
,
get_tf_version_tuple
from
tensorpack.tfutils.export
import
ModelExporter
from
tensorpack.utils
import
fs
,
logger
from
tensorpack.utils
import
fs
,
logger
from
dataset
import
DatasetRegistry
,
register_coco
from
dataset
import
DatasetRegistry
,
register_coco
...
@@ -114,6 +115,8 @@ if __name__ == '__main__':
...
@@ -114,6 +115,8 @@ if __name__ == '__main__':
parser
.
add_argument
(
'--benchmark'
,
action
=
'store_true'
,
help
=
"Benchmark the speed of the model + postprocessing"
)
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
=
'+'
)
parser
.
add_argument
(
'--compact'
,
help
=
'if you want to save a model to .pb'
)
parser
.
add_argument
(
'--serving'
,
help
=
'if you want to save a model to serving file'
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
if
args
.
config
:
if
args
.
config
:
...
@@ -139,6 +142,12 @@ if __name__ == '__main__':
...
@@ -139,6 +142,12 @@ if __name__ == '__main__':
session_init
=
get_model_loader
(
args
.
load
),
session_init
=
get_model_loader
(
args
.
load
),
input_names
=
MODEL
.
get_inference_tensor_names
()[
0
],
input_names
=
MODEL
.
get_inference_tensor_names
()[
0
],
output_names
=
MODEL
.
get_inference_tensor_names
()[
1
])
output_names
=
MODEL
.
get_inference_tensor_names
()[
1
])
if
args
.
compact
:
ModelExporter
(
predcfg
)
.
export_compact
(
args
.
compact
,
optimize
=
False
)
elif
args
.
serving
:
ModelExporter
(
predcfg
)
.
export_serving
(
args
.
serving
,
optimize
=
False
)
if
args
.
predict
:
if
args
.
predict
:
predictor
=
OfflinePredictor
(
predcfg
)
predictor
=
OfflinePredictor
(
predcfg
)
for
image_file
in
args
.
predict
:
for
image_file
in
args
.
predict
:
...
...
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