yasenh / libtorch-yolov5

A LibTorch inference implementation of the yolov5
MIT License
372 stars 114 forks source link

Can you give sample code of batch inference ? #29

Closed yandongwei closed 3 years ago

yandongwei commented 3 years ago

thx!

missbook520 commented 3 years ago

Is there an example of batch prediction?thx!!

yasenh commented 3 years ago

You can refer to #23 to export torchscript model with different batch size: e.g. python models/export.py --weights yolov5s.pt --img 640 --batch 2

Then use torch::cat to concatenate images into batch