jfilter / split-folders

🗂 Split folders with files (i.e. images) into training, validation and test (dataset) folders
MIT License
412 stars 72 forks source link

Error while specifying only ratio and image folder with CLI #19

Closed ashnair1 closed 3 years ago

ashnair1 commented 3 years ago

splitfolders --ratio .8 .2 img_folder throws the following error

usage: splitfolders [-h] [--output OUTPUT] [--seed SEED]
                    [--ratio RATIO [RATIO ...]] [--fixed FIXED [FIXED ...]]
                    [--oversample] [--group_prefix GROUP_PREFIX]
                    input
splitfolders: error: argument --ratio: invalid float value: 'img_folder'
jfilter commented 3 years ago

Thanks for reporting. This looks like a bug (or at least a very rough edge) of Python's argparse. https://stackoverflow.com/a/26986546/4028896

Please use it like this:

splitfolders --ratio .8 .2 -- img_folder

I will update the docs.