1adrianb / 1adrianb/face-alignment

It seems a bug in function "get_landmarks_from_directory( )"

Aperta
#303 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
7.5k
Fork
1.4k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi there,

**When I used the _get_landmarks_from_directory( )_ function as recommended [here](https://github.com/1adrianb/face-alignment#process-an-entire-directory-in-one-go), it was strange that the detected results of some images were wrong. Please check the images below:**
![image](https://user-images.githubusercontent.com/35102882/148214858-a01456ca-8e2e-4c0b-8064-f491169adf23.png)

**While when I used the _get_landmarks( )_ function to process each image with the code below, it turned out that all detected results seemed good.**
```
def my_get_landmarks_from_directory(fa, path):
img_list_raw = glob.glob(os.path.join(path, '*'))
img_list = [p for p in img_list_raw if is_image(p)]
predictions, no_face_detected = {}, []
for p in tqdm(img_list):
input = cv2.imread(p)
preds = fa.get_landmarks(input[..., ::-1])
if preds is None:
no_face_detected.append(p)
predictions[p] = preds if preds is None else preds[0].tolist()

return predictions, no_face_detected
```
![image](https://user-images.githubusercontent.com/35102882/148216194-bd8c01fc-6a03-4a5f-8997-ba76d9ee4989.png)

**I tried to dive into the source code to figure out if there were any bugs in _get_landmarks_from_directory( )_ function but everything seemed good, which made me confused. I attach two images in which I got wrong results when using _get_landmarks_from_directory( )_. Please test them. Thanks a lot.**
![14527](https://user-images.githubusercontent.com/35102882/148217270-1317615d-85cf-4adf-99db-66816f78c0a0.jpg)
![19432](https://user-images.githubusercontent.com/35102882/148217273-7a2fa437-96b8-4138-943b-27efc15e6129.jpg)

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

The issue is about a discrepancy between `get_landmarks_from_directory()` and `get_landmarks()`. Start by examining the `get_landmarks_from_directory` function in the source code, likely in the main module. Compare its image loading and preprocessing steps with the user's custom function. Test with the provided sample images to reproduce the bug. Check for differences in color channel handling (BGR vs RGB) or batch processing effects.

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

Valutazione

Stack tecnologico
python, pytorch
Ambito
computer-vision
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.