NanoDet-Plusā”Super fast and lightweight anchor-free object detection model. š„Only 980 KB(int8) / 1.8MB (fp16) and run 97FPS on cellphoneš„
5.78k
stars
1.04k
forks
source link
The onnx model(which is transfor by export_onnx.py) out put is differ from pytoch model #478
Open
Genlk opened 1 year ago
def image_preprocess(img_path): img = cv2.imread(img_path).astype("float32")/255
mean = [103.53, 116.28, 123.675] # Image net values
def test_onnx_model(onnx_model,img_path=None): if img_path is None: img_path = "path for img" imgdata = image_preprocess(img_path) sess = rt.InferenceSession(onnx_model) input_name = sess.get_inputs()[0].name output_detect_name = sess.get_outputs()[0].name pred_onnx0= sess.run([output_detect_name], {input_name: imgdata}) print("outputs:") print(np.array(pred_onnx0))