Chilicyy d4c63a6093 | 1 year ago | |
---|---|---|
.. | ||
Android | 1 year ago | |
README.md | 1 year ago | |
export_torchscript.py | 1 year ago | |
infer-ncnn-model.py | 1 year ago |
python ./deploy/NCNN/export_torchscript.py \
--weights yolov6lite_s.pt \
--img 320 320 \
--batch 1
--weights
: The path of yolov6 model weights.--img
: Image size of model inputs.--batch
: Batch size of model inputs.--device
: Export device. Cuda device : 0 or 0,1,2,3 ... , CPU : cpu .Download tools from PNNX
Unzip the pnnx-YYYYMMDD-PLANTFORM.zip
and add the pnnx
to your PATH
.
Then run the following command to export ncnn model :
mkdir -p work_dir
mv yolov6lite_s.torchscript work_dir
cd work_dir
pnnx yolov6lite_s.torchscript inputshape=[1,3,320,320]f32
You will get yolov6lite_s.ncnn.bin
and yolov6lite_s.ncnn.param
in work_dir
.
If you want to try int8 quantization, you can get more information from here .
python3 deploy/NCNN/infer-ncnn-model.py \
data/images/image1.jpg \
work_dir/yolov6lite_s.ncnn.param \
work_dir/yolov6lite_s.ncnn.bin \
--img-size 320 320 \
--max-stride 64 \
--show
img
: The path of image you want to detect.param
: The NCNN param path.bin
: The NCNN bin path.--show
: Whether to show detection resulut.--out-dir
: The output path to save detection result.--img-size
: The image height and width for model input.--max-stride
: The yolov6 lite model max stride.Notice!
If you want to try norm yolov6 model such as yolov6n/s/m/l
, you should add --max-stride 32
flags .
YOLOv6: a single-stage object detection framework dedicated to industrial applications.
https://readpaper.com/paper/4665431421117022209
Jupyter Notebook Python C++ other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》