|
|
@ -432,16 +432,24 @@ class Exporter:
|
|
|
|
Path(asset).unlink() # delete zip
|
|
|
|
Path(asset).unlink() # delete zip
|
|
|
|
pnnx.chmod(0o777) # set read, write, and execute permissions for everyone
|
|
|
|
pnnx.chmod(0o777) # set read, write, and execute permissions for everyone
|
|
|
|
|
|
|
|
|
|
|
|
cmd = [
|
|
|
|
use_ncnn = True
|
|
|
|
str(pnnx),
|
|
|
|
ncnn_args = [
|
|
|
|
str(f_ts),
|
|
|
|
f'ncnnparam={f / "model.ncnn.param"}',
|
|
|
|
|
|
|
|
f'ncnnbin={f / "model.ncnn.bin"}',
|
|
|
|
|
|
|
|
f'ncnnpy={f / "model_ncnn.py"}', ] if use_ncnn else []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use_pnnx = False
|
|
|
|
|
|
|
|
pnnx_args = [
|
|
|
|
f'pnnxparam={f / "model.pnnx.param"}',
|
|
|
|
f'pnnxparam={f / "model.pnnx.param"}',
|
|
|
|
f'pnnxbin={f / "model.pnnx.bin"}',
|
|
|
|
f'pnnxbin={f / "model.pnnx.bin"}',
|
|
|
|
f'pnnxpy={f / "model_pnnx.py"}',
|
|
|
|
f'pnnxpy={f / "model_pnnx.py"}',
|
|
|
|
f'pnnxonnx={f / "model.pnnx.onnx"}',
|
|
|
|
f'pnnxonnx={f / "model.pnnx.onnx"}', ] if use_pnnx else []
|
|
|
|
f'ncnnparam={f / "model.ncnn.param"}',
|
|
|
|
|
|
|
|
f'ncnnbin={f / "model.ncnn.bin"}',
|
|
|
|
cmd = [
|
|
|
|
f'ncnnpy={f / "model_ncnn.py"}',
|
|
|
|
str(pnnx),
|
|
|
|
|
|
|
|
str(f_ts),
|
|
|
|
|
|
|
|
*ncnn_args,
|
|
|
|
|
|
|
|
*pnnx_args,
|
|
|
|
f'fp16={int(self.args.half)}',
|
|
|
|
f'fp16={int(self.args.half)}',
|
|
|
|
f'device={self.device.type}',
|
|
|
|
f'device={self.device.type}',
|
|
|
|
f'inputshape="{[self.args.batch, 3, *self.imgsz]}"', ]
|
|
|
|
f'inputshape="{[self.args.batch, 3, *self.imgsz]}"', ]
|
|
|
|