SthPhoenix / InsightFace-REST

InsightFace REST API for easy deployment of face recognition services with TensorRT in Docker.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SCRFD ONNX model batch size

deckardcain1 opened this issue · comments

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.

Currently batch inference is supported only for TensorRT