I’m using Vim3 Pro model. Decided to move from TEngine framework to ksnn.
I’ve cloned ksnn git and aml_npu_sdk git
but I cant understand what params I should give to convertor:
It needs to contain the relative path of a sample image for the model conversion.
Content can be as simple as ./sample.png, where sample.png is just any simple image to test the model.
This is for printing the diagnostic information of the model conversion parameters, just more verbose during the conversion process.
Yes, you can use the ONNX model to do the conversion it will work.
No, I understand how to convert)
After the convert operation you get model.nb libnn_model.so
But how to run it? python3 resnet50.py \ (This file contains ksnn library and I don’t understand - can I use yours, or should I make mine?) --model ./models/VIM3/model.nb (OK, I got it in last step) --library ./libs/libnn_model.so (OK, I got it in last step) --picture pic.jpg --level 0 (OK, just parametr)
Here I dont understand
@Agent_kapo that is an example script to use the resnet model, for yolov5s, you need to make a similar kind of script that does the input and output processing,
You can refer to the resnet example on how to load the KSNN ONNX converted model, and you can write your own post-processing to get the results from the output tensor data.
You can follow this example code to do post-processing from a yolo model:
As I understand - I take script for loading .nb model from resnet50.py and then I take the part from run_inference.py (of yolov8n) to upload the results?
Model’s output are [1, 144, 80, 80], [1, 144, 40, 40] and [1, 144, 20, 20]. You can simply understand that they ony match the dimension number. The SPAN is the number of boxes for each based prediction. The LISTSIZE is each box information number. [:80] is the information of classes confidence. [80:] is the information of location.
So, if your model’s classes is not 80, you need to modify the LISTSIZE.