help_msg_backends="Choose one of the computation backends: {:d}: OpenCV implementation (default); {:d}: CUDA"
help_msg_targets="Chose one of the target computation devices: {:d}: CPU (default); {:d}: CUDA; {:d}: CUDA fp16"
try:
backends+=[cv.dnn.DNN_BACKEND_TIMVX]
targets+=[cv.dnn.DNN_TARGET_NPU]
help_msg_backends+="; {:d}: TIMVX"
help_msg_targets+="; {:d}: NPU"
except:
print('This version of OpenCV does not support TIM-VX and NPU. Visit https://gist.github.com/fengyuentau/5a7a5ba36328f2b763aea026c43fa45f for more information.')
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.')
help_msg_backends="Choose one of the computation backends: {:d}: OpenCV implementation (default); {:d}: CUDA"
help_msg_targets="Chose one of the target computation devices: {:d}: CPU (default); {:d}: CUDA; {:d}: CUDA fp16"
try:
backends+=[cv.dnn.DNN_BACKEND_TIMVX]
targets+=[cv.dnn.DNN_TARGET_NPU]
help_msg_backends+="; {:d}: TIMVX"
help_msg_targets+="; {:d}: NPU"
except:
print('This version of OpenCV does not support TIM-VX and NPU. Visit https://gist.github.com/fengyuentau/5a7a5ba36328f2b763aea026c43fa45f for more information.')
parser=argparse.ArgumentParser(
description="SFace: Sigmoid-Constrained Hypersphere Loss for Robust Face Recognition (https://ieeexplore.ieee.org/document/9318547)")
parser.add_argument('--input1','-i1',type=str,help='Path to the input image 1.')
parser.add_argument('--input2','-i2',type=str,help='Path to the input image 2.')
parser.add_argument('--model','-m',type=str,default='face_recognition_sface_2021dec.onnx',help='Path to the model.')
parser.add_argument('--save','-s',type=str,default=False,help='Set true to save results. This flag is invalid when using camera.')
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.')
help_msg_backends="Choose one of the computation backends: {:d}: OpenCV implementation (default); {:d}: CUDA"
help_msg_targets="Chose one of the target computation devices: {:d}: CPU (default); {:d}: CUDA; {:d}: CUDA fp16"
try:
backends+=[cv.dnn.DNN_BACKEND_TIMVX]
targets+=[cv.dnn.DNN_TARGET_NPU]
help_msg_backends+="; {:d}: TIMVX"
help_msg_targets+="; {:d}: NPU"
except:
print('This version of OpenCV does not support TIM-VX and NPU. Visit https://gist.github.com/fengyuentau/5a7a5ba36328f2b763aea026c43fa45f for more information.')
parser.add_argument('--save','-s',type=str,default=False,help='Set true to save results. This flag is invalid when using camera.')
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.')
help_msg_backends="Choose one of the computation backends: {:d}: OpenCV implementation (default); {:d}: CUDA"
help_msg_targets="Chose one of the target computation devices: {:d}: CPU (default); {:d}: CUDA; {:d}: CUDA fp16"
try:
backends+=[cv.dnn.DNN_BACKEND_TIMVX]
targets+=[cv.dnn.DNN_TARGET_NPU]
help_msg_backends+="; {:d}: TIMVX"
help_msg_targets+="; {:d}: NPU"
except:
print('This version of OpenCV does not support TIM-VX and NPU. Visit https://gist.github.com/fengyuentau/5a7a5ba36328f2b763aea026c43fa45f for more information.')
parser=argparse.ArgumentParser(description='Deep Residual Learning for Image Recognition (https://arxiv.org/abs/1512.03385, https://github.com/PaddlePaddle/PaddleHub)')
parser.add_argument('--input','-i',type=str,help='Path to the input image.')
parser.add_argument('--model','-m',type=str,default='image_classification_ppresnet50_2022jan.onnx',help='Path to the model.')
help_msg_backends="Choose one of the computation backends: {:d}: OpenCV implementation (default); {:d}: CUDA"
help_msg_targets="Chose one of the target computation devices: {:d}: CPU (default); {:d}: CUDA; {:d}: CUDA fp16"
try:
backends+=[cv.dnn.DNN_BACKEND_TIMVX]
targets+=[cv.dnn.DNN_TARGET_NPU]
help_msg_backends+="; {:d}: TIMVX"
help_msg_targets+="; {:d}: NPU"
except:
print('This version of OpenCV does not support TIM-VX and NPU. Visit https://gist.github.com/fengyuentau/5a7a5ba36328f2b763aea026c43fa45f for more information.')
parser=argparse.ArgumentParser(
description="ReID baseline models from Tencent Youtu Lab")
help_msg_backends="Choose one of the computation backends: {:d}: OpenCV implementation (default); {:d}: CUDA"
help_msg_targets="Chose one of the target computation devices: {:d}: CPU (default); {:d}: CUDA; {:d}: CUDA fp16"
try:
backends+=[cv.dnn.DNN_BACKEND_TIMVX]
targets+=[cv.dnn.DNN_TARGET_NPU]
help_msg_backends+="; {:d}: TIMVX"
help_msg_targets+="; {:d}: NPU"
except:
print('This version of OpenCV does not support TIM-VX and NPU. Visit https://gist.github.com/fengyuentau/5a7a5ba36328f2b763aea026c43fa45f for more information.')
parser=argparse.ArgumentParser(description='Real-time Scene Text Detection with Differentiable Binarization (https://arxiv.org/abs/1911.08947).')
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='text_detection_DB_TD500_resnet18_2021sep.onnx',help='Path to the model.')
help_msg_backends="Choose one of the computation backends: {:d}: OpenCV implementation (default); {:d}: CUDA"
help_msg_targets="Chose one of the target computation devices: {:d}: CPU (default); {:d}: CUDA; {:d}: CUDA fp16"
try:
backends+=[cv.dnn.DNN_BACKEND_TIMVX]
targets+=[cv.dnn.DNN_TARGET_NPU]
help_msg_backends+="; {:d}: TIMVX"
help_msg_targets+="; {:d}: NPU"
except:
print('This version of OpenCV does not support TIM-VX and NPU. Visit https://gist.github.com/fengyuentau/5a7a5ba36328f2b763aea026c43fa45f for more information.')
parser=argparse.ArgumentParser(
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)")
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='text_recognition_CRNN_EN_2021sep.onnx',help='Path to the model.')
parser.add_argument('--charset','-c',type=str,default='charset_36_EN.txt',help='Path to the charset file corresponding to the selected model.')
parser.add_argument('--save','-s',type=str,default=False,help='Set true to save results. This flag is invalid when using camera.')
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.')