Skip to content

Fix GUI detection colors by rendering the original image - #631

Open
divyanshAgarwal123 wants to merge 3 commits into
JdeRobot:masterfrom
divyanshAgarwal123:fix/524-original-inference-image
Open

divyanshAgarwal123 wants to merge 3 commits into
JdeRobot:masterfrom
divyanshAgarwal123:fix/524-original-inference-image

Conversation

@divyanshAgarwal123

Copy link
Copy Markdown

What changed

The image detection tab was converting the model input tensor back to a display image. When normalization is configured, that tensor no longer contains display-ready RGB values.

This change draws the predictions on the original uploaded RGB image instead. The prediction path already maps bounding boxes back to the original image coordinates. A regression test verifies that the original image is passed to the drawing function and that the normalized sample is not requested.

Reproduction

With a small RGB sample, the current conversion changed pixel (128, 64, 32) to (18, 23, 195).

Checks

  • Black formatting check
  • pytest: 47 passed

Fixes #524

Signed-off-by: Divyansh agarwal <85987665+divyanshAgarwal123@users.noreply.github.com>
@divyanshAgarwal123
divyanshAgarwal123 marked this pull request as ready for review September 14, 2026 20:47
@divyanshAgarwal123

Copy link
Copy Markdown
Author

Hi @dpascualhe — I reproduced #524 on the current master branch and implemented the fix by drawing detections on the original uploaded RGB image, while keeping the existing mapping of predicted boxes to original-image coordinates. I also added a focused regression test, and all 47 local tests pass. The PR is ready for review when you have time. Thanks!

@divyanshAgarwal123

Copy link
Copy Markdown
Author

Hi @dpascualhe, just following up on #631. It is still open and mergeable, and the focused regression test plus the full local suite (47 tests) pass. Please let me know if you’d like any changes or additional coverage. Thanks!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Inference tab renders normalized tensors without inverse normalization.

1 participant