提交 a9918fbf authored 作者: Laurentiu Diaconu's avatar Laurentiu Diaconu

updated coreml conversion to do pixel scaling between 0.0 and 1.0

上级 e8cf24b6
......@@ -61,7 +61,8 @@ if __name__ == '__main__':
import coremltools as ct
print('\nStarting CoreML export with coremltools %s...' % ct.__version__)
model = ct.convert(ts, inputs=[ct.ImageType(name='images', shape=img.shape)]) # convert
# convert model from torchscript and apply pixel scaling as per detect.py
model = ct.convert(ts, inputs=[ct.ImageType(name='images', shape=img.shape, scale=1/255.0, bias=[0, 0, 0])])
f = opt.weights.replace('.pt', '.mlmodel') # filename
model.save(f)
print('CoreML export success, saved as %s' % f)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论