Menu

Your Labellers Drew Boxes on Upright Photos and Your Training Script Loaded Them Sideways
📰

Your Labellers Drew Boxes on Upright Photos and Your Training Script Loaded Them Sideways

DEV Community: computervision·Serguey Asael Shinder·12 days ago
#mfzIhado
Long article (313 words) — no AI summary yet.
Reading 0:00
15s threshold

The returns team

wanted a model

to find the damage

in customer photos.

Dents. Cracks. Torn packaging.

Labellers drew boxes

around each fault

in a browser tool.

Eight thousand photos.

The model trained.

On landscape photos

it was good.

On portrait photos

it was close to useless.

It drew confident boxes

on blank stretches of wall.

Here is the mechanism.

A phone camera

often saves the pixels

the way the sensor sits,

sideways,

and adds a tag

in the EXIF data:

rotate this

when you show it.

Browsers obey that tag.

They have by default

since around 2020.

So the labellers

saw every photo upright

and drew their boxes

on the upright picture.

The training script

opened the files

with a library

that ignores the tag.

Pillow's Image.open

does not apply it.

torchvision's decode_image

leaves it off by default.

The model got

the raw sideways pixels,

with boxes

measured on a picture

it never saw.

For every portrait photo,

the box sat

on the wrong part of the image.

The model…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.