You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am converting my model to onnx using python export.py --weights runs/train/haribo_v32/weights/best.pt --img-size 416 416 --grid --dynamic
code and then I get the output layer names as output_names ['output', '540', '562'] where predictions=model_output[0] which refers to the "output" layer gives me predictions shape (3, 52, 40, 124) which I see in neutron.app a shape of float32[batch,3,y,x,124]. I understand the batch=1, and I reshape this output to predictions = predictions.reshape(-1, 124)
Then I process the output as well as I was doing for static onnx converted model.
obj_conf = predictions[:, 4]
scores = np.max(predictions[:, 5:], axis=1)
boxes=predictions[:, :4]
therefore when I rescale and draw the boxes, they are not correctly places since before rescaling coordinates are already wrong. What should I do? Anyone has any idea?
The text was updated successfully, but these errors were encountered:
Hello, I am converting my model to onnx using
python export.py --weights runs/train/haribo_v32/weights/best.pt --img-size 416 416 --grid --dynamic
code and then I get the output layer names as output_names ['output', '540', '562'] where predictions=model_output[0] which refers to the "output" layer gives me predictions shape (3, 52, 40, 124) which I see in neutron.app a shape of float32[batch,3,y,x,124]. I understand the batch=1, and I reshape this output to predictions = predictions.reshape(-1, 124)
Then I process the output as well as I was doing for static onnx converted model.
obj_conf = predictions[:, 4]
scores = np.max(predictions[:, 5:], axis=1)
boxes=predictions[:, :4]
But when I print, I see that the boxes are wrong:
static onnx model boxes: (one box example)
[ 45.47592, 239.41583, 86.19278, 290.94891]
dynamic onnx model boxes: (one box example)
[ -0.55995 -0.72869 2.397 2.0979]
therefore when I rescale and draw the boxes, they are not correctly places since before rescaling coordinates are already wrong. What should I do? Anyone has any idea?
The text was updated successfully, but these errors were encountered: