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

Use YuNet of fixed input shape to avoid 'parseShape' error (#45)

* replace with yunet of fixed input shape

* update quantized yunet

* update yunet filename used in scripts

* add a note message for https://github.com/opencv/opencv_zoo/issues/44
上级 bec0e659
......@@ -16,7 +16,8 @@ Benchmark:
Model:
name: "YuNet"
modelPath: "models/face_detection_yunet/face_detection_yunet_2021dec.onnx"
modelPath: "models/face_detection_yunet/face_detection_yunet_2022mar.onnx"
confThreshold: 0.6
nmsThreshold: 0.3
topK: 5000
\ No newline at end of file
topK: 5000
......@@ -5,6 +5,7 @@ YuNet is a light-weight, fast and accurate face detection model, which achieves
Notes:
- Model source: [here](https://github.com/ShiqiYu/libfacedetection.train/blob/a61a428929148171b488f024b5d6774f93cdbc13/tasks/task1/onnx/yunet.onnx).
- For details on training this model, please visit https://github.com/ShiqiYu/libfacedetection.train.
- This ONNX model has fixed input shape, but OpenCV DNN infers on the exact shape of input image. See https://github.com/opencv/opencv_zoo/issues/44 for more information.
## Demo
......
......@@ -33,7 +33,7 @@ except:
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_2021dec.onnx', help='Path to the model.')
parser.add_argument('--model', '-m', type=str, default='face_detection_yunet_2022mar.onnx', help='Path to the model.')
parser.add_argument('--backend', '-b', type=int, default=backends[0], help=help_msg_backends.format(*backends))
parser.add_argument('--target', '-t', type=int, default=targets[0], help=help_msg_targets.format(*targets))
parser.add_argument('--conf_threshold', type=float, default=0.9, help='Filter out faces of confidence < conf_threshold.')
......
......@@ -78,8 +78,9 @@ class Quantize:
models=dict(
yunet=Quantize(model_path='../../models/face_detection_yunet/face_detection_yunet_2021dec.onnx',
calibration_image_dir='../../benchmark/data/face_detection'),
yunet=Quantize(model_path='../../models/face_detection_yunet/face_detection_yunet_2022mar.onnx',
calibration_image_dir='../../benchmark/data/face_detection',
transforms=Compose([Resize(size=(160, 120))])),
sface=Quantize(model_path='../../models/face_recognition_sface/face_recognition_sface_2021dec.onnx',
calibration_image_dir='../../benchmark/data/face_recognition',
transforms=Compose([Resize(size=(112, 112))])),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册