cvl-robot's diary

研究ノート メモメモ https://github.com/dotchang/

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

(編集中)

3.example_dnn_classification

物体のクラス分類

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 (http://halide-lang.org/), 2: Intel's Deep Learning Inference Engine (https://software.intel.com/openvino-toolkit), 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)
--classes
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.
--height
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)
--mean
Preprocess input image by subtracting mean values. Mean values should be in BGR order and delimited by spaces.
--rgb
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
--width
Preprocess input image by resizing to a specific width.

実行例

GoogLeNet

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

f:id:cvl-robot:20180719214207p:plain

SqueezeNet

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

今日のOffice付きノートPC

他社のPCに比べて、Officeの値段分だけ安い印象。プライムセールで買うと少し安かった。マイクロソフトのハードウェアは素晴らしい、ハードウェアは。