Skip to content

Latest commit

 

History

History

pfld

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

pfld

Input --> Output

Convert

pt --> onnx --> onnx-sim --> ncnnOptimize --> ncnn

# import os
# import torch
# # 0. pt模型下载及初始化
# # 1. download onnx model # Windows下手动执行
# os.system("wget xxxx.onnx -O xxx.onnx")

# # 2. onnx --> onnxsim
# os.system("python3 -m onnxsim xxx.onnx sim.onnx")

# # 3. onnx --> ncnn
# os.system("onnx2ncnn sim.onnx ncnn.param ncnn.bin")

# # 4. ncnn --> optmize ---> ncnn
# os.system("ncnnoptimize ncnn.param ncnn.bin opt.param opt.bin 1")  # 数字0 代表fp32 ;1代表fp16

Example project

Reference