Implement get_landmarks

This commit is contained in:
2025-09-26 14:18:17 +08:00
parent 634e5b016e
commit 4e7c0f76da
4 changed files with 45 additions and 0 deletions

View File

View File

@@ -0,0 +1,22 @@
from pathlib import Path
from matplotlib import pyplot
from falign.landmarks import get_landmarks
def test_get_landmarks():
dir_gallery = Path(__file__).parent.parent.parent / "gallery"
path_image = dir_gallery / "original.jpg"
landmarks = get_landmarks(path_image)
assert landmarks.shape == (68, 2)
fig, ax = pyplot.subplots()
ax.imshow(pyplot.imread(path_image))
ax.scatter(landmarks[:, 0], landmarks[:, 1], s=1)
ax.axis("off")
ax.margins(0)
ax.set_aspect("equal")
fig.tight_layout(pad=0)
fig.savefig(dir_gallery / "test_get_landmarks.jpg")