MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications
MobileNetV2: Inverted Residuals and Linear Bottlenecks
Models are taken from https://github.com/shicai/MobileNet-Caffe and converted to ONNX format using [caffe2onnx](https://github.com/asiryan/caffe2onnx):
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='Demo for MobileNet V1 & V2.')
parser.add_argument('--input','-i',type=str,help='Path to the input image.')
parser.add_argument('--model','-m',type=str,choices=['v1','v2','v1-q','v2-q'],default='v1',help='Which model to use, either v1 or v2.')