GithubHelp home page GithubHelp logo

Comments (7)

FanvelChen avatar FanvelChen commented on September 4, 2024 2

I can got the motivation of your manual change, but what I mean is the direction of comparison maybe is incorrect.
tx = tx if tx > (in_size/3) else in_size/3
tx = tx if (in_size/3*2) < tx else (in_size/3*2)
ty = ty if ty > (in_size/3) else in_size/3
ty = ty if (in_size/3*2) < ty else (in_size/3*2)
in my understanding it should be
tx = tx if tx > (in_size/3) else in_size/3
tx = tx if (in_size/3*2) > tx else (in_size/3*2)
ty = ty if ty > (in_size/3) else in_size/3
ty = ty if (in_size/3*2) > ty else (in_size/3*2)

Another part is in line 101 in ./models/RACNN.py
xatt_cropped = xatt[:, h_off : h_end, w_off : w_end]
should be
xatt_cropped = xatt[:, w_off : w_end, h_off : h_end]
because your x is vertically increasing, and your y is horizontally increasing. According to the corresponding index relation, I think the slice should be changed like this.

from racnn-pytorch.

zjuPeco avatar zjuPeco commented on September 4, 2024 2

I can got the motivation of your manual change, but what I mean is the direction of comparison maybe is incorrect.
tx = tx if tx > (in_size/3) else in_size/3
tx = tx if (in_size/3*2) < tx else (in_size/3*2)
ty = ty if ty > (in_size/3) else in_size/3
ty = ty if (in_size/3*2) < ty else (in_size/3*2)
in my understanding it should be
tx = tx if tx > (in_size/3) else in_size/3
tx = tx if (in_size/3*2) > tx else (in_size/3*2)
ty = ty if ty > (in_size/3) else in_size/3
ty = ty if (in_size/3*2) > ty else (in_size/3*2)

Another part is in line 101 in ./models/RACNN.py
xatt_cropped = xatt[:, h_off : h_end, w_off : w_end]
should be
xatt_cropped = xatt[:, w_off : w_end, h_off : h_end]
because your x is vertically increasing, and your y is horizontally increasing. According to the corresponding index relation, I think the slice should be changed like this.

the index order is (C, H, W).
change line 78-79 in ./models/RACNN.py

x = torch.stack([unit.t()] * 3)
y = torch.stack([unit] * 3)

to

x = torch.stack([unit] * 3) 
y = torch.stack([unit.t()] * 3)

works for me.
because
mk = (h(x-w_off) - h(x-w_end)) * (h(y-h_off) - h(y-h_end))

from racnn-pytorch.

jeong-tae avatar jeong-tae commented on September 4, 2024

i found that if cropped image size is too small performance is dropped. so i manually change the cropping rule bcuz i do not have pretrain APN.

For optimization, see “The unreasonable effec- tiveness of noisy data for fine-grained recognition” this paper. i also dont know about detail well. In the RACNN paper, their intention is to keep a consistent direction of optimization.

from racnn-pytorch.

jeong-tae avatar jeong-tae commented on September 4, 2024

oh i see. i misunderstand your first question. i will check inquality direction.

second one is, as far as i know, the index order maybe startwith height and then width so that slice was set as 101 line. i will check again

from racnn-pytorch.

libing125 avatar libing125 commented on September 4, 2024

I can got the motivation of your manual change, but what I mean is the direction of comparison maybe is incorrect.
tx = tx if tx > (in_size/3) else in_size/3
tx = tx if (in_size/3*2) < tx else (in_size/3*2)
ty = ty if ty > (in_size/3) else in_size/3
ty = ty if (in_size/3*2) < ty else (in_size/3*2)
in my understanding it should be
tx = tx if tx > (in_size/3) else in_size/3
tx = tx if (in_size/3*2) > tx else (in_size/3*2)
ty = ty if ty > (in_size/3) else in_size/3
ty = ty if (in_size/3*2) > ty else (in_size/3*2)
Another part is in line 101 in ./models/RACNN.py
xatt_cropped = xatt[:, h_off : h_end, w_off : w_end]
should be
xatt_cropped = xatt[:, w_off : w_end, h_off : h_end]
because your x is vertically increasing, and your y is horizontally increasing. According to the corresponding index relation, I think the slice should be changed like this.

the index order is (C, H, W).
change line 78-79 in ./models/RACNN.py

x = torch.stack([unit.t()] * 3)
y = torch.stack([unit] * 3)

to

x = torch.stack([unit] * 3) 
y = torch.stack([unit.t()] * 3)

works for me.
because
mk = (h(x-w_off) - h(x-w_end)) * (h(y-h_off) - h(y-h_end))

I think you are right. How is your result? Can you reproduce the result of the paper?

from racnn-pytorch.

libing125 avatar libing125 commented on September 4, 2024

x = torch.stack([torch.arange(0, in_size)] * in_size).t()

Line 121 should also be changed. Remove the ".t()".

from racnn-pytorch.

YananGu avatar YananGu commented on September 4, 2024

@libing125 Hi, did you reproduce the result of the paper by this code?

from racnn-pytorch.

Related Issues (20)

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.