tensorflow / tensorflow/datasets

Rescale bounding_box coordinates for object detection datasets for padded batch

Open
#3,900 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.