23 lines
597 B
Python
23 lines
597 B
Python
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")
|