Implement landmark plot function

This commit is contained in:
2025-09-26 14:28:05 +08:00
parent 4e7c0f76da
commit 3b2ed107c3
2 changed files with 32 additions and 9 deletions

View File

@@ -1,8 +1,9 @@
from pathlib import Path
from matplotlib import pyplot
from skimage.io import imread
from falign.landmarks import get_landmarks
from falign.plot import imsave_with_landmarks
def test_get_landmarks():
@@ -12,11 +13,8 @@ def test_get_landmarks():
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")
imsave_with_landmarks(
dir_gallery / "test_get_landmarks.jpg",
imread(path_image), landmarks,
size=5
)