yinguobing / facial-landmark-dataset

A collection of facial landmark datasets and Python code to make use of them.
MIT License
100 stars 14 forks source link

LFPW dataset structure #2

Open yinguobing opened 4 years ago

yinguobing commented 4 years ago

How can I use the LFPW facial landmark dataset? Dataset: https://ibug.doc.ic.ac.uk/resources/facial-point-annotations/

yinguobing commented 4 years ago

The raw data you downloaded from the official website should be a single zip file named lfpw.zip of size 359.6MB.

Unzip it, You will get a directory named lfpw.

unzip lfpw.zip

There are two directories in it:

testset  trainset

The trainset contains 811 png files and 811 pts files, while testset contains 224 png files and 224 pts files.

To take a peek of all the files:

python3 image_utility/count_files.py /home/robin/data/facial-marks/lfpw/
Total files: 2070
{'png': 1035, 'pts': 1035}
Done!
yinguobing commented 4 years ago

Similar to 300W, the marks are stored in a text file with an extension name pts. Here is an example: File: image_0001.pts

version: 1
n_points:  68
{
115.167660 220.807529
116.164839 245.721357
120.208690 270.389841
126.818237 293.156059
135.630967 313.719094
148.115667 336.485312
162.069155 357.782742
175.244288 375.646752
196.629641 382.645477
218.251194 381.353984
240.107363 364.628222
258.624908 347.083661
276.182758 326.369112
287.933064 300.889178
292.640683 273.327417
296.864703 246.434902
300.377962 218.496828
123.880661 214.575887
139.490678 215.929559
153.266075 219.788449
167.524839 225.304335
181.178785 232.537082
209.926602 232.365554
228.769747 226.989098
245.270669 222.183443
262.623085 220.119501
278.396024 221.284493
195.438309 247.230838
193.878987 266.412131
192.715650 283.702654
191.413450 299.777554
175.394672 303.212546
183.252244 309.321263
192.860805 313.386123
203.029501 309.992086
211.167139 305.865789
143.511472 240.605877
152.873610 234.904027
165.885257 234.655325
175.515413 243.565778
165.006732 245.420441
152.026189 244.447496
222.758288 246.624566
233.246081 239.604592
245.639459 238.315050
255.057142 244.458884
245.790086 249.092411
234.108232 249.773901
162.766194 318.246815
173.239365 319.463029
184.243161 320.665411
193.282615 323.761650
203.914072 322.478920
217.708849 323.720545
234.039780 323.266218
216.911898 345.507827
203.746197 349.087438
192.056977 349.252320
181.960552 346.648746
170.687582 338.371143
169.898521 322.774535
183.940980 324.969545
193.291010 327.191247
203.605936 327.453212
227.819411 327.220701
203.605936 336.539751
193.356785 336.194279
183.164758 334.765621
}

The key marks indices are: 36, 39, 42, 45, 48, 54