InsightFace-REST icon indicating copy to clipboard operation
InsightFace-REST copied to clipboard

SCRFD ONNX model batch size

Open deckardcain1 opened this issue 3 years ago • 1 comments
trafficstars

Hi, can't seem to get onnx scrfd inference working with batch sizes greater than 1. It's failing during the prepare phase. Here is the code I'm running:

onnx_batch_size = 64
height, width = [640,640]
reshaped = reshape(model, n=onnx_batch_size, h=height, w=width)
onnx_model = reshaped.SerializeToString()
config = Configs(models_dir="/models/onnx/scrfd_10g_gnkps/")
outputs = config.get_outputs_order("scrfd_10g_gnkps")
detector = scrfd(onnx_model, onnx_backend, outputs)
detector.prepare(nms=0.4)

I'm getting this error message:

index: 0 Got: 1 Expected: 64
Please fix either the inputs or the model.

deckardcain1 avatar May 06 '22 21:05 deckardcain1

Currently batch inference is supported only for TensorRT

SthPhoenix avatar May 06 '22 22:05 SthPhoenix