Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python port of features matlab code #7

Merged
merged 1 commit into from
Feb 25, 2015
Merged

Conversation

subhasis256
Copy link

This adds the ability to run a caffe pretrained model through Python to get the features.

@karpathy
Copy link
Owner

Hi Subhasis, thanks for the pull! Before we merge, could we please double check that the Matlab and Python features are identical, after image resizing? I.e. Take the Matlab image (after resizing), and run exactly that volume through ConvNet on both sides.

The problem could be that the channels / xy flips etc are somehow not correctly configured, and could be giving wrong results at the end.

EDIT: we want to do after resizing because somehow the Matlab/Python 'BICUBIC' doesn't give identical results. It's possible this is influencing final features.

EDIT2: Saw your Piazza post, which sounds like exactly what I suggested here. Thanks!

karpathy added a commit that referenced this pull request Feb 25, 2015
python port of features matlab code
@karpathy karpathy merged commit 8815b6e into karpathy:master Feb 25, 2015
@karpathy
Copy link
Owner

Wait, should this also contain the def file? It's alluded to in readme but doesn't appear in the commit

@subhasis256
Copy link
Author

The def file should be the prototxt file that you download from the VGG model website or some other network. Maybe I should call it the caffe prototxt file?

Ahh sorry... now I see that you already have the prototxt files in the matlab directory. I will add them.

@karpathy
Copy link
Owner

I was alluding to this line:

"Note that I provide my _features deploy network def as well, which is exactly what you see on that page but I chopped off the softmax to get the 4096-D codes below."

in your readme. It makes it sound like you are attaching the deploy net to the commit?

@karpathy
Copy link
Owner

RE: what's inside matlab directory you have to be careful! Caffe has changed many proto fields, it might give errors if you try to use this. Or it gets automatically converted? I haven't tried any of this yet.

@subhasis256
Copy link
Author

Got it. I actually used this version of the file myself with caffe which
was cloned on Jan 17 and it works.

On Tue, Feb 24, 2015 at 5:07 PM, Andrej notifications@github.com wrote:

RE: what's inside matlab directory you have to be careful! Caffe has
changed many proto fields, it might give errors if you try to use this. Or
it gets automatically converted? I haven't tried any of this yet.


Reply to this email directly or view it on GitHub
#7 (comment).

Subhasis

@subhasis256
Copy link
Author

Added new pull request with the prototxt file.

On Tue, Feb 24, 2015 at 5:09 PM, Subhasis Das subhasis256@gmail.com wrote:

Got it. I actually used this version of the file myself with caffe which
was cloned on Jan 17 and it works.

On Tue, Feb 24, 2015 at 5:07 PM, Andrej notifications@github.com wrote:

RE: what's inside matlab directory you have to be careful! Caffe has
changed many proto fields, it might give errors if you try to use this. Or
it gets automatically converted? I haven't tried any of this yet.


Reply to this email directly or view it on GitHub
#7 (comment).

Subhasis

Subhasis

@npow
Copy link

npow commented May 16, 2015

Hi, I'm wondering why the features are extracted from net.outputs[0], which is the prob layer? Shouldn't the features be from the fc7 layer?

@karpathy
Copy link
Owner

@npow the deploy prototxt that's used during feature extraction has the top layer (probability layer) cut off. Maybe in more recent caffe versions there is no need to use separate deploy files and you can specify the layer directly. I haven't been keeping up with this too closely.

huyouare pushed a commit to huyouare/neuraltalk that referenced this pull request Nov 14, 2015
python port of features matlab code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants