rknn-toolkit2-v2.1.0-2024-08-08
/
rknn-toolkit2
/examples
/functions
/custom_op
/non-onnx_standard
/README.md
How to use custom OP function
Model Source
The model and YOLOX version used in this example come from the following open source project: https://github.com/airockchip/YOLOX
Yolox_s Download link: yolox_s.onnx
Script Usage
Usage:
python test.py
Description:
- The default target platform in script is 'RK3588', please modify the 'target_platform' parameter of 'rknn.config()' according to the actual platform.
Processes
The process of this example is as follows:
- Edit the original ONNX model and save the custom ONNX model. Take Sigmoid OP as an example. Users can replace any OP with their own custom OP in ONNX model.
- Init RKNN.
- Register custom OP cstSigmoid.
- Convert custom ONNX model to RKNN model.
- Infer RKNN model in simulator.
- Save the picture of results.
- Release RKNN resource.
Expected Results
- Get an ONNX model named yolox_s_custom.onnx with cstSigmiod OP.
- Get a RKNN model named yolox_s_custom.rknn.
- Get a picture of detection results named result.jpg.
- Note: Different platforms, different versions of tools and drivers may have slightly different results.