Skip to content

Instantly share code, notes, and snippets.

@Namburger
Created August 15, 2020 00:31
Show Gist options
  • Save Namburger/a360abd235c4244b223c3adac43914e7 to your computer and use it in GitHub Desktop.
Save Namburger/a360abd235c4244b223c3adac43914e7 to your computer and use it in GitHub Desktop.
Prepare dataset
# Now let's download our training dataset.
%mkdir /content/dataset
%cd /content/dataset
!wget http://www.robots.ox.ac.uk/~vgg/data/pets/data/images.tar.gz
!wget http://www.robots.ox.ac.uk/~vgg/data/pets/data/annotations.tar.gz
!tar zxf images.tar.gz
!tar zxf annotations.tar.gz
# Only picking Abyssinian Cat and the American Bulldog
# If you wish to train the model on all classes, simply skip this entire cell.
!cp /content/dataset/annotations/list.txt /content/dataset/annotations/list_petsdataset.txt
!cp /content/dataset/annotations/trainval.txt /content/dataset/annotations/trainval_petsdataset.txt
!cp /content/dataset/annotations/test.txt /content/dataset/annotations/test_petsdataset.txt
!grep "Abyssinian" /content/dataset/annotations/list_petsdataset.txt > /content/dataset/annotations/list.txt
!grep "american_bulldog" /content/dataset/annotations/list_petsdataset.txt >> /content/dataset/annotations/list.txt
!grep "Abyssinian" /content/dataset/annotations/trainval_petsdataset.txt > /content/dataset/annotations/trainval.txt
!grep "american_bulldog" /content/dataset/annotations/trainval_petsdataset.txt >> /content/dataset/annotations/trainval.txt
!grep "Abyssinian" /content/dataset/annotations/test_petsdataset.txt > /content/dataset/annotations/test.txt
!grep "american_bulldog" /content/dataset/annotations/test_petsdataset.txt >> /content/dataset/annotations/test.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment