Skip to content

Caffe:ImageNetClassifying

Caffe의 인스턴트(Instant)인식에 대하여 정리한다. 1

C++ example

C++에 적용하는 샘플 예제는 examples/cpp_classification/classification.cpp를 참조하면 된다. 사용방법은 아래와 같다.

$ ./classification
Usage: ./classification deploy.prototxt network.caffemodel mean.binaryproto labels.txt img.jpg

실제로 사용했을 경우 아래와 같이 출력된다.

$ ./classification \
        /home/your/Project/caffe/models/bvlc_reference_caffenet/deploy.prototxt \
        /home/your/Project/caffe/models/bvlc_reference_caffenet/caffenet_train_iter_450000.caffemodel \
        /home/your/Project/caffe/data/ilsvrc12/imagenet_mean.binaryproto \
        /home/your/Project/caffe/data/ilsvrc12/synset_words.txt \
        ~/Downloads/f12.png
---------- Prediction for /home/your/Downloads/f12.png ----------
1.0000 - "n01443537 FIRE"
0.0000 - "n01440764 NOFIRE"
0.0000 - "n02974003 car wheel"
0.0000 - "n07613480 trifle"
0.0000 - "n02364673 guinea pig, Cavia cobaya"

(참고로 labels.txt에 해당하는 synset_words.txt파일을 일부 수정하였다)

See also

Favorite site

References


  1. 또는 분류(Classifying)라고도 한다.