Giter Site home page Giter Site logo

luyao777 / hbp-pytorch Goto Github PK

View Code? Open in Web Editor NEW
100.0 2.0 18.0 40 KB

Hierarchical Bilinear Pooling for Fine-Grained Visual Recognition reimplement in Pytorch.

License: GNU General Public License v3.0

Python 100.00%
hbp fine-grained bilinear pytorch

hbp-pytorch's Introduction

Code is cheap, Show me the ๐ŸŒ. XD

๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ๐ŸŒ

๐ŸŽ: Who Am I

  • Name: Yao Lu
  • Email: [email protected]
  • Location: Shanghai in China
  • Educational Experience๏ผš
    • Undergraduate(2014.09-2018.06): Computer Science and Technology, University of Electronic Science and Technology of China
    • Postgraduate(2018.9-2021.06): Computer Application Technology, Renmin University of China
  • Employment Experience:
    1. Tencent Holdings Limited
    2. Pinduoduo Inc.

๐Ÿ Commit Snake

github contribution grid snake animation

โฐ Coding Time

From: 14 September 2021 - To: 03 May 2024

Total Time: 1,236 hrs 23 mins

Python              755 hrs 42 mins โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   61.12 %
JSON                142 hrs 23 mins โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   11.52 %
SQL                 117 hrs 5 mins  โ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   09.47 %
Other               68 hrs 33 mins  โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   05.55 %
Text                63 hrs 11 mins  โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   05.11 %

๐Ÿงฎ Github Stats

๐Ÿ“‘ Recent Blog

โ›ฐ๏ธ Streak Stats

hbp-pytorch's People

Contributors

luyao777 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

hbp-pytorch's Issues

X = proj_1 * proj_2 it may be wrong

def hbp(self,conv1,conv2):
N = conv1.size()[0]
proj_1 = self.bilinear_proj(conv1)
proj_2 = self.bilinear_proj(conv2)
assert(proj_1.size() == (N,8192,28,28))
X = proj_1 * proj_2
assert(X.size() == (N,8192,28,28))
X = torch.sum(X.view(X.size()[0],X.size()[1],-1),dim = 2)
X = X.view(N, 8192)
X = torch.sqrt(X + 1e-5)
X = torch.nn.functional.normalize(X)
return X

in HBP , this line :X = proj_1 * proj_2. should be. self.bap = BAP(pool='GAP')?
because this is just dot, it should be binear pooling ๏ผŒYou also have to multiply between the channelsใ€‚
I think that's the right way to think about it๏ผŒThank you for the code ๐Ÿ‘

A question about the architecture

whether need to add another linear transformation after the concatenate the bilinear feature?Because the formulation in the paper is z=P^T concat(U^T x * V^T y, ...)

HBPๅฎšไน‰ไธญ็š„ไปฃ็ ๆˆ‘ๆœ‰็‚นไธ็†่งฃ

    proj_1 = self.bilinear_proj(conv1)
    proj_2 = self.bilinear_proj(conv2)
    assert(proj_1.size() == (N,8192,28,28))
    X = proj_1 * proj_2
    assert(X.size() == (N,8192,28,28)) 

่ฟ™้‡Œไธๅบ”่ฏฅๆ˜ฏไธคไธชๅท็งฏๅฑ‚ๅค–็งฏๆ“ไฝœๅ—๏ผŸๅ‡บๆฅไธๅบ”่ฏฅๆ˜ฏ[N,8192,8192]ๅ—๏ผŸไธบไป€ไนˆๆ˜ฏ(N,8192,784))

resnet50

how can I change pre-train model with resnet50

The matrix U and V in implementation

Thanks for implementing the paper! I am confused with the matrix U and V. These two matrices in the paper seem to be two different matrices. But in the implementation, they are initilialized as the same matrix as:
self.bilinear_proj = torch.nn.Sequential(torch.nn.Conv2d(512,8192,kernel_size=1,bias=False),
torch.nn.BatchNorm2d(8192),
torch.nn.ReLU(inplace=True))

proj_1 = self.bilinear_proj(conv1)
proj_2 = self.bilinear_proj(conv2)

NameError: name 'options' is not defined


main()

File "HBP_fc.py", line 270, in main
manager = HBPManager(options, path)
File "HBP_fc.py", line 94, in init
self._options = options
NameError: name 'options' is not defined

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.