Skip to content

Commit

Permalink
Update download urls for test_dataset.py (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
heatingma authored Jan 21, 2024
1 parent 7034d6d commit 6c7f359
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
22 changes: 13 additions & 9 deletions pygmtools/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,17 @@ def __init__(self, sets, obj_resize, **ds_dict):
self.dataset_dir = 'data/PascalVOC'
if not os.path.exists(ROOT_DIR):
assert ROOT_DIR == dataset_cfg.PascalVOC.ROOT_DIR, 'you should not change ROOT_DIR unless the data have been manually downloaded'
self.download(url='http://host.robots.ox.ac.uk/pascal/VOC/voc2011/VOCtrainval_25-May-2011.tar',
name='PascalVOC')
self.download(
url=['https://huggingface.co/heatingma/pygmtools/resolve/main/VOCtrainval_25-May-2011.tar',
'http://host.robots.ox.ac.uk/pascal/VOC/voc2011/VOCtrainval_25-May-2011.tar'],
name='PascalVOC'
)

if not os.path.exists(KPT_ANNO_DIR):
assert KPT_ANNO_DIR == dataset_cfg.PascalVOC.KPT_ANNO_DIR, 'you should not change KPT_ANNO_DIR unless the annotations have been manually downloaded'
self.download(
url='https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/shape/poselets/voc2011_keypoints_Feb2012.tgz',
url=['https://huggingface.co/heatingma/pygmtools/resolve/main/voc2011_keypoints_Feb2012.tgz',
'https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/shape/poselets/voc2011_keypoints_Feb2012.tgz'],
name='PascalVOC_anno')

if not os.path.exists(self.dataset_dir):
Expand Down Expand Up @@ -476,8 +480,8 @@ def __init__(self, sets, obj_resize, **ds_dict):
SPLIT_OFFSET = dataset_cfg.WillowObject.SPLIT_OFFSET
TRAIN_SAME_AS_TEST = dataset_cfg.WillowObject.TRAIN_SAME_AS_TEST
RAND_OUTLIER = dataset_cfg.WillowObject.RAND_OUTLIER
URL = ['http://www.di.ens.fr/willow/research/graphlearning/WILLOW-ObjectClass_dataset.zip',
'https://huggingface.co/heatingma/pygmtools/resolve/main/WILLOW-ObjectClass_dataset.zip']
URL = ['https://huggingface.co/heatingma/pygmtools/resolve/main/WILLOW-ObjectClass_dataset.zip',
'http://www.di.ens.fr/willow/research/graphlearning/WILLOW-ObjectClass_dataset.zip']
if len(ds_dict.keys()) > 0:
if 'CLASSES' in ds_dict.keys():
CLASSES = ds_dict['CLASSES']
Expand Down Expand Up @@ -1023,8 +1027,8 @@ def __init__(self, sets, obj_resize, **ds_dict):
CLASSES = dataset_cfg.IMC_PT_SparseGM.CLASSES
ROOT_DIR_NPZ = dataset_cfg.IMC_PT_SparseGM.ROOT_DIR_NPZ
ROOT_DIR_IMG = dataset_cfg.IMC_PT_SparseGM.ROOT_DIR_IMG
URL = ['https://drive.google.com/u/0/uc?id=1bisri2Ip1Of3RsUA8OBrdH5oa6HlH3k-&export=download',
'https://huggingface.co/heatingma/pygmtools/resolve/main/IMC-PT-SparseGM.tar.gz']
URL = ['https://huggingface.co/heatingma/pygmtools/resolve/main/IMC-PT-SparseGM.tar.gz',
'https://drive.google.com/u/0/uc?id=1bisri2Ip1Of3RsUA8OBrdH5oa6HlH3k-&export=download']

if len(ds_dict.keys()) > 0:
if 'MAX_KPT_NUM' in ds_dict.keys():
Expand Down Expand Up @@ -1197,8 +1201,8 @@ class CUB2011:
def __init__(self, sets, obj_resize, **ds_dict):
CLS_SPLIT = dataset_cfg.CUB2011.CLASS_SPLIT
ROOT_DIR = dataset_cfg.CUB2011.ROOT_DIR
URL = ['https://drive.google.com/u/0/uc?export=download&confirm=B8eu&id=1hbzc_P1FuxMkcabkgn9ZKinBwW683j45',
'https://huggingface.co/heatingma/pygmtools/resolve/main/CUB_200_2011.tar.gz']
URL = ['https://huggingface.co/heatingma/pygmtools/resolve/main/CUB_200_2011.tgz',
'https://drive.google.com/u/0/uc?export=download&confirm=B8eu&id=1hbzc_P1FuxMkcabkgn9ZKinBwW683j45']
if len(ds_dict.keys()) > 0:
if 'ROOT_DIR' in ds_dict.keys():
ROOT_DIR = ds_dict['ROOT_DIR']
Expand Down
6 changes: 3 additions & 3 deletions tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_dataset_and_benchmark():
willow_cfg_dict['SPLIT_OFFSET'] = dataset_cfg.WillowObject.SPLIT_OFFSET
willow_cfg_dict['TRAIN_SAME_AS_TEST'] = dataset_cfg.WillowObject.TRAIN_SAME_AS_TEST
willow_cfg_dict['RAND_OUTLIER'] = dataset_cfg.WillowObject.RAND_OUTLIER
willow_cfg_dict['URL'] = 'https://drive.google.com/u/0/uc?export=download&confirm=Z-AR&id=18AvGwkuhnih5bFDjfJK5NYM16LvDfwW_'
willow_cfg_dict['URL'] = 'https://huggingface.co/heatingma/pygmtools/resolve/main/WILLOW-ObjectClass_dataset.zip'
all_cfgs['WillowObject'] = willow_cfg_dict

if 'PascalVOC' in dataset_name_list:
Expand Down Expand Up @@ -107,13 +107,13 @@ def test_dataset_and_benchmark():
'test': ['reichstag']}
imcpt_cfg_dict['ROOT_DIR_NPZ'] = dataset_cfg.IMC_PT_SparseGM.ROOT_DIR_NPZ
imcpt_cfg_dict['ROOT_DIR_IMG'] = dataset_cfg.IMC_PT_SparseGM.ROOT_DIR_IMG
imcpt_cfg_dict['URL'] = 'https://drive.google.com/u/0/uc?id=1bisri2Ip1Of3RsUA8OBrdH5oa6HlH3k-&export=download'
imcpt_cfg_dict['URL'] = 'https://huggingface.co/heatingma/pygmtools/resolve/main/IMC-PT-SparseGM.tar.gz'
all_cfgs['IMC_PT_SparseGM'] = imcpt_cfg_dict

if 'CUB2011' in dataset_name_list:
cub_cfg_dict = dict()
cub_cfg_dict['ROOT_DIR'] = dataset_cfg.CUB2011.ROOT_DIR
cub_cfg_dict['URL'] = 'https://drive.google.com/u/0/uc?id=1fcN3m2PmQF7rMQGPxldEICU8CtJ0-F-z&export=download'
cub_cfg_dict['URL'] = 'https://huggingface.co/heatingma/pygmtools/resolve/main/CUB_200_2011.tgz'
all_cfgs['CUB2011'] = cub_cfg_dict

for dataset_name in dataset_name_list:
Expand Down

0 comments on commit 6c7f359

Please sign in to comment.