BUG: YOLO incorrectly labels Toothbrush (Class ID 79) detections as Unknown

Aperta Adatta ai principianti
#1,700 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 6 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
86/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

L’issue indica backend/app/utils/YOLO.py e YOLO_util_draw_detections(). Leggi questa funzione ed esegui il test unitario fallito descritto nell’issue con l’ID di classe 79 e una confidenza di 0.90. Il lavoro è terminato quando la visualizzazione etichetta questo rilevamento toothbrush 90% invece di unknown 90%.

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?
Bug Description

The YOLO detection visualization incorrectly labels the last COCO class,
"toothbrush" (class ID 79), as "unknown".

The issue is in backend/app/utils/YOLO.py, inside the
YOLO_util_draw_detections() function.

Root Cause

The current condition is:

if score < confidence_threshold or class_id >= len(class_names) - 1:

Since class_names contains 80 classes (indices 0–79), this condition
incorrectly treats class ID 79 as invalid.

Expected Behavior

Class ID 79 should be recognized as "toothbrush".

Actual Behavior

Class ID 79 is displayed as "unknown".

Impact

The issue causes incorrect object labels in the detection visualization for the last category in the COCO class list.

Testing

I reproduced the issue using a unit test with:

  • Class ID: 79
  • Confidence score: 0.90

Expected output: toothbrush 90%

Actual output: unknown 90%

The test fails with the current implementation.

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.