-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can you add inference script? #12
Comments
same question. did you increase batch size? |
Hey, @ThiagoMateo. The script can be modified for batching inference in simple way, as you use for-loop to process the NMS and decoding function. The network part can support batch of input like you say. Sorry for your inconvenience. |
hey @peteryuX . i change your code like below. Is it correct? But how to set dynamic batching? |
Did you try |
sorry @peteryuX . could you help me? |
hi @peteryuX . i has follow your code many time and it is beatiful work. Thank you! |
Hey Guys, I think I share not suitable information for you. In if training:
out = (bbox_regressions, landm_regressions, classifications)
else:
out = (bbox_regressions, landm_regressions, classifications) In bbox_regressions, landm_regressions, classifications = model(img)
results = []
for i in range(img.shape[0]):
preds = tf.concat( # [bboxes, landms, landms_valid, conf]
[bbox_regressions[i], landm_regressions[i],
tf.ones_like(classifications[i, :, 0][..., tf.newaxis]),
classifications[i, :, 1][..., tf.newaxis]], 1)
priors = prior_box_tf((img.shape[1], img.shape[2]),
cfg['min_sizes'], cfg['steps'], cfg['clip'])
decode_preds = decode_tf(preds, priors, cfg['variances'])
selected_indices = tf.image.non_max_suppression(
boxes=decode_preds[:, :4],
scores=decode_preds[:, -1],
max_output_size=tf.shape(decode_preds)[0], # the max output size you want
iou_threshold=0.4,
score_threshold=0.02)
results.append(tf.gather(decode_preds, selected_indices).numpy()) |
Also any plan to prune to the model to speed up the results?
Can we increase batch size during inferencing?
The text was updated successfully, but these errors were encountered: