BUG: Unreadable images interrupt the entire AI-tagging process
维护者通常 6 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- opencv, python
调研方向
从 backend/app/models/ObjectClassifier.py 和 backend/app/utils/images.py 开始;追踪 get_classes() 如何处理 OpenCV 无法加载的图像,以及标记循环如何更新 isTagged。检查现有的图像分类和批处理测试。完成标准是:无法读取的图像会被跳过,且不会导致批次结束;成功处理但没有检测结果的图像会被标记为已标记。
由索引模型根据 Issue 内容生成。
描述
Is there an existing issue for this?
- I have searched the existing issues
What happened?
Description
The AI-tagging process can terminate unexpectedly when PictoPy encounters an image that OpenCV cannot load or decode(corrupt or unsupported image).
In ObjectClassifier.get_classes() (backend/app/models/ObjectClassifier.py), cv2.imread() returns None when an image cannot be loaded. However, image_util_classify_and_face_detect_images() (backend/app/utils/images.py) directly calls len(classes) without checking for None, resulting in a TypeError that interrupts the entire tagging batch.
Expected Behaviour
- Unreadable images should be logged and skipped.
- Their isTagged status should remain False.
- Processing should continue with the remaining images.
- Successfully processed images with no detections should still be marked as tagged.
Actual behaviour
- Application retrieves multiple untagged images from the database.
- YOLO processes images sequentially.
- One image is corrupt or unreadable.
- get_classes() returns None.
- len(None) raises a TypeError.
- The entire tagging batch terminates.
- Remaining images are not processed during that run.
Why Does This Matter?
A single unreadable image can prevent an entire batch of otherwise valid images from receiving AI-generated tags. Handling such failures individually would improve the reliability and stability of PictoPy's AI-tagging pipeline.
Proposed Solution
Handle the None return value before accessing len(classes). Skip the unreadable image and continue processing the remaining images.
Record
- I agree to follow this project's Code of Conduct
- 主要语言
- Python
- 星标
- 313
- 派生
- 755
- 平均合并
- 6 天 36 分钟
- 30 天内合并 PR
- 8
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
AOSSIE-Org/PictoPy 的其他 Issue
-
enhancement possible-duplicate
难度 1/5 1-3 小时 新手友好度 78/100
AOSSIE-Org/PictoPy#1715 · 2 条评论 ·
维护者通常 6 天内回复
-
BUG: /folders/all-folders takes over a second when folders contain both images and videos可能已有人在做 @Saurabhyadav0 于 1 天前认领。 未关闭bug enhancement possible-duplicate
难度 2/5 1-3 小时 新手友好度 75/100
AOSSIE-Org/PictoPy#1708 · 3 条评论 ·
维护者通常 6 天内回复
-
Add unit tests for personUtils.ts可能已有人在做 @mystic-fae 今天认领。 未关闭enhancement
难度 1/5 1-3 小时 新手友好度 62/100
AOSSIE-Org/PictoPy#1707 · 3 条评论 ·
维护者通常 6 天内回复
-
bug possible-duplicate
难度 1/5 1 小时以内 新手友好度 86/100
AOSSIE-Org/PictoPy#1700 · 3 条评论 ·
维护者通常 6 天内回复
-
BUG: Share page returns HTTP 500 when the unlock cookie contains a non-ASCII character可能重新可做 @swastiksharma45 于 7 天前认领,目前没有进行中的 PR。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
AOSSIE-Org/PictoPy#1696 · 6 条评论 ·
维护者通常 6 天内回复
查看 AOSSIE-Org/PictoPy 的全部 Issue
相似的 Issue
-
documentation type/bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"可能已有人在做 @0z5a 今天认领。 未关闭needs-triage
难度 2/5 半天 新手友好度 72/100
维护者通常 2 天内回复
-
trace: Pi's 1-hour cache writes are priced at 1.25x, but billed at 2x可能已有人在做 @Shizoqua 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
microsoft/TokenEconomizer#221 ·
维护者通常 1 天内回复
-
plot_graph crashes when a mesh node has no m2m edge可能已有人在做 @tygvi 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
mllam/neural-lam#883 · 1 条评论 ·
维护者通常 2 天内回复