🐛 Bug Report: focal point is wrong for GIFs whose first frame does not start at (0, 0)
Đánh giá
Issue này chưa được đánh giá.
Mô tả
👟 Reproduction steps
A GIF has a logical screen size, and each frame has its own position inside it. When the first frame covers only part of the screen (for example an 800×450 frame at x=800 on a 1600×450 screen), /analyze returns gravity measured against the frame instead of the whole image.
imageutil.Decode checks the logical screen size with image.DecodeConfig. It then returns the frame that image/gif decodes, and that frame keeps the frame's own bounds ((800,0)-(1600,450) here). Everything after that (face detection, saliency, FocalNet crops) normalizes against the frame's width and height. The result is then read as a point on the full image.
- Build a GIF with a 1600×450 logical screen and one frame,
internal/testimages/testdata/generated-face-left.jpg(800×450), placed at left=800, top=0. Any encoder that writes a frame offset works, for example Go'sgif.EncodeAllwithConfig{Width: 1600, Height: 450}and a frame whose bounds areimage.Rect(800, 0, 1600, 450). curl -s -H 'Content-Type: image/gif' --data-binary @face-left-offset.gif http://127.0.0.1:8080/analyze
👍 Expected behavior
The face is at x ≈ 0.26 within the 800 px frame. On the 1600 px image that is x ≈ (800 + 0.26 × 800) / 1600 ≈ 0.63.
👎 Actual Behavior
{"gravity":{"x":0.26323946937918663,"y":0.23157380289501617},"confidence":0.9248611985862869,"source":"face"}
x = 0.26 is in the empty left half of the image. FocalNet crop pixel coordinates have the same problem, because they are computed from img.Bounds().Dx()/Dy() of the frame.
🎲 Appwrite version
autogravity main @ 35b155f
💻 Operating system
macOS (arm64)
🧱 Your Environment
Built from source with Go 1.26.1 and ONNX Runtime 1.30.0, using the default U²-Net + YuNet backend with the checked-in INT8 models.
👀 Have you spent some time to check if this issue has been raised before?
- I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct
I have a fix with a regression test ready. Could this be assigned to me so I can open a PR?
- Ngôn ngữ chính
- Go
- Star
- 4
- Fork
- 5
- Merge trung bình
- 8 giờ 54 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của appwrite/autogravity
-
Dependency DashboardĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 8/100
appwrite/autogravity#24 ·
Tất cả issue của appwrite/autogravity
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
OneBusAway/maglev#2145 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
priority/medium status/ready type/chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
discobox-ai/discobox#1357 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
TestPseudoLocaleRemote fails now and then: it types the code before the laptop asks for itCó thể đã có người làm @fzn0x đã nhận hôm nay. Đang mởbug priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement ui/ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
jbigler/railswitch#243 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
go-vulnerability security-scan
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
teslashibe/agent-go#35 ·