Skip to content

Instantly share code, notes, and snippets.

@netbrain
Last active January 27, 2020 06:12
Show Gist options
  • Save netbrain/0fccdd93325ccaf481070ace5a526e71 to your computer and use it in GitHub Desktop.
Save netbrain/0fccdd93325ccaf481070ace5a526e71 to your computer and use it in GitHub Desktop.
Create test/train set example
#!/bin/bash
find /path/to/JPEGImages | grep jpg$ | shuf > files.list
cat files.list | wc -l
#180 = 10%
cat files.list | head -n 180 > test.txt
#rest goes into train.txt
cat files.list | grep -v -f test.txt > train.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment