Comments (7)
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.
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.
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.
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.
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.pyx = 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.
Line 121 in 35716d5
Line 121 should also be changed. Remove the ".t()".
from racnn-pytorch.
@libing125 Hi, did you reproduce the result of the paper by this code?
from racnn-pytorch.
Related Issues (20)
- hi,i don't know what happened .RuntimeError: "exp" not implemented for 'torch.LongTensor' HOT 13
- TypeError: expected Tensor as element 0 in argument 0, but got list HOT 10
- save model and predict HOT 5
- Question of formula 8 HOT 5
- some question for loss HOT 2
- about apn HOT 1
- about saving the tx ty tl HOT 1
- Hello author, I would like to ask the two documents in the picture you have given in the project? I can't find these two files in the downloaded resource. HOT 2
- RuntimeError: _th_exp_out not supported on CUDAType for Long HOT 2
- RuntimeError: It is expected output_size equals to 1, but got size 2 HOT 3
- is there some bug HOT 2
- TypeError: 'module' object is not callable HOT 1
- some mistake in the code HOT 1
- Some mistake in APN HOT 5
- Use of Average Pool to Conv5_4 layers before APN? HOT 3
- RuntimeError: CUDA out of memory. HOT 2
- Problem of backward of APN HOT 1
- some question:'RACNN' object has no attribute 'module' HOT 1
- about data and what those .txt file contain HOT 3
- error find in line 75, RACNN.py when run train.py HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from racnn-pytorch.