GithubHelp home page GithubHelp logo

imatge-upc / retrieval-2017-cam Goto Github PK

View Code? Open in Web Editor NEW
223.0 15.0 60.0 18.73 MB

Class-Weighted Convolutional Features for Image Retrieval (BMVC 2017)

Home Page: http://imatge-upc.github.io/retrieval-2017-cam/

Python 100.00%
image-retrieval class-activation-maps deep-learning convolutional-neural-networks visual-instance-search transfer-learning keras vgg16 cam pytorch

retrieval-2017-cam's People

Contributors

jsalbert avatar xavigiro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

retrieval-2017-cam's Issues

Problem when getting the features

when I run the A_Oxf_Par_Feat_CAMs_Extraction.py script. there was a bug
Input dimension mis-match. (input[0].shape[1] = 3, input[1].shape[1] = 64)
which looks like hapeen in the conv_1 layer. Details are as follows.

image

Thanks a lot!

Question about Weight

Hi, thanks for your effort.
In the paper,

Optionally, an additional convolutional layer can be added before the GAP (CAM layer) to recover the accuracy drop after removing the fully-connected layers.

It means that there is a new conv layer is added, so how do you train the new network?
Do you only train the new conv layer? Which dataset do you use to train the network?ImageNet, or Oxford buildings?

Thanks for your reply.

Question about the VGG model

Hey,
Thanks for your effort. As described it the papaer,

In short, the last fully-connected layers are replaced with a Global Average Pooling (GAP) layer and a linear classifier. Optionally, an additional convolutional layer can be added before the GAP (CAM layer) torecover the accuracy drop after removing the fully-connected layers.

Could you please show the parameters of the additional convolutional layer? Is it 512 feature maps with 1x1 kernel?

Thank you.

pytorch code

hello, thanks for your codes, would you want to share the pytorch code version evaluate codes ?thanks

Question about PyTorch code

Hello, when I run the PyTorch code, the mean AP of the Oxford data set is only 0.142,does anyone know why this happens?I hardly modified any code.

Question about boxes in evaluation

Hi, thanks for your work.

I have a question about the boxes mapping in keras_code/B_Online_Aggregation_Eval.py.

In line 251, we get the groundtruth box with x, y, dx, dy:
x, y, dx, dy = f_list[1], f_list[2], f_list[3], f_list[4]
and make them in multiples of 16 in line 254-255:
f_x, f_y, f_dx, f_dy = int((x - (x % 16)) / 16), int((y - (y % 16)) / 16), \ int((dx - (dx % 16)) / 16), int((dy - (dy % 16)) / 16)
The query image is processed with resizing to either 1024*720 or 720*1024 in line 276:
img_p = preprocess_images(img, size[0], size[1], mean_value)
The processed image is then fed into the network to get features in line 278-279:
features, cams, roi = extract_feat_cam_fast(model, get_output, conv_layer_features, 1, img_p, num_cams, class_list[0, 0:num_cams])
However, after that we get the descriptors by slicing features with f_x, f_y, f_dx, f_dy in line 281-282:
d_wp = weighted_cam_pooling(features[:, :, f_y:f_dy, f_x:f_dx], cams[:, :, f_y:f_dy, f_x:f_dx])

I'm a little confused since we get the features by feeding the resized images, while the box indices for slicing features are not resized accordingly. I'll be really grateful for your reply :)

what is the speed of feature extraction

Hi, I am trying to extract features for 1 million images. However, it is too slow. I have to wait for at least four days even I tried the fast version. What is the speed of yours?

Plus is this warning related to the speed? should I fix it for speeding up?
WARNING (theano.tensor.blas): We did not find a dynamic library in the library_dir of the library we use for blas. If you use ATLAS, make sure to compile it with dynamics library.
Thanks.

Problem of model = vggcam(nb_classes)

Traceback (most recent call last): File "A_Oxf_Par_Feat_CAMs_Extraction.py", line 71, in <module> model = vggcam(nb_classes) File "/home/linjie/src/CAM/keras_code/vgg_cam.py", line 27, in vggcam model.add(Convolution2D(64, 3, 3, activation='relu')) File "/home/linjie/anaconda2/lib/python2.7/site-packages/keras/models.py", line 522, in add output_tensor = layer(self.outputs[0]) File "/home/linjie/anaconda2/lib/python2.7/site-packages/keras/engine/topology.py", line 592, in __call__ self.build(input_shapes[0]) File "/home/linjie/anaconda2/lib/python2.7/site-packages/keras/layers/convolutional.py", line 129, in build raise ValueError('The channel dimension of the inputs ' ValueError: The channel dimension of the inputs should be defined. Found None.

Hi, I met this problem when I ran A_Oxf_Par_Feat_CAMs_Extraction.py . It seems like the parameters of the function vggcam is incomplete. Does anyone know how to solve this problem?
Thank you.

Can not find model cam_utils

when running A_Oxf_Par_Feat_CAMs_Extraction.py, an error occurs: No module named cam_utils
where can I find this module. thanks for helping

About the parameter N_PCA

I do not understand the parameter N_PCA in Section 4.3, such as its use, and why it is introduced. I am looking forward to your reply.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.