Created
August 15, 2020 00:31
-
-
Save Namburger/a360abd235c4244b223c3adac43914e7 to your computer and use it in GitHub Desktop.
Prepare dataset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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