1adrianb / 1adrianb/face-alignment

Are the face alignement landmark result same as dlib?

Offen
#350 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
7.5k
Forks
1.4k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Just wonder is these code are same result?

```
import face_alignment
# import dlib

class Croper:
def __init__(self, path_of_lm):
# download model from: http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
# self.predictor = dlib.shape_predictor(path_of_lm)
self.fa = face_alignment.FaceAlignment(face_alignment.LandmarksType.TWO_D, flip_input=False)

# def get_landmark(self, img_np):
# """get landmark with dlib
# :return: np.array shape=(68, 2)
# """
# detector = dlib.get_frontal_face_detector()
# dets = detector(img_np, 1)
# # print("Number of faces detected: {}".format(len(dets)))
# # for k, d in enumerate(dets):
# if len(dets) == 0:
# return None
# d = dets[0]
# # Get the landmarks/parts for the face in box d.
# shape = self.predictor(img_np, d)
# # print("Part 0: {}, Part 1: {} ...".format(shape.part(0), shape.part(1)))
# t = list(shape.parts())
# a = []
# for tt in t:
# a.append([tt.x, tt.y])
# lm = np.array(a)
# # lm is a shape=(68,2) np.array
# return lm

def get_landmark(self, img_np):
"""get landmark with dlib
:return: np.array shape=(68, 2)
"""
lm = self.fa.get_landmarks(img_np)
lm = np.array(lm)[0]
print(lm)
print(lm.shape)
# lm is a shape=(68,2) np.array
return lm
```

I wanna replace dlib with face_alignement, does their behaviour are same?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Check the face_alignment library's source code for landmark extraction logic, particularly in the get_landmarks method. Compare the output format and coordinate system with dlib's 68-point model. Run both methods on a sample image to see if the landmarks align. Review the library's documentation or tests for any existing comparisons.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python, pytorch
Bereich
computer-vision
Issue-Typ
Dokumentation
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.