Skip to content

Commit ba74851

Browse files
authored
Merge branch 'openvinotoolkit:master' into master
2 parents 9109841 + 00d8a33 commit ba74851

File tree

19 files changed

+145
-142
lines changed

19 files changed

+145
-142
lines changed

demos/background_subtraction_demo/python/background_subtraction_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,11 @@ def main():
308308
presenter.handleKey(key)
309309

310310
pipeline.await_all()
311+
if pipeline.callback_exceptions:
312+
raise pipeline.callback_exceptions[0]
311313
# Process completed requests
312314
for next_frame_id_to_show in range(next_frame_id_to_show, next_frame_id):
313315
results = pipeline.get_result(next_frame_id_to_show)
314-
while results is None:
315-
results = pipeline.get_result(next_frame_id_to_show)
316316
objects, frame_meta = results
317317
if args.raw_output_message:
318318
print_raw_results(objects, next_frame_id_to_show, model.labels)

demos/bert_named_entity_recognition_demo/python/bert_named_entity_recognition_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ def main():
148148
pipeline.await_any()
149149

150150
pipeline.await_all()
151+
if pipeline.callback_exceptions:
152+
raise pipeline.callback_exceptions[0]
151153
for sentence_id in range(next_sentence_id_to_show, next_sentence_id):
152154
results = pipeline.get_result(sentence_id)
153-
while results is None:
154-
results = pipeline.get_result(sentence_id)
155155
(score, filtered_labels_id), meta = results
156156
print_raw_results(score, filtered_labels_id, meta)
157157

demos/bert_question_answering_demo/python/bert_question_answering_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,10 @@ def questions():
237237
pipeline.await_any()
238238

239239
pipeline.await_all()
240+
if pipeline.callback_exceptions:
241+
raise pipeline.callback_exceptions[0]
240242
for window_id in range(next_window_id_to_show, next_window_id):
241243
results = pipeline.get_result(window_id)
242-
while results is None:
243-
results = pipeline.get_result(window_id)
244244
update_answers_list(answers, results[0])
245245

246246
visualizer.show_answers(answers)

demos/bert_question_answering_embedding_demo/python/bert_question_answering_embedding_demo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ def calc_question_embedding(tokens_id):
255255
emb_pipeline.await_any()
256256

257257
emb_pipeline.await_all()
258+
if emb_pipeline.callback_exceptions:
259+
raise emb_pipeline.callback_exceptions[0]
258260
for window_id in range(next_window_id_to_show, next_window_id):
259261
results = emb_pipeline.get_result(window_id)
260-
while results is None:
261-
results = emb_pipeline.get_result(window_id)
262262
embedding, meta = results
263263
meta['c_data'].emb = embedding
264264
contexts_all.append(meta['c_data'])
@@ -318,10 +318,10 @@ def questions():
318318
qa_pipeline.await_any()
319319

320320
qa_pipeline.await_all()
321+
if qa_pipeline.callback_exceptions:
322+
raise qa_pipeline.callback_exceptions[0]
321323
for context_id in range(next_context_id_to_show, next_context_id):
322324
results = qa_pipeline.get_result(context_id)
323-
while results is None:
324-
results = qa_pipeline.get_result(context_id)
325325
output, meta = results
326326
update_answers_list(answers, output, meta['c_data'])
327327

demos/classification_demo/python/classification_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,12 @@ def main():
250250
async_pipeline.await_any()
251251

252252
async_pipeline.await_all()
253+
if async_pipeline.callback_exceptions:
254+
raise async_pipeline.callback_exceptions[0]
253255
if key not in {ord('q'), ord('Q'), ESC_KEY}:
254256
# Process completed requests
255257
for next_frame_id_to_show in range(next_frame_id_to_show, next_frame_id):
256258
results = async_pipeline.get_result(next_frame_id_to_show)
257-
while results is None:
258-
results = async_pipeline.get_result(next_frame_id_to_show)
259259
classifications, frame_meta = results
260260
frame = frame_meta['frame']
261261
start_time = frame_meta['start_time']

demos/common/python/openvino/model_zoo/model_api/pipelines/async_pipeline.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ def __init__(self, model):
9696
def callback(self, request, callback_args):
9797
try:
9898
get_result_fn, (id, meta, preprocessing_meta, start_time) = callback_args
99-
if isinstance(request, dict):
100-
status = 0
101-
else:
102-
status = request.query_state()
103-
if status:
104-
raise RuntimeError('Request has returned status code {}'.format(status))
10599
self.completed_results[id] = (get_result_fn(request), meta, preprocessing_meta, start_time)
106100
except Exception as e:
107101
self.callback_exceptions.append(e)

demos/deblurring_demo/python/deblurring_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ def main():
164164
presenter.handleKey(key)
165165

166166
pipeline.await_all()
167+
if pipeline.callback_exceptions:
168+
raise pipeline.callback_exceptions[0]
167169
# Process completed requests
168170
for next_frame_id_to_show in range(next_frame_id_to_show, next_frame_id):
169171
results = pipeline.get_result(next_frame_id_to_show)
170-
while results is None:
171-
results = pipeline.get_result(next_frame_id_to_show)
172172
result_frame, frame_meta = results
173173
input_frame = frame_meta['frame']
174174
start_time = frame_meta['start_time']

demos/handwritten_text_recognition_demo/python/handwritten_text_recognition_demo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ def main():
7777
log.info('OpenVINO Inference Engine')
7878
log.info('\tbuild: {}'.format(get_version()))
7979
core = Core()
80-
core.set_property("GPU", {"GPU_ENABLE_LOOP_UNROLLING": "NO", "CACHE_DIR": "./"})
80+
81+
if 'GPU' in args.device:
82+
core.set_property("GPU", {"GPU_ENABLE_LOOP_UNROLLING": "NO", "CACHE_DIR": "./"})
8183

8284
# Read IR
8385
log.info('Reading model {}'.format(args.model))

demos/human_pose_estimation_demo/python/human_pose_estimation_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ def main():
251251
hpe_pipeline.await_any()
252252

253253
hpe_pipeline.await_all()
254+
if hpe_pipeline.callback_exceptions:
255+
raise hpe_pipeline.callback_exceptions[0]
254256
# Process completed requests
255257
for next_frame_id_to_show in range(next_frame_id_to_show, next_frame_id):
256258
results = hpe_pipeline.get_result(next_frame_id_to_show)
257-
while results is None:
258-
results = hpe_pipeline.get_result(next_frame_id_to_show)
259259
(poses, scores), frame_meta = results
260260
frame = frame_meta['frame']
261261
start_time = frame_meta['start_time']

demos/monodepth_demo/python/monodepth_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ def main():
175175
presenter.handleKey(key)
176176

177177
pipeline.await_all()
178+
if pipeline.callback_exceptions:
179+
raise pipeline.callback_exceptions[0]
178180
# Process completed requests
179181
for next_frame_id_to_show in range(next_frame_id_to_show, next_frame_id):
180182
results = pipeline.get_result(next_frame_id_to_show)
181-
while results is None:
182-
results = pipeline.get_result(next_frame_id_to_show)
183183
depth_map, frame_meta = results
184184
depth_map = apply_color_map(depth_map, output_transform)
185185

0 commit comments

Comments
 (0)