Implement landmark plot function
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user