Update widerface_onnx_inference.py
Browse files
widerface_onnx_inference.py
CHANGED
@@ -61,6 +61,8 @@ def Retinaface_inference(run_ort, args):
|
|
61 |
img_raw = cv2.imread(args.image_path, cv2.IMREAD_COLOR)
|
62 |
# preprocess
|
63 |
img, scale, resize = preprocess(img_raw, INPUT_SIZE, DEVICE)
|
|
|
|
|
64 |
# forward
|
65 |
outputs = run_ort.run(None, {run_ort.get_inputs()[0].name: img})
|
66 |
# postprocess
|
|
|
61 |
img_raw = cv2.imread(args.image_path, cv2.IMREAD_COLOR)
|
62 |
# preprocess
|
63 |
img, scale, resize = preprocess(img_raw, INPUT_SIZE, DEVICE)
|
64 |
+
# to NHWC
|
65 |
+
img = np.transpose(img, (0, 2, 3, 1))
|
66 |
# forward
|
67 |
outputs = run_ort.run(None, {run_ort.get_inputs()[0].name: img})
|
68 |
# postprocess
|