Guest User

Untitled

a guest
Jul 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import os, random
  2.  
  3. #Where the image folders live
  4. hardshell_path = "gear_images/hardshell_jackets/"
  5. insulated_path = "gear_images/insulated_jackets/"
  6.  
  7. #Play around with ratio training to run
  8. train_ratio = 0.5
  9.  
  10. set_hardshell = set(os.listdir(hardshell_path))
  11. set_insulated = set(os.listdir(insulated_path))
  12.  
  13. train_hardshell = random.sample(set_hardshell, int(len(set_hardshell) * train_ratio))
  14. train_insulated = random.sample(set_insulated, int(len(set_insulated) * train_ratio))
  15.  
  16. test_hardshell = set(set_hardshell) - set(train_hardshell)
  17. test_insulated = set(set_insulated) - set(train_insulated)
Add Comment
Please, Sign In to add comment