Yuantao Feng commited on
Commit
9e1d36f
·
1 Parent(s): 83bb178

correct default values of model filenames in demo scripts (#11)

Browse files
models/face_detection_yunet/demo.py CHANGED
@@ -21,7 +21,7 @@ def str2bool(v):
21
 
22
  parser = argparse.ArgumentParser(description='YuNet: A Fast and Accurate CNN-based Face Detector (https://github.com/ShiqiYu/libfacedetection).')
23
  parser.add_argument('--input', '-i', type=str, help='Path to the input image. Omit for using default camera.')
24
- parser.add_argument('--model', '-m', type=str, default='face_detection_yunet.onnx', help='Path to the model.')
25
  parser.add_argument('--conf_threshold', type=float, default=0.9, help='Filter out faces of confidence < conf_threshold.')
26
  parser.add_argument('--nms_threshold', type=float, default=0.3, help='Suppress bounding boxes of iou >= nms_threshold.')
27
  parser.add_argument('--top_k', type=int, default=5000, help='Keep top_k bounding boxes before NMS.')
 
21
 
22
  parser = argparse.ArgumentParser(description='YuNet: A Fast and Accurate CNN-based Face Detector (https://github.com/ShiqiYu/libfacedetection).')
23
  parser.add_argument('--input', '-i', type=str, help='Path to the input image. Omit for using default camera.')
24
+ parser.add_argument('--model', '-m', type=str, default='face_detection_yunet_2021sep.onnx', help='Path to the model.')
25
  parser.add_argument('--conf_threshold', type=float, default=0.9, help='Filter out faces of confidence < conf_threshold.')
26
  parser.add_argument('--nms_threshold', type=float, default=0.3, help='Suppress bounding boxes of iou >= nms_threshold.')
27
  parser.add_argument('--top_k', type=int, default=5000, help='Keep top_k bounding boxes before NMS.')
models/face_recognition_sface/demo.py CHANGED
@@ -27,7 +27,7 @@ parser = argparse.ArgumentParser(
27
  description="SFace: Sigmoid-Constrained Hypersphere Loss for Robust Face Recognition (https://ieeexplore.ieee.org/document/9318547)")
28
  parser.add_argument('--input1', '-i1', type=str, help='Path to the input image 1.')
29
  parser.add_argument('--input2', '-i2', type=str, help='Path to the input image 2.')
30
- parser.add_argument('--model', '-m', type=str, default='face_recognition_sface.onnx', help='Path to the model.')
31
  parser.add_argument('--dis_type', type=int, choices=[0, 1], default=0, help='Distance type. \'0\': cosine, \'1\': norm_l1.')
32
  parser.add_argument('--save', '-s', type=str, default=False, help='Set true to save results. This flag is invalid when using camera.')
33
  parser.add_argument('--vis', '-v', type=str2bool, default=True, help='Set true to open a window for result visualization. This flag is invalid when using camera.')
@@ -37,7 +37,7 @@ if __name__ == '__main__':
37
  # Instantiate SFace for face recognition
38
  recognizer = SFace(modelPath=args.model, disType=args.dis_type)
39
  # Instantiate YuNet for face detection
40
- detector = YuNet(modelPath='../face_detection_yunet/face_detection_yunet.onnx',
41
  inputSize=[320, 320],
42
  confThreshold=0.9,
43
  nmsThreshold=0.3,
 
27
  description="SFace: Sigmoid-Constrained Hypersphere Loss for Robust Face Recognition (https://ieeexplore.ieee.org/document/9318547)")
28
  parser.add_argument('--input1', '-i1', type=str, help='Path to the input image 1.')
29
  parser.add_argument('--input2', '-i2', type=str, help='Path to the input image 2.')
30
+ parser.add_argument('--model', '-m', type=str, default='face_recognition_sface_2021sep.onnx', help='Path to the model.')
31
  parser.add_argument('--dis_type', type=int, choices=[0, 1], default=0, help='Distance type. \'0\': cosine, \'1\': norm_l1.')
32
  parser.add_argument('--save', '-s', type=str, default=False, help='Set true to save results. This flag is invalid when using camera.')
33
  parser.add_argument('--vis', '-v', type=str2bool, default=True, help='Set true to open a window for result visualization. This flag is invalid when using camera.')
 
37
  # Instantiate SFace for face recognition
38
  recognizer = SFace(modelPath=args.model, disType=args.dis_type)
39
  # Instantiate YuNet for face detection
40
+ detector = YuNet(modelPath='../face_detection_yunet/face_detection_yunet_2021sep.onnx',
41
  inputSize=[320, 320],
42
  confThreshold=0.9,
43
  nmsThreshold=0.3,
models/human_segmentation_pphumanseg/demo.py CHANGED
@@ -21,7 +21,7 @@ def str2bool(v):
21
 
22
  parser = argparse.ArgumentParser(description='PPHumanSeg (https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.2/contrib/PP-HumanSeg)')
23
  parser.add_argument('--input', '-i', type=str, help='Path to the input image. Omit for using default camera.')
24
- parser.add_argument('--model', '-m', type=str, default='human_segmentation_pphumanseg.onnx', help='Path to the model.')
25
  parser.add_argument('--save', '-s', type=str, default=False, help='Set true to save results. This flag is invalid when using camera.')
26
  parser.add_argument('--vis', '-v', type=str2bool, default=True, help='Set true to open a window for result visualization. This flag is invalid when using camera.')
27
  args = parser.parse_args()
 
21
 
22
  parser = argparse.ArgumentParser(description='PPHumanSeg (https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.2/contrib/PP-HumanSeg)')
23
  parser.add_argument('--input', '-i', type=str, help='Path to the input image. Omit for using default camera.')
24
+ parser.add_argument('--model', '-m', type=str, default='human_segmentation_pphumanseg_2021oct.onnx', help='Path to the model.')
25
  parser.add_argument('--save', '-s', type=str, default=False, help='Set true to save results. This flag is invalid when using camera.')
26
  parser.add_argument('--vis', '-v', type=str2bool, default=True, help='Set true to open a window for result visualization. This flag is invalid when using camera.')
27
  args = parser.parse_args()
models/image_classification_ppresnet/demo.py CHANGED
@@ -21,7 +21,7 @@ def str2bool(v):
21
 
22
  parser = argparse.ArgumentParser(description='Deep Residual Learning for Image Recognition (https://arxiv.org/abs/1512.03385, https://github.com/PaddlePaddle/PaddleHub)')
23
  parser.add_argument('--input', '-i', type=str, help='Path to the input image.')
24
- parser.add_argument('--model', '-m', type=str, default='image_classification_ppresnet50.onnx', help='Path to the model.')
25
  args = parser.parse_args()
26
 
27
  if __name__ == '__main__':
 
21
 
22
  parser = argparse.ArgumentParser(description='Deep Residual Learning for Image Recognition (https://arxiv.org/abs/1512.03385, https://github.com/PaddlePaddle/PaddleHub)')
23
  parser.add_argument('--input', '-i', type=str, help='Path to the input image.')
24
+ parser.add_argument('--model', '-m', type=str, default='image_classification_ppresnet50_2021oct.onnx', help='Path to the model.')
25
  args = parser.parse_args()
26
 
27
  if __name__ == '__main__':
models/text_detection_db/demo.py CHANGED
@@ -21,7 +21,7 @@ def str2bool(v):
21
 
22
  parser = argparse.ArgumentParser(description='Real-time Scene Text Detection with Differentiable Binarization (https://arxiv.org/abs/1911.08947).')
23
  parser.add_argument('--input', '-i', type=str, help='Path to the input image. Omit for using default camera.')
24
- parser.add_argument('--model', '-m', type=str, default='text_detection_DB_TD500_resnet18.onnx', help='Path to the model.')
25
  parser.add_argument('--width', type=int, default=736,
26
  help='Preprocess input image by resizing to a specific width. It should be multiple by 32.')
27
  parser.add_argument('--height', type=int, default=736,
 
21
 
22
  parser = argparse.ArgumentParser(description='Real-time Scene Text Detection with Differentiable Binarization (https://arxiv.org/abs/1911.08947).')
23
  parser.add_argument('--input', '-i', type=str, help='Path to the input image. Omit for using default camera.')
24
+ parser.add_argument('--model', '-m', type=str, default='text_detection_DB_TD500_resnet18_2021sep.onnx', help='Path to the model.')
25
  parser.add_argument('--width', type=int, default=736,
26
  help='Preprocess input image by resizing to a specific width. It should be multiple by 32.')
27
  parser.add_argument('--height', type=int, default=736,
models/text_recognition_crnn/demo.py CHANGED
@@ -26,7 +26,7 @@ def str2bool(v):
26
  parser = argparse.ArgumentParser(
27
  description="An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition (https://arxiv.org/abs/1507.05717)")
28
  parser.add_argument('--input', '-i', type=str, help='Path to the input image. Omit for using default camera.')
29
- parser.add_argument('--model', '-m', type=str, default='text_recognition_CRNN_VGG_BiLSTM_CTC.onnx', help='Path to the model.')
30
  parser.add_argument('--width', type=int, default=736,
31
  help='The width of input image being sent to the text detector.')
32
  parser.add_argument('--height', type=int, default=736,
@@ -48,7 +48,7 @@ if __name__ == '__main__':
48
  # Instantiate CRNN for text recognition
49
  recognizer = CRNN(modelPath=args.model)
50
  # Instantiate DB for text detection
51
- detector = DB(modelPath='../text_detection_db/text_detection_db.onnx',
52
  inputSize=[args.width, args.height],
53
  binaryThreshold=0.3,
54
  polygonThreshold=0.5,
 
26
  parser = argparse.ArgumentParser(
27
  description="An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition (https://arxiv.org/abs/1507.05717)")
28
  parser.add_argument('--input', '-i', type=str, help='Path to the input image. Omit for using default camera.')
29
+ parser.add_argument('--model', '-m', type=str, default='text_recognition_CRNN_VGG_BiLSTM_CTC_2021sep.onnx', help='Path to the model.')
30
  parser.add_argument('--width', type=int, default=736,
31
  help='The width of input image being sent to the text detector.')
32
  parser.add_argument('--height', type=int, default=736,
 
48
  # Instantiate CRNN for text recognition
49
  recognizer = CRNN(modelPath=args.model)
50
  # Instantiate DB for text detection
51
+ detector = DB(modelPath='../text_detection_db/text_detection_DB_IC15_resnet18_2021sep.onnx',
52
  inputSize=[args.width, args.height],
53
  binaryThreshold=0.3,
54
  polygonThreshold=0.5,