Update widerface_onnx_evalute.py

#2
Files changed (1) hide show
  1. widerface_onnx_evalute.py +2 -0
widerface_onnx_evalute.py CHANGED
@@ -67,6 +67,8 @@ def Retinaface_evalute(run_ort, args):
67
  img_raw = cv2.imread(image_path, cv2.IMREAD_COLOR)
68
  # preprocess
69
  img, scale, resize = preprocess(img_raw, INPUT_SIZE, DEVICE)
 
 
70
  # forward
71
  outputs = run_ort.run(None, {run_ort.get_inputs()[0].name: img})
72
  # postprocess
 
67
  img_raw = cv2.imread(image_path, cv2.IMREAD_COLOR)
68
  # preprocess
69
  img, scale, resize = preprocess(img_raw, INPUT_SIZE, DEVICE)
70
+ # to NHWC
71
+ img = np.transpose(img, (0, 2, 3, 1))
72
  # forward
73
  outputs = run_ort.run(None, {run_ort.get_inputs()[0].name: img})
74
  # postprocess