You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to use Ultra-lightweight face detection model for a face recognition project on a dev board. For this application, it requires to convert the model to rknn model and run the converted model on rknn. If there is any solution , could you please help me to use Ultra-lightweight face detection mode on RKNN?, Thanks
The text was updated successfully, but these errors were encountered:
import numpy as np
from rknn.api import RKNN
MODEL_PATH = "models/onnx/version-RFB-320_new.onnx"
MODEL_NAME = MODEL_PATH.split("/")[-1]
# Initialize RKNN object
rknn: RKNN = RKNN(verbose=False)
if rknn.config(target_platform='rk3588'): #dynamic_input=DYNAMIC_INPUT
print("RKNN config failed")
exit(1)
# Load ONNX model
# input_size_list = [[1, 3, 240, 320]]
ret = rknn.load_onnx(model=MODEL_PATH) #, inputs=['modelInput'], input_size_list=input_size_list
# Check for successful model loading
if ret != 0:
print("Loading ONNX model failed")
exit(1)
ret = rknn.build(do_quantization=False, dataset="./dataset.txt")
if ret != 0:
print("Building RKNN model failed")
exit(1)
if rknn.init_runtime():
print("RKNN initialization failed")
exit(1)
rknn_model_path = MODEL_PATH.replace(".onnx", ".rknn")
ret = rknn.export_rknn(rknn_model_path)
if ret != 0:
print("Export failed")
rknn.release()
exit(ret)
input_data = np.random.rand(1, 240, 320, 3).astype(np.float32)
outputs = rknn.inference(inputs=[input_data])
rknn.release()
It is working for me with rknn-toolkit2==2.2.0. Make sure that you have the same versions for rknn-toolkit2, rknn-toolkit-lite and RKNPU driver on your board
I need to use Ultra-lightweight face detection model for a face recognition project on a dev board. For this application, it requires to convert the model to rknn model and run the converted model on rknn. If there is any solution , could you please help me to use Ultra-lightweight face detection mode on RKNN?, Thanks
The text was updated successfully, but these errors were encountered: