Understanding score.py

245 views
Skip to first unread message

Ark

unread,
Jun 15, 2016, 4:25:50 AM6/15/16
to Caffe Users
Hello,

I am trying understand the score.function given in fcn.berkeleyvision.org

Looking at the line 20 of score.py,

net.forward() is directly called for various images, but I don't understand where each image is fed into the network.

I was expectiing something like this:

net.blobs['data'].data = img
net.forward()


Best Regards,
Abid K.

Evan Shelhamer

unread,
Jul 25, 2016, 5:55:27 PM7/25/16
to Ark, Caffe Users
The score method expects to be called on a net with a data layer, like this FCN with a python data layer https://github.com/shelhamer/fcn.berkeleyvision.org/blob/master/voc-fcn32s/train.prototxt#L1-L11, which will load the data automatically.

You could modify the method to take a list of inputs and load the data itself in a similar way to the inference script: https://github.com/shelhamer/fcn.berkeleyvision.org/blob/master/infer.py

Evan Shelhamer





--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/e7a37f9f-870d-4b37-9b07-b2c5dc323e1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dimitrios Sakkos

unread,
Nov 25, 2016, 2:41:11 PM11/25/16
to Caffe Users, ab...@auvizsystems.com
Hi there,

So how exactly does it load every single image? I can see it loops over the lines of the txt file from the line:

for idx in dataset:

However, it seems that it always loads the same data (idx is not used in the loop):
        hist += fast_hist(net.blobs[gt].data[0, 0].flatten(),
                                net.blobs[layer].data[0].argmax(0).flatten(),
                                n_cl)

Also, I don't have a clear idea of what "dataset" is. Is it supposed to be the list of the image names of the whole test set? Isn't this specified at the voc_layers python module as a test layer?

Many thanks for your time.
Message has been deleted

Rishabh Shah

unread,
Apr 5, 2017, 8:20:16 AM4/5/17
to Caffe Users, ab...@auvizsystems.com
Hi Dimitrios,

Do you know where this fast_hist function is located. Also, in score.py there is overall accuracy and mean accuracy. Could you explain what each of these terms represent? Or let me know pointers to understand it further. A link to the function code will be helpful too.

Thanks a lot.
Reply all
Reply to author
Forward
0 new messages