techwingslab / yolov5-net

YOLOv5 object detection with C#, ML.NET, ONNX
MIT License
351 stars 104 forks source link

Custom model #56

Open Kickjaw opened 2 years ago

Kickjaw commented 2 years ago

Hello,

I have a custom trained model that started with the yolov5m.yaml configuration. I am lost as to what changes i would need to make to the implementation of the yolomodel. I can provide what ever files anyone needs to help with this.

Thanks

sstainba commented 2 years ago

Once your model is in ONNX format, you can use Netron to inspect it and see the input/output. You use this info to set the values in your inherited model class.

For example, my model has an input that is a float32[1, 3, 640, 640]. That corresponds to the batch size, color depth (I think), height, width

My output is float32[1, 25200, 6]. For this, I am no sure what the '1' is for... but it seems the only number that matters is the last one (6) which is my value for "Dimensions" on the model. I left everything else as the base model and it worked for me.