dotnet / dotnet/machinelearning

[Object Detection] Bounding box rotated due to image exif data

Open
#6,592 4 comments 0 reactions 0 assignees View on GitHub
area-Vision needs-further-triage untriaged
Dominant language
C#
Stars
9.4k
Forks
2k
Avg merge
2d 20h
Merged PRs (30d)
11

Description

**System Information (please complete the following information):**
- OS & Version: Windows 10
- ML.NET Version: 2.0.0
- .NET Version: 7.0

**Describe the bug**
Some images have exit data that says it's a rotated image. In those cases, the bounding boxes found by the model end up being transposed.

Example: https://jimpl.com/results/X2GX3ZTHTCFKa7ZiVPag4xUP?target=exif

**To Reproduce**
Do object detection on an image that has exif data saying it's rotated.

**Expected behavior**
Bounding boxes to match pixes on images.

**Screenshots, Code, Sample Projects**
Blue bounding boxes are the original values, green is after checking if the image is portrait, and transposing where needed.
![image](https://user-images.githubusercontent.com/23409814/222867778-14bccdf2-58ec-4f66-83d7-57f4792c688e.png)
![20221129_163943](https://user-images.githubusercontent.com/23409814/222868022-a28fc3c8-bed3-45bf-b298-7e503a77db62.jpg)

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.