Skip to content

Commit 888b893

Browse files
authored
Merge pull request #99 from seth-planet/seg_name_lists
Use new TPU segment option
2 parents ac1a881 + 2a6f862 commit 888b893

4 files changed

Lines changed: 379 additions & 185 deletions

File tree

src/modules/ObjectDetectionCoral/objectdetection_coral_multitpu.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def main():
244244
tot_infr_time += infr_time
245245

246246
# Start a timer for the last ~half of the run for more accurate benchmark
247-
if chunk_i > (args.count-1) / 3.0:
247+
if chunk_i > (args.count-1) / 2.0:
248248
half_infr_count += 1
249249
if half_wall_start is None:
250250
half_wall_start = time.perf_counter()
@@ -271,25 +271,25 @@ def main():
271271
if half_wall_start is not None:
272272
half_wall_time = time.perf_counter() - half_wall_start
273273

274-
print('completed one run every %.2fms for %d runs; %.2fms wall time for a single run' %
274+
logging.info('completed one run every %.2fms for %d runs; %.2fms wall time for a single run' %
275275
(wall_time * 1000 / args.count, args.count,
276276
(time.perf_counter() - start_one) * 1000))
277277

278-
print('%.2fms avg time blocked across %d threads; %.2fms ea for final %d inferences' %
278+
logging.info('%.2fms avg time blocked across %d threads; %.3fms ea for final %d inferences' %
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')

0 commit comments

Comments
 (0)