Skip to content

Commit

Permalink
update benchmarks code
Browse files Browse the repository at this point in the history
  • Loading branch information
hunglc007 committed May 22, 2020
1 parent 84ea66c commit 7b30fc6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,17 @@ def run_model(x):
prev_time = time.time()
# pred_bbox = model.predict(image_data)
if FLAGS.framework == 'tf':
pred_bbox = run_model(image_data)
pred_bbox = []
result = run_model(image_data)
for value in result:
value = value.numpy()
pred_bbox.append(value)
if FLAGS.model == 'yolov4':
pred_bbox = utils.postprocess_bbbox(pred_bbox, ANCHORS, STRIDES, XYSCALE)
else:
pred_bbox = utils.postprocess_bbbox(pred_bbox, ANCHORS, STRIDES)
bboxes = utils.postprocess_boxes(pred_bbox, original_image_size, input_size, 0.25)
bboxes = utils.nms(bboxes, 0.213, method='nms')
elif FLAGS.framework == 'trt':
pred_bbox = []
result = infer(batched_input)
Expand Down

0 comments on commit 7b30fc6

Please sign in to comment.