提交 42802fb1 编写于 作者: Y Yuantao Feng 提交者: GitHub

Update ONNX opset version of YuNet to 11 for quantization (#34)

* update ONNX opset version of YuNet to 11 for quantization

* fix corruption when face detection results is none
上级 627508b5
......@@ -16,7 +16,7 @@ Benchmark:
Model:
name: "YuNet"
modelPath: "models/face_detection_yunet/face_detection_yunet_2021sep.onnx"
modelPath: "models/face_detection_yunet/face_detection_yunet_2021dec.onnx"
confThreshold: 0.6
nmsThreshold: 0.3
topK: 5000
\ No newline at end of file
......@@ -21,7 +21,7 @@ def str2bool(v):
parser = argparse.ArgumentParser(description='YuNet: A Fast and Accurate CNN-based Face Detector (https://github.com/ShiqiYu/libfacedetection).')
parser.add_argument('--input', '-i', type=str, help='Path to the input image. Omit for using default camera.')
parser.add_argument('--model', '-m', type=str, default='face_detection_yunet_2021sep.onnx', help='Path to the model.')
parser.add_argument('--model', '-m', type=str, default='face_detection_yunet_2021dec.onnx', help='Path to the model.')
parser.add_argument('--conf_threshold', type=float, default=0.9, help='Filter out faces of confidence < conf_threshold.')
parser.add_argument('--nms_threshold', type=float, default=0.3, help='Suppress bounding boxes of iou >= nms_threshold.')
parser.add_argument('--top_k', type=int, default=5000, help='Keep top_k bounding boxes before NMS.')
......@@ -42,7 +42,7 @@ def visualize(image, results, box_color=(0, 255, 0), text_color=(0, 0, 255), fps
if fps is not None:
cv.putText(output, 'FPS: {:.2f}'.format(fps), (0, 15), cv.FONT_HERSHEY_SIMPLEX, 0.5, text_color)
for det in results:
for det in (results if results is not None else []):
bbox = det[0:4].astype(np.int32)
cv.rectangle(output, (bbox[0], bbox[1]), (bbox[0]+bbox[2], bbox[1]+bbox[3]), box_color, 2)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册