Skip to content

Commit bed5932

Browse files
authored
Merge pull request #3215 from anzhella-pankratova/text_spotting_demo_fix_names
text_spotting_demo: fix output layer name, restore the test
2 parents 9ae26f3 + 42b3338 commit bed5932

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

demos/tests/cases.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,20 +1285,19 @@ def single_option_cases(key, *args):
12851285
single_option_cases('-m', ModelArg('wav2vec2-base'))
12861286
)),
12871287

1288-
# TODO: Demo supports only topologies with the following input tensor name: image
1289-
# PythonDemo(name='text_spotting_demo', device_keys=['-d'],
1290-
# model_keys=['-m_m', '-m_te', '-m_td'], test_cases=combine_cases(
1291-
# TestCase(options={'--no_show': None, '--delay': '1', **MONITORS,
1292-
# '-i': DataPatternArg('text-detection')}),
1293-
# [
1294-
# TestCase(options={
1295-
# '-m_m': ModelArg('text-spotting-0005-detector'),
1296-
# '-m_te': ModelArg('text-spotting-0005-recognizer-encoder'),
1297-
# '-m_td': ModelArg('text-spotting-0005-recognizer-decoder'),
1298-
# '--no_track': None
1299-
# }),
1300-
# ]
1301-
# )),
1288+
PythonDemo(name='text_spotting_demo', device_keys=['-d'],
1289+
model_keys=['-m_m', '-m_te', '-m_td'], test_cases=combine_cases(
1290+
TestCase(options={'--no_show': None, '--delay': '1', **MONITORS,
1291+
'-i': DataPatternArg('text-detection')}),
1292+
[
1293+
TestCase(options={
1294+
'-m_m': ModelArg('text-spotting-0005-detector'),
1295+
'-m_te': ModelArg('text-spotting-0005-recognizer-encoder'),
1296+
'-m_td': ModelArg('text-spotting-0005-recognizer-decoder'),
1297+
'--no_track': None
1298+
}),
1299+
]
1300+
)),
13021301

13031302
PythonDemo(name='text_to_speech_demo', device_keys=['-d'],
13041303
model_keys=['-m_duration', '-m_forward', '-m_upsample', '-m_rnn', '-m_melgan'], test_cases=combine_cases(

demos/text_spotting_demo/python/text_spotting_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def main():
178178
except RuntimeError:
179179
raise RuntimeError('Demo supports only topologies with the following input tensor name: {}'.format(input_tensor_name))
180180

181-
required_output_names = {'boxes', 'labels', 'masks', 'text_features.0'}
181+
required_output_names = {'boxes', 'labels', 'masks', 'text_features'}
182182
for output_tensor_name in required_output_names:
183183
try:
184184
mask_rcnn_model.output(output_tensor_name)
@@ -264,7 +264,7 @@ def main():
264264
scores = outputs['boxes'][:, 4]
265265
classes = outputs['labels'].astype(np.uint32)
266266
raw_masks = outputs['masks']
267-
text_features = outputs['text_features.0']
267+
text_features = outputs['text_features']
268268

269269
# Filter out detections with low confidence.
270270
detections_filter = scores > args.prob_threshold

0 commit comments

Comments
 (0)