caffe icon indicating copy to clipboard operation
caffe copied to clipboard

Spatial Transformer Layer

Open sontran opened this issue 11 years ago • 15 comments

This layer seems to help fine grain localization. Link to paper by Max Jaderberg et al http://arxiv.org/abs/1506.02025 Torch implementation is here https://github.com/qassemoquab/stnbhwd Theano/Lasagne implementation/doc is here https://lasagne.readthedocs.org/en/latest/modules/layers/special.html#lasagne.layers.TransformerLayer

sontran avatar Sep 24 '15 20:09 sontran

I am working on a initial version of this with an affine transformation and bilinear sampling kernel. In my initial design, I am making a layer for the grid generator and resampler together, and the localization net can be built separately for flexibility. I will set up a pull request as soon as I port it over to the current master.

xygorn avatar Sep 25 '15 13:09 xygorn

I am also interested in Spatial Transformer Layer (SPL). Does it possible to embed SPL in Alexnet?

kevinlin311tw avatar Sep 26 '15 05:09 kevinlin311tw

Take a look at https://github.com/happynear/caffe-windows/blob/master/src/caffe/layers/transformer_layer.cpp

ducha-aiki avatar Sep 28 '15 15:09 ducha-aiki

@ducha-aiki Thank you so much. I will take a look at his code. Did you try his transformer layer? Because my OS is linux, I cannot simply compile his caffe.

kevinlin311tw avatar Sep 28 '15 17:09 kevinlin311tw

@kevinlin311tw not yet. I suppose, you could just copy-paste transform_layer.cpp/cu, entry from caffe.proto and from header to your build.

ducha-aiki avatar Sep 29 '15 04:09 ducha-aiki

@sergeyk are you guys planning to include spatial transformer network with caffe?

n3011 avatar Nov 23 '15 14:11 n3011

@XiaoxiaoGuo implemented the spatial transformer layer too. https://github.com/XiaoxiaoGuo/caffe-stn/blob/master/include/caffe/custom_layers.hpp https://github.com/XiaoxiaoGuo/caffe-stn/blob/master/src/caffe/layers/spatial_transformer_layer.cpp https://github.com/XiaoxiaoGuo/caffe-stn/blob/master/src/caffe/layers/spatial_transformer_layer.cu https://github.com/XiaoxiaoGuo/caffe-stn/blob/master/src/caffe/test/test_spatial_transformer_layer.cpp

futurely avatar Dec 10 '15 04:12 futurely

With @XiaoxiaoGuo implementation, is it possible to perturb the transformation parameters (\theta) in a random manner during training? Similar to how the dropout layer turns some neurons off randomly.

If this is possible, you can generate spatial perturbations of data during the learning phase. This might be interesting for some people including myself.

siavashk avatar Dec 16 '15 22:12 siavashk

Here is another implementation including complete examples. https://github.com/daerduoCarey/SpatialTransformerLayer

futurely avatar Dec 18 '15 09:12 futurely

Here is a ready-to-compile caffe, including the implementation by @daerduoCarey: https://github.com/matthieudelaro/caffeBVLCplus/tree/stn (stn branch!) I put files where they belong, modified caffe.proto and filler.hpp, update files to the structural changes of Caffe, un-locked CPU implementation of STN, etc.

matthieudelaro avatar Jun 14 '16 06:06 matthieudelaro

@matthieudelaro I want to build the spatial transform layer with py-faster-rcnn. Can you list me the steps. Thanks

rremani avatar Dec 26 '16 06:12 rremani

@matthieudelaro Have you successfully added the SpatialTransformerLayer with py-faster-rcnn?

whuhxb avatar Jun 15 '17 11:06 whuhxb

@matthieudelaro @whuhxb Have you successfully added the SpatialTransformerLayer with py-faster-rcnn?

yanxp avatar Aug 12 '17 07:08 yanxp

Hi: I'm now trying STN with image recognition, but not yet apply it with py-faster-rcnn. How about you?

At 2017-08-12 16:00:22, "yanxp" [email protected] wrote:

@matthieudelaro Have you successfully added the SpatialTransformerLayer with py-faster-rcnn?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

whuhxb avatar Aug 15 '17 03:08 whuhxb

Any resource of spatial transformer network in py faster rcnn is appreciated. Thanks

@yanxp @whuhxb @matthieudelaro

mamunir avatar May 02 '19 08:05 mamunir