diff --git a/benchmark/config/face_detection_yunet.yaml b/benchmark/config/face_detection_yunet.yaml index b6fbb6bc..cbe56e08 100644 --- a/benchmark/config/face_detection_yunet.yaml +++ b/benchmark/config/face_detection_yunet.yaml @@ -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 diff --git a/models/face_detection_yunet/demo.py b/models/face_detection_yunet/demo.py index 52d36b89..a5f5b1b9 100644 --- a/models/face_detection_yunet/demo.py +++ b/models/face_detection_yunet/demo.py @@ -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) diff --git a/models/face_detection_yunet/face_detection_yunet_2021dec.onnx b/models/face_detection_yunet/face_detection_yunet_2021dec.onnx new file mode 100644 index 00000000..6c259a18 --- /dev/null +++ b/models/face_detection_yunet/face_detection_yunet_2021dec.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0e63eddb7fad35ad1a23f066507b4f3d49de64ad82a3d2ec1e6bf3ba25815f3 +size 345535 diff --git a/models/face_detection_yunet/face_detection_yunet_2021sep.onnx b/models/face_detection_yunet/face_detection_yunet_2021sep.onnx deleted file mode 100644 index 3d8a44f2..00000000 --- a/models/face_detection_yunet/face_detection_yunet_2021sep.onnx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:be449cd884ae1bc17e089b78e132e80df959b88452f32c487c6fb0a8c8e27f14 -size 344799