style: black format normalizer.py and test_normalizer.py
This commit is contained in:
parent
460530bb03
commit
5a4917d455
2 changed files with 7 additions and 4 deletions
|
|
@ -4,6 +4,7 @@ Landmark normalization for MediaPipe hand landmarks.
|
||||||
Converts raw (21, 3) landmark array into a 63-element translation- and
|
Converts raw (21, 3) landmark array into a 63-element translation- and
|
||||||
scale-invariant feature vector suitable for gesture classifiers.
|
scale-invariant feature vector suitable for gesture classifiers.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,9 @@ def test_translation_invariance():
|
||||||
def test_scale_invariance():
|
def test_scale_invariance():
|
||||||
pts_small = _synthetic_hand(scale=0.5)
|
pts_small = _synthetic_hand(scale=0.5)
|
||||||
pts_large = _synthetic_hand(scale=2.0)
|
pts_large = _synthetic_hand(scale=2.0)
|
||||||
np.testing.assert_allclose(normalize_hand(pts_small), normalize_hand(pts_large), atol=1e-5)
|
np.testing.assert_allclose(
|
||||||
|
normalize_hand(pts_small), normalize_hand(pts_large), atol=1e-5
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_zero_scale_does_not_crash():
|
def test_zero_scale_does_not_crash():
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue