-
Notifications
You must be signed in to change notification settings - Fork 25
/
data.py
75 lines (64 loc) · 1.77 KB
/
data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from torchlm.data import LandmarksWFLWConverter
from torchlm.data import Landmarks300WConverter
from torchlm.data import LandmarksCOFWConverter
from torchlm.data import LandmarksAFLWConverter
def test_wflw_converter():
converter = LandmarksWFLWConverter(
data_dir="../data/WFLW",
save_dir="../data/WFLW/converted",
extend=0.2,
rebuild=True,
target_size=256,
keep_aspect=False,
force_normalize=True,
force_absolute_path=True
)
converter.convert()
converter.show(count=30)
def test_300w_converter():
converter = Landmarks300WConverter(
data_dir="../data/300W",
save_dir="../data/300W/converted",
extend=0.2,
rebuild=True,
target_size=256,
keep_aspect=False,
force_normalize=True,
force_absolute_path=True
)
converter.convert()
converter.show(count=30)
def test_cofw_converter():
converter = LandmarksCOFWConverter(
data_dir="../data/COFW",
save_dir="../data/COFW/converted",
extend=0.2,
rebuild=True,
target_size=256,
keep_aspect=False,
force_normalize=True,
force_absolute_path=True
)
converter.convert()
converter.show(count=30)
def test_aflw_converter():
converter = LandmarksAFLWConverter(
data_dir="../data/AFLW",
save_dir="../data/AFLW/converted",
extend=0.2,
rebuild=True,
target_size=256,
keep_aspect=False,
force_normalize=True,
force_absolute_path=True
)
converter.convert()
converter.show(count=10)
if __name__ == "__main__":
test_wflw_converter()
test_300w_converter()
test_cofw_converter()
test_aflw_converter()
"""
python3 ./data.py
"""