代码拉取完成,页面将自动刷新
import sys
if __name__ == '__main__':
if len(sys.argv) != 3:
print('Usage: python {} xxx.rknn xxx.hw.rknn'.format(sys.argv[0]))
print('Such as: python {} mobilenet_v1.rknn mobilenet_v1.hw.rknn'.format(sys.argv[0]))
exit(1)
from rknnlite.api import RKNNLite as RKNN
orig_rknn = sys.argv[1]
hw_rknn = sys.argv[2]
# Create RKNN object
rknn = RKNN()
# Load rknn model
print('--> Loading RKNN model')
ret = rknn.load_rknn(orig_rknn)
if ret != 0:
print('Load RKNN model failed!')
exit(ret)
print('done')
# Init runtime environment
print('--> Init runtime environment')
# Note: you must set rknn2precompile=True when call rknn.init_runtime()
# RK3399Pro with android system does not support this function.
ret = rknn.init_runtime(rknn2precompile=True)
if ret != 0:
print('Init runtime environment failed')
exit(ret)
print('done')
ret = rknn.export_rknn_precompile_model(hw_rknn)
rknn.release()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。