arunponnusamy / cvlib

A simple, high level, easy to use, open source Computer Vision library for Python.
http://arunponnusamy.com/cvlib/
MIT License
647 stars 127 forks source link

Create cache_dir if not exists #21

Closed kangfend closed 5 years ago

kangfend commented 5 years ago

get_file doesn't save gender_detection.model to cache_dir if directory doesn't exists

arunponnusamy commented 5 years ago

Hey @kangfend , Thanks for the PR. Will test this and merge.

arunponnusamy commented 5 years ago

I have figured out the issue. I should have used cache_subdir with absolute path instead of cache_dir. Replacing cache_dir with cache_subdir in the below line fixes the issue. Thanks for reporting this.

model_path = get_file("gender_detection.model", dwnld_link,
                              cache_subdir= os.path.expanduser('~') + os.path.sep + '.cvlib' + os.path.sep + 'pre-trained')