Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os, random
- #Where the image folders live
- hardshell_path = "gear_images/hardshell_jackets/"
- insulated_path = "gear_images/insulated_jackets/"
- #Play around with ratio training to run
- train_ratio = 0.5
- set_hardshell = set(os.listdir(hardshell_path))
- set_insulated = set(os.listdir(insulated_path))
- train_hardshell = random.sample(set_hardshell, int(len(set_hardshell) * train_ratio))
- train_insulated = random.sample(set_insulated, int(len(set_insulated) * train_ratio))
- test_hardshell = set(set_hardshell) - set(train_hardshell)
- test_insulated = set(set_insulated) - set(train_insulated)
Add Comment
Please, Sign In to add comment