Access to filename of last processed Image file

22 views
Skip to first unread message

JD-WGB

unread,
Jun 30, 2016, 10:24:23 AM6/30/16
to Caffe Users
Hi,
I'm debugging a network using an ImageData layer as input and was wondering how I would go about accessing the filename of the image which it most recently classified. I don't have the shuffle tag set so it should ideally go through the txtfile with filenames and label in order, but I've had some issues with off-by-one errors and would really like to have that reassurance. I've thumbed through the source code for the ImageData layer and forward() method but can't make heads or tails of how to actually get access to the filename. Bellow find the ImageData layer definition and the relevant python code. This is running on a headless system so graphic display of the image is not an alternative.
Thank you in advance,
JD

layer {
   name
: "data"
   type
: "ImageData"
   top
: "data"
   top
: "label"
   image_data_param
{

      source
: "ImageList.txt"
      batch_size
: 8
      new_height
: 60
      new_width
: 60
     
}
      include
{
      phase
:





for x in range(0,224):
        output
= net.forward()

        output_prob
= output['prob'][0]
        bOut
.write(str(x) + "," + str(output_prob.argmax())+"\n")
       
print  str(x) + ",", output_prob.argmax()
        top_inds
= output_prob.argsort()[::-1][:5]
       
print(zip(output_prob[top_inds]))



Reply all
Reply to author
Forward
0 new messages