NVlabs / eg3d

Other
3.24k stars 363 forks source link

Index mismatch hazard in dataset_preprocessing/ffhq/crop_images_in_the_wild.py #105

Open three-bee opened 1 year ago

three-bee commented 1 year ago

There is no assertion for len(img_files)==len(lm_files). If unsatisfied ( len(lm_files)<len(img_files), i.e. the face reconstruction backbone could not find landmarks for all given images ) this will eventually cause a hazard in the loop beginning on line 36, causing a continuous mismatch between images and their landmark files:

https://github.com/NVlabs/eg3d/blob/7cf1fd1e99e1061e8b6ba850f91c94fe56e7afe4/dataset_preprocessing/ffhq/crop_images_in_the_wild.py#L26-L38