Skip to content

Instantly share code, notes, and snippets.

@sizhky
Created May 13, 2020 09:54
Show Gist options
  • Save sizhky/76111db53bbe338e6671ac3648631a04 to your computer and use it in GitHub Desktop.
Save sizhky/76111db53bbe338e6671ac3648631a04 to your computer and use it in GitHub Desktop.
Load VOC data
import sys; sys.path.append('/home/yyr/data/VOCdevkit/')
from load_data import VOCDataset, get_items, aug_trn
from snippets.loader import *
_2007_root = Path("/home/yyr/data/VOCdevkit/VOC2007")
_2012_root = Path("/home/yyr/data/VOCdevkit/VOC2012")
train_items = get_items(_2007_root, 'train') + get_items(_2012_root, 'train')
val_items = get_items(_2007_root, 'val') + get_items(_2012_root, 'val')
logger.info(f'\n{len(train_items)} training images\n{len(val_items)} validation images')
x = VOCDataset(train_items, tfms=aug_trn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment