Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV cv2.dnn.readNetFromCaffe : get output from specific layer only ?

Hi,

If I want to get the output of specific layer ('fc7' for example) of a caffe model , what should I do?

I have implemented this in caffe as: net.blobs["data"].data[...] = transformer.preprocess("data", image_block_rgb_227) out = net.forward() fVector = net.blobs['fc7'].data[0].copy() where 'fVector' is the desire output.

but how to implement the same in case of OpenCV ? Please help ?

OpenCV cv2.dnn.readNetFromCaffe : get output from specific layer only ?

Hi,

If I want to get the output of specific layer ('fc7' for example) of a caffe model , what should I do?

I have implemented this in caffe (Python) as: net.blobs["data"].data[...] = transformer.preprocess("data", image_block_rgb_227) out = net.forward() fVector = net.blobs['fc7'].data[0].copy() where 'fVector' is the desire output.

but how to implement the same in case of OpenCV ? Please help ?

click to hide/show revision 3
retagged

updated 2018-07-11 11:17:44 -0500

berak gravatar image

OpenCV cv2.dnn.readNetFromCaffe : get output from specific layer only ?

Hi,

If I want to get the output of specific layer ('fc7' for example) of a caffe model , what should I do?

I have implemented this in caffe (Python) as: net.blobs["data"].data[...] = transformer.preprocess("data", image_block_rgb_227) out = net.forward() fVector = net.blobs['fc7'].data[0].copy() where 'fVector' is the desire output.

but how to implement the same in case of OpenCV ? Please help ?