Comments (8)
Hi @bentennyson9x, z_where
here refers to the bounding box. Its shape is (B, G*G, 4)
, where G*G
is the number of cells (e.g., 4*4
). z_where[:, :, :2]
gives the size of the object (normalized to (0, 1)
) and z_where[:, :, 2:]
gives location (normalized to (-1, 1)
). Since many of the cells won't contain valid objects, you also need z_pres
here to determine which cells contain objects.
To convert z_where
and z_pres
(you should binarize z_pres
before sending it in) into list of bounding boxes like [[(y_min, y_max, x_min, x_max)]]
in pixel values, you can use the convert_to_bbox
function here.
from space.
Thanks for your help! I got it
from space.
I got an error "IndexError: The shape of the mask [256, 1] at index 1 does not match the shape of the indexed tensor [256, 4] at index 1" when I passed convert_to_boxes(log.z_where,log.z_pres, log.z_pres_prob) to the "convert_to_boxes" function. I checked again and realized that log.z_pres always has a shape (256,1) (because sigmoid) while log.z_where shape is ([256, 4] with [sx, sy, tx, ty]. Am I missing something?
from space.
Ah sorry I forgot to mention this thing: you should squeeze z_pres
and z_pres_prob
from (B, N, 1)
to (B, N)
(i.e. z_pres.squeeze(2)
) before sending them to convert_to_boxes
as shown here
Lines 39 to 40 in e1eaf4a
from space.
I got bad values of the bounding box. I think it is due to the binarizing z_pres in 0 and 1 value. I don't know the threshold to do it. Can you help me. z_pres values are in this picture when I print it out
from space.
A simple z_pres = z_pres > 0.5
should do. How did you binarize it? The result is supposed to be ByteTensor
but what you show me seems to be FloatTensor
.
from space.
Oh, I did it! Thank you very much. You save my day!
from space.
You're welcome :)
from space.
Related Issues (6)
- Magic number in this line? HOT 2
- Find configs for mspacman HOT 1
- AssertionError: Metric file does not exist HOT 2
- negative loss HOT 2
- Object Extraction 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 space.