BUG: Unreadable images interrupt the entire AI-tagging process

Aperta Adatta ai principianti
#1,702 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 6 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
opencv, python

Direzione di ricerca

Inizia da backend/app/models/ObjectClassifier.py e backend/app/utils/images.py; segui come get_classes() gestisce un’immagine che OpenCV non riesce a caricare e come il ciclo di etichettatura aggiorna isTagged. Controlla i test esistenti per la classificazione delle immagini e l’elaborazione in batch. Il lavoro è completato quando le immagini non leggibili vengono ignorate senza interrompere il batch, mentre le immagini elaborate correttamente senza rilevamenti vengono contrassegnate come etichettate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Python
Stelle
313
Fork
755
Merge medio
6g 36m
PR unite (30g)
8

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AOSSIE-Org/PictoPy

Tutte le issue di AOSSIE-Org/PictoPy

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.