Implement get_landmarks
This commit is contained in:
0
test/test_falign/__init__.py
Normal file
0
test/test_falign/__init__.py
Normal file
22
test/test_falign/test_landmarks.py
Normal file
22
test/test_falign/test_landmarks.py
Normal 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")
|
||||
Reference in New Issue
Block a user