ml4a / ml4a

A python library and collection of notebooks for making art with machine learning.

Home Page:https://ml4a.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dataset utils w face recognition - get error cannot identify image file 'face/.DS_Store'

heaversm opened this issue · comments

Install dependencies, run

python3 dataset_utils.py --input_src face --output_dir cropped --w 256 --h 256 --action face --save_mode output_only --save_ext jpg

get

OSError: cannot identify image file 'face/.DS_Store'

I can get around this by manually removing the .DS_Store, but it always comes back. I feel like when I was reading through the scripts, I saw something regarding DS_Store but now I can't track it down.

in dataset_utils.py change this line
images = sorted([f for f in os.listdir(input_src) if os.path.isfile(os.path.join(input_src, f)) ])
to
images = sorted([f for f in os.listdir(input_src) if not f.startswith('.') and if os.path.isfile(os.path.join(input_src, f)) ])
should avoid any file starting with the dot sign.