Created
January 4, 2017 16:20
-
-
Save gvanhorn38/bab9e912ae66ae2dba58f3de5bd241a4 to your computer and use it in GitHub Desktop.
Example parsing inaturalist 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
import cPickle as pickle | |
import os | |
dataset_dir = '.' | |
train_file = os.path.join(dataset_dir, "train_data.pkl") | |
with open(train_file) as f: | |
train_data = pickle.load(f) | |
image_dir = "/home/gvanhorn/datasets/inaturalist/images" | |
train_images = [] | |
train_labels = [] | |
for image in train_data: | |
fn = image['filename'] | |
label = image['label'] | |
train_images.append(os.path.join(image_dir, fn)) | |
train_labels.append(label) | |
# Now do something... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment