AOSSIE-Org / AOSSIE-Org/PictoPy

BUG:Potential bugs and robustness issues in FaceDetector.detect_faces

Open
#1,049 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
283
Forks
679
Avg merge
7d 2h
Merged PRs (30d)
3

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

FaceDetector.detect_faces can produce inconsistent or unsafe results: class_ids are returned unfiltered while boxes and embeddings are filtered by confidence, cropped face images can be empty (leading to possible crashes), and ids is returned as a string instead of a list, making downstream usage unreliable.

**Prposed Solution**
Filter class_ids in the same way as boxes and scores, skip empty face crops before preprocessing, return ids as a proper list instead of a string, and add an explicit early return when no faces are detected to make behavior clearer and safer.
I had like to implement the solution.

### Record

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.