The module computes a vectorial representation of the input image using Caffe C++ library.
The module computes a vectorial representation of the input image using Caffe C++ library.
Version:1.0
- Author
- Giulia Pasqu.nosp@m.aleg.nosp@m.iulia.nosp@m..pas.nosp@m.quale.nosp@m.@iit.nosp@m..it
- Copyright
- Released under the terms of the GNU GPL v2.0
Description
Introduction
The input image is passed through a feed-forward Convolutional Neural Network (CNN) model that has been previously learned. The image representation can be extracted as the output of any layer in the network. Usually the latest convolutional layer is chosen and the output is a 1-dimensional vector, than is then fed to a classifier (e.g., linear SVM/RLS).
Parameters
- – name : name of the module
- – from : configuration file name
- – context : select the current context
- – caffemodel_file : Absolute path to the .caffemodel file containing the weights of the network used.
- – prototxt_file : Absolute path to the .prototxt file containing the definition of the network (or part of the network) used.
- – blob_name : Tag (defined in the .prototxt) of the layer at which we want to extract the features.
- – compute_mode : [GPU|gpu|CPU|cpu] passed to Caffe initialization.
- – device_id : GPU device chosen by Caffe to run the computations (used if compute_mode is set to GPU|gpu).
- – timing : Pass this parameter if you want to measure the time for feature extraction. This is an integer specifying the number of iterations of the moving window to average the time measurements.
- – resizeWidth : Integer specifying the width to which resize (anysotropically) the image before feeding it to the network. This is used if the mean pixel is subtracted from the input image and must be coupled with
resizeHeight
.
- – resizeHeight : Integer specifying the height to which resize (anysotropically) the image before feeding it to the network. This is used if the mean pixel is subtracted from the input image and must be coupled with
resizeWidth
.
- – dump_code : Path where to save the features extracted from each image in a binary format.
Input Ports
- /caffeCoder/rpc [rpc] [default carrier:]: Receiveds the following commands and provides replies: (notation: [.] identifies a vocab, "." specifies a string)
- help [help]: print the available commands
- start saving features [dump] "path-to-file" "a": starts to save features in a binary file. "a" (optional) stands for "append". "path-to-file" (optional) is set to: contextPath + "/codes.bin" if not provided
- stop saving features [stop]: stop saving features
- /caffeCoder/img:i [Image] [default carrier:]: Feed images to caffeCoder using this port.
Output Ports
- /caffeCoder/img:o [Image] [default carrier:]: Output image (equal to the input).
- /caffeCoder/code:o [Vector] [default carrier:]: Output vectorial representation of the image.
Services