jfilter / split-folders

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

Added compatibility for python <3.6 and fixed an error while running on windows. #7

Closed joybanerjee08 closed 5 years ago

joybanerjee08 commented 5 years ago

Hello, I was exploring your library this evening, which seemed very helpful. But after downloading, I couldn't get it to work and I was repeatedly getting this error : image

After a lot of experimenting with various things, I managed to fixed the error by adding a few lines to the main code ! 😄

I ran the tests too, so here is the first test result (with no changes) : image

This is because f" ...." only works in Python 3.6 and above, so I changed that, and now it works in Python 3.5
image

Then I ran the test again, this time I got this error : image

I don't know why this was happening, but anyway, I fixed it by converting them (the variables that were causing the errors) to string before using them in shutil.copy2 and others.

Finally, I ran the tests and : image

Now, once everything was fixed, I was using this library to separate around 22Gb of data. Needless to say I needed to know how long it would take, so I added tqdm for progress bar visualization. If there's no tqdm, this library would still work perfectly.

Lastly, I added a __main__.py file so that I can run the commands using python -m split_folders .... The file in bin folder needed to be added to an environment variable in windows before using it, so instead I made a direct way of using this library.

Overall this is a fantastic library for me, and thank you for making it ! 😃

jfilter commented 5 years ago

Hey, thanks for your better work but I wont merge it. Next time please open an issue before and lets speak about the changes you want to make. Not supporting < 3.6 was an active decision. Sorry dude.