Get data using http://www.vision.caltech.edu/datasets/cub_200_2011/
Untar using tar -czvf CUB_200_2011.tgz
Place the python files from this repo in the same folder.
Execute below code only once
To get the data in one folder and the desired info:
python pre_process.py
To load the images and save as np format so we don't have to re-run it for every training iteration
Note: this saves the labels in the y_train and y_test data so you might want to change it to use bounding boxes, segmentations.
python save_as_np.py
Before creating the model if checkpoints are desired, create the folder specified in checkpoint_path variable.
python train.py
Below is original readme from the dataset
For more information about the dataset, visit the project website:
http://www.vision.caltech.edu/visipedia
If you use the dataset in a publication, please cite the dataset in the style described on the dataset website (see url above).
- images/ The images organized in subdirectories based on species. See IMAGES AND CLASS LABELS section below for more info.
- parts/ 15 part locations per image. See PART LOCATIONS section below for more info.
- attributes/ 322 binary attribute labels from MTurk workers. See ATTRIBUTE LABELS section below for more info.
Images are contained in the directory images/, with 200 subdirectories (one for each bird species)
------- List of image files (images.txt) ------ The list of image file names is contained in the file images.txt, with each line corresponding to one image:
------- Train/test split (train_test_split.txt) ------ The suggested train/test split is contained in the file train_test_split.txt, with each line corresponding to one image:
<image_id> <is_training_image>
where <image_id> corresponds to the ID in images.txt, and a value of 1 or 0 for <is_training_image> denotes that the file is in the training or test set, respectively.
------- List of class names (classes.txt) ------ The list of class names (bird species) is contained in the file classes.txt, with each line corresponding to one class:
------- Image class labels (image_class_labels.txt) ------ The ground truth class labels (bird species labels) for each image are contained in the file image_class_labels.txt, with each line corresponding to one image:
<image_id> <class_id>
Each image contains a single bounding box label. Bounding box labels are contained in the file bounding_boxes.txt, with each line corresponding to one image:
<image_id>
where <image_id> corresponds to the ID in images.txt, and , , , and are all measured in pixels
------- List of part names (parts/parts.txt) ------ The list of all part names is contained in the file parts/parts.txt, with each line corresponding to one part:
------- Part locations (parts/part_locs.txt) ------ The set of all ground truth part locations is contained in the file parts/part_locs.txt, with each line corresponding to the annotation of a particular part in a particular image:
<image_id> <part_id>
where <image_id> and <part_id> correspond to the IDs in images.txt and parts/parts.txt, respectively. and denote the pixel location of the center of the part. is 0 if the part is not visible in the image and 1 otherwise.
------- MTurk part locations (parts/part_click_locs.txt) ------ A set of multiple part locations for each image and part, as perceived by multiple MTurk users is contained in parts/part_click_locs.txt, with each line corresponding to the annotation of a particular part in a particular image by a different MTurk worker:
<image_id> <part_id>
where <image_id>, <part_id>, , are in the same format as defined in parts/part_locs.txt, and is the time in seconds spent by the MTurk worker.
------- List of attribute names (attributes/attributes.txt) ------ The list of all attribute names is contained in the file attributes/attributes.txt, with each line corresponding to one attribute:
------- List of certainty names (attributes/certainties.txt) ------ The list of all certainty names (used by workers to specify their certainty of an attribute response of is contained in the file attributes/certainties.txt, with each line corresponding to one certainty:
------- MTurk image attribute labels (attributes/image_attribute_labels.txt) ------ The set of attribute labels as perceived by MTurkers for each image is contained in the file attributes/image_attribute_labels.txt, with each line corresponding to one image/attribute/worker triplet:
<image_id> <attribute_id> <is_present> <certainty_id>