BUG: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)
メンテナーはふだん 4 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
backend/app/utils/SigLIP.pyから始めて、siglip_util_preprocess_image()を調べてください。issueでは画像を開いてリサイズする経路が示されています。issueの提案どおり、EXIF Orientation=6のJPEGを使ったユニットテストを追加してください。前処理の出力が正しい向きになり、テストで向きの処理が検証されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 322
- フォーク
- 793
- 平均マージ
- 6日 9時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AOSSIE-Org/PictoPy のほかの issue
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't work対応中かも @swastiksharma45 が 2 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
AOSSIE-Org/PictoPy#1779 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: PROD: Face search shows "No Matches Found" for every empty result, even when AI tagging is off対応中かも @dhruvbit が 3 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AOSSIE-Org/PictoPy#1770 · コメント 3 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: Add images to album: success message shows requested count, not number actually added対応中かも @riyanshbhosale が 5 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
AOSSIE-Org/PictoPy#1740 · コメント 4 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: /sync-folder does not validate the supplied folder_id再び着手できるかも @sathvikn113 が 10 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
AOSSIE-Org/PictoPy#1731 · コメント 5 件 ·
メンテナーはふだん 4 日以内に返信
-
DOC: update deprecated libgl1-mesa-glx package and stale setup.md references再び着手できるかも @avika269 が 10 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンdocumentation
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
AOSSIE-Org/PictoPy#1730 · コメント 5 件 ·
メンテナーはふだん 4 日以内に返信
AOSSIE-Org/PictoPy の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
cofade/open-garden-planner#1044 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
codecrafters-io/build-your-own-x#2126 ·
メンテナーはふだん 5 日以内に返信
-
documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
julianleno/cortai#10 ·
-
difficulty:easy func:python os:windows prio:high type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NatronGitHub/Natron#2029 ·
メンテナーはふだん 1 日以内に返信