BUG: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)
Los mantenedores suelen responder en 4 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- machine-learning, search
Línea de trabajo
Empieza por backend/app/utils/SigLIP.py e inspecciona siglip_util_preprocess_image(); el issue señala la ruta de apertura y redimensionamiento de imágenes. Añade una prueba unitaria con un JPEG con EXIF Orientation=6, como sugiere el issue. Se considera terminado cuando la salida del preprocesamiento está derecha y la prueba verifica el manejo de la orientación.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is there an existing issue for this?
- I have searched the existing issues
What happened?
While going through the semantic search code I noticed that siglip_util_preprocess_image() in backend/app/utils/SigLIP.py doesn't handle EXIF orientation.
Phones usually store portrait photos as landscape pixels + an EXIF Orientation tag (like 6 = rotate 90° clockwise). Viewers read that tag and show the photo upright. But here the image is just opened and resized:
img = (
Image.open(img_path)
.convert("RGB")
.resize((resolution, resolution), Image.BICUBIC)
)
so SigLIP ends up getting portrait phone photos turned sideways. That would hurt semantic search and semantic labels for basically any portrait photo taken on a phone.
The face/object side is fine btw, cv2.imread already applies EXIF orientation. So right now the same photo is upright for YOLO/FaceNet but sideways for SigLIP.
How I checked
I ran the actual siglip_util_preprocess_image() on a real phone photo with Orientation = 6 and turned the output tensor back into an image:
| What you see | What SigLIP gets |
|---|---|
| (drag 1_what_you_see.png here) | (drag 2_what_siglip_sees.png here) |
Also tried a small test image saved with Orientation=6 (red left half, blue right half). It displays with red on top, but SigLIP gets red on the left:
Displayed size (w,h): (200, 400)
SigLIP input: red in top half=0.50, red in left half=1.00
Upright photo: red in top half=1.00, red in left half=0.50
Checked on dev at 3c6b10f.
Not a duplicate of
- #1570 / #1596 - same cause, but only fixes thumbnails
- #1727 - only the OpenCV loaders for faces/objects
Neither touches SigLIP.py.
Possible fix
Add ImageOps.exif_transpose() right after Image.open() and a unit test with an Orientation=6 JPEG. It's a small change.
One thing I wasn't sure about: photos that are already embedded will keep the old sideways embeddings. Should they get re-embedded as part of this, or is that better as a separate issue?
I'd like to work on this if that's okay.
Record
- I agree to follow this project's Code of Conduct
- Lenguaje dominante
- Python
- Estrellas
- 322
- Forks
- 793
- Merge medio
- 6 d 9 h
- PR fusionados (30 d)
- 20
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de AOSSIE-Org/PictoPy
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't workPosiblemente ocupada @swastiksharma45 la tomó hace 2 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
AOSSIE-Org/PictoPy#1779 · 2 comentarios ·
Los mantenedores suelen responder en 4 días
-
BUG: PROD: Face search shows "No Matches Found" for every empty result, even when AI tagging is offPosiblemente ocupada @dhruvbit la tomó hace 3 días. Abiertobug enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
AOSSIE-Org/PictoPy#1770 · 3 comentarios ·
Los mantenedores suelen responder en 4 días
-
BUG: Add images to album: success message shows requested count, not number actually addedPosiblemente ocupada @riyanshbhosale la tomó hace 5 días. Abiertobug enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
AOSSIE-Org/PictoPy#1740 · 4 comentarios ·
Los mantenedores suelen responder en 4 días
-
BUG: /sync-folder does not validate the supplied folder_idQuizá libre de nuevo @sathvikn113 la tomó hace 10 días y no hay ningún pull request abierto. Abiertobug possible-duplicate
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
AOSSIE-Org/PictoPy#1731 · 5 comentarios ·
Los mantenedores suelen responder en 4 días
-
DOC: update deprecated libgl1-mesa-glx package and stale setup.md referencesQuizá libre de nuevo @avika269 la tomó hace 10 días y no hay ningún pull request abierto. Abiertodocumentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 65/100
AOSSIE-Org/PictoPy#1730 · 5 comentarios ·
Los mantenedores suelen responder en 4 días
Todos los issues de AOSSIE-Org/PictoPy
Issues similares
-
S2-12 Atualizar README.mdAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
bug help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
cofade/open-garden-planner#1044 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
python-commandline-toolsAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
codecrafters-io/build-your-own-x#2126 ·
Los mantenedores suelen responder en 5 días
-
documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
julianleno/cortai#10 ·
-
difficulty:easy func:python os:windows prio:high type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NatronGitHub/Natron#2029 ·
Los mantenedores suelen responder en 1 día