-
Notifications
You must be signed in to change notification settings - Fork 654
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
infer multiple images at once #2133
Comments
@oym050922021 hi, have you changed anything in yolox model config? |
@hi, i changed the type of loss funtion in yolox model conifg. I changed the line 99 code in mmdeploy/mmdeploy/codebase/mmdet/models/dense_heads/yolox_head.py and it worked. |
@oym050922021 hi, glad to know it worked. Actually, we could remove line 97-99 since the score filtering would be done in nms. Could you kindly give us a PR to fix it? |
@RunningLeon hi, thank you very much for your reply. what does PR stand for please? |
Pull Request. You could fork our repo and contribute your code to us. |
This issue is marked as stale because it has been marked as invalid or awaiting response for 7 days without any further response. It will be closed in 5 days if the stale label is not removed or if there is no further response. |
This issue is closed because it has been stale for 5 days. Please open a new issue if you have similar issues or you have any new updates now. |
Checklist
Describe the bug
How can I infer multiple images at once with the API named mmdeploy.apis.inference_model?
Reproduction
from mmdeploy.apis import inference_model
from glob import glob
def get_batch_image(images_list, batchsize):
images_cnt = len(images_list)
batch_cnt = int(images_cnt / batchsize)
residue = images_cnt - batch_cnt * batchsize
batch_images = []
for i in range(batch_cnt):
tmp = images_list[i*batchsize:(i+1)*batchsize]
batch_images.append(tmp)
if residue:
tmp = images_list[-residue:]
batch_images.append(tmp)
return batch_images
model_cfg = "/root/Ouyangmei/openmmlab/mmdetection/configs/yolox/yolox_s_8xb8-300e_coco.py"
deploy_cfg = 'configs/mmdet/detection/detection_onnxruntime_dynamic.py'
backend_files = ['mmdeploy_models/mmdeploy/yolox/end2end.onnx']
images_folder = '/root/Ouyangmei/openmmlab/mmdetection/datasets/teeth/images/test'
images_list = glob(images_folder + "/*.png")
batch_images = get_batch_image(images_list, batchsize = 4)
for images in batch_images:
results = inference_model(model_cfg, deploy_cfg, backend_files, images, device)
Environment
Error traceback
The text was updated successfully, but these errors were encountered: