zhengrongzhang hongywei commited on
Commit
f3e60d3
1 Parent(s): c2b2584

Update widerface_onnx_inference.py (#3)

Browse files

- Update widerface_onnx_inference.py (4e854618e51fa8eb0b58c94cf94c1e9c4d47b66b)


Co-authored-by: Hongyang Wei <hongywei@users.noreply.huggingface.co>

Files changed (1) hide show
  1. widerface_onnx_inference.py +2 -0
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