cvl-robot's diary

研究ノート メモメモ

OpenCV3.4.2で始める浅いディープラーニング (その5 クラス分類)




Use this script to run classification deep learning networks using OpenCV.
Usage: example_dnn_classification.exe [params]

--backend (value:0)
Choose one of computation backends: 0: automatically (by default), 1: Halide language (, 2: Intel's Deep Learning Inference Engine (, 3: OpenCV implementation
-c, --config
Path to a text file of model contains network configuration. It could be a file with extensions .prototxt (Caffe), .pbtxt (TensorFlow), .cfg (Darknet)
Optional path to a text file with names of classes.
-f, --framework
Optional name of an origin framework of the model. Detect it automatically if it does not set.
-h, --help
Print help message.
Preprocess input image by resizing to a specific height.
-i, --input
Path to input image or video file. Skip this argument to capture frames from a camera.
-m, --model
Path to a binary file of model contains trained weights. It could be a file with extensions .caffemodel (Caffe), .pb (TensorFlow), .t7 or .net (Torch), .weights (Darknet)
Preprocess input image by subtracting mean values. Mean values should be in BGR order and delimited by spaces.
Indicate that model works with RGB input images instead BGR ones.
--scale (value:1)
Preprocess input image by multiplying on a scale factor.
--target (value:0)
Choose one of target computation devices: 0: CPU target (by default), 1: OpenCL, 2: OpenCL fp16 (half-float precision), 3: VPU
Preprocess input image by resizing to a specific width.



example_dnn_classification.exe --model=bvlc_googlenet.caffemodel --config=bvlc_googlenet.prototxt --scale=1.0 --width=224 --height=224 --mean=104 117 123 --classes=classification_classes_ILSVRC2012.txt



example_dnn_classification.exe --model=squeezenet_v1.1.caffemodel --config=squeezenet_v1.1.prototxt --scale=1.0 --width=227 --height=227 --mean=0 0 0 --classes=classification_classes_ILSVRC2012.txt