tensorflow / tensorflow/datasets
Rescale bounding_box coordinates for object detection datasets for padded batch
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 1.6k
- Avg merge
- 3h 54m
- Merged PRs (30d)
- 1
Description
In conjunction with issue #3897 , I see it as a bug that we are not rescaling the bbox coordinates with respect to padded batch images.
Possible solution
in case of batch_size=1 return unpadded image and bbox
for batch_size > 1 rescale bbox coordinates to new_padded_image_size/old_image size
Other alternatives
Rightnow the workaround is using map and lambda functions as shown in the above link i.e save old image shape in the dict and use it to rescale or create a entirely new map function which resizes each image not pad and rescales bbox accordingly
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading issue #3897 and the current batching and padding path for object-detection datasets. Compare batch_size=1 with padded batches and check how image shapes and bounding-box coordinates are represented. Done means batch_size=1 preserves unpadded images and boxes, while larger batches rescale coordinates to the padded image size.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, tensorflow
- Domain
- data, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100