BUG: Unreadable images interrupt the entire AI-tagging process

オープン 初心者向け
#1,702 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 6 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
opencv, python

調査の方向性

backend/app/models/ObjectClassifier.py と backend/app/utils/images.py から始め、OpenCV が読み込めない画像を get_classes() がどのように処理するか、またタグ付けループが isTagged をどのように更新するかを追ってください。画像分類とバッチ処理に関する既存のテストを確認してください。読み取れない画像がバッチを終了させずにスキップされ、検出結果がなくても正常に処理された画像にはタグ付け済みの印が付けば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug possible-duplicate
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

  1. Application retrieves multiple untagged images from the database.
  2. YOLO processes images sequentially.
  3. One image is corrupt or unreadable.
  4. get_classes() returns None.
  5. len(None) raises a TypeError.
  6. The entire tagging batch terminates.
  7. 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分
マージ済み PR(30日)
8

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AOSSIE-Org/PictoPy のほかの issue

AOSSIE-Org/PictoPy の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。