import matplotlib.pyplot as plt
from caffe.proto import caffe_pb2
net=caffe.Net('pyblobs-Test-Eval.prototxt', 'best_snapshot_iter_4553.caffemodel', caffe.TEST)
transformer = caffe.io.Transformer({'data': net.blobs['data'].data.shape})
transformer.set_transpose('data', (2,0,1))
transformer.set_mean('data', np.load('trainingMean.npy'))
transformer.set_raw_scale('data', 255)
transformer.set_channel_swap('data', (2,1,0))
net.blobs['data'].reshape(1,3,96,96)
net.blobs['data'].data[...] = transformer.preprocess('data', caffe.io.load_image('Test/A_4654.png'))
out=net.forward()
What this does is print out the output from layer 'fc8' for image A_4654.png.
I want to have a script that will take an array of images, process them as one batch (which I'm pretty sure caffe can do...), and return a list full of 'fc8' values corresponding the the image at the given index. How do I pre-process and make a blob with multiple images, and have the net.forward() command return a list of corresponding values? I've been having trouble finding info about batch processing images in pyCaffe without the use of a database.