facebookresearch / facebookresearch/detectron2
The "height" and "width" variables provided in the dataset_mapper function are not used during clipping of the proposal boxes.
- Dominant language
- Python
- Stars
- 34.7k
- Forks
- 7.9k
- PR merge metrics
- No merged PRs in 30d
Description
## Issue (I already know the root cause and mention it here):
The "Input Format" section given [here ](https://detectron2.readthedocs.io/en/latest/tutorials/models.html) says that the "height" and "width" variables are used to specify the desired output shape in case it's desired to be different from the input image shape.
Example:
If my input image is of dimensions (100x100) and my desired output shape is (300x300), then obviously I will define my groundtruth box coordinates based on the (300,300) output shape.
However, despite specifying these "height" and "width" variables, they are never used while generating bounding box proposals. In the "predict_proposals" function in rpn.py, only "images.image_sizes" is given as an argument which is used to clip the bounding box proposals. This means that the proposed bounding boxes are clipped to remain within the (100,100) range whereas my groundtruth boxes were defined on the (300x300) grid (desired output shape).
I believe this is a genuine bug and the documentation on the given link is also wrong. I spent the entire week trying to debug what was wrong because according to your documentation, I was doing the right thing by specifying the desired output grid shape using the "height" and "width" variables in the dataset_mapper function.
## Instructions To Reproduce the 🐛 Bug:
The code doesn't generate any errors and there aren't any significant changes to the code that need to be made.
Just the scenario where your desired output shape is different from the input shape has this problem.
Contributor guide
Assessment
This issue has not been assessed yet.