Skip to content

Commit 43ff9de

Browse files
committed
minor tweaks
1 parent 6e630e9 commit 43ff9de

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/modules/ObjectDetectionCoral/objectdetection_coral_multitpu.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,17 +279,17 @@ def main():
279279
(tot_infr_time / args.count, thread_cnt,
280280
half_wall_time * 1000 / half_infr_count, half_infr_count))
281281

282-
print('-------RESULTS--------')
282+
logging.info('-------RESULTS--------')
283283
if not objs:
284-
print('No objects detected')
284+
logging.info('No objects detected')
285285
return
286286

287287
if any(objs):
288288
for obj in objs:
289-
print(_tpu_runner.labels.get(obj.id, obj.id))
290-
print(' id: ', obj.id)
291-
print(' score: ', obj.score)
292-
print(' bbox: ', obj.bbox)
289+
logging.info(_tpu_runner.labels.get(obj.id, obj.id))
290+
logging.info(f' id: {obj.id}')
291+
logging.info(f' score: {obj.score}')
292+
logging.info(f' bbox: {obj.bbox}')
293293

294294
if args.output:
295295
image = image.convert('RGB')

src/modules/ObjectDetectionCoral/tpu_runner.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,10 +517,12 @@ def _get_model_filenames(self, options: Options, tpu_list: list) -> list:
517517
if not any(tpu_list):
518518
return []
519519

520+
device_count = len(tpu_list) # TPUs. We've at least found one
520521
self.device_type = 'Multi-TPU'
522+
if device_count == 1:
523+
self.device_type = 'TPU'
521524

522525
# If TPU found then default is single TPU model file (no segments)
523-
device_count = len(tpu_list) # TPUs. We've at least found one
524526
if not any(options.tpu_segments_lists) or device_count == 1:
525527
return [options.model_tpu_file]
526528

0 commit comments

Comments
 (0)