Skip to content

Commit

Permalink
fix macos test
Browse files Browse the repository at this point in the history
  • Loading branch information
ziao-guo committed Nov 12, 2023
1 parent 7035548 commit 75b8e5f
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
from random import choice
import os

import platform
os_name = platform.system()

# Test dataset download and preprocess, and data fetch and evaluation
def _test_benchmark(name, sets, problem, filter, **ds_dict):
benchmark = pygm.benchmark.Benchmark(name=name, sets=sets, problem=problem, filter=filter, **ds_dict)
Expand Down Expand Up @@ -58,6 +61,9 @@ def _test_get_data(benchmark, num):
# Entry function
def test_dataset_and_benchmark():
dataset_name_list = ['WillowObject', 'PascalVOC', 'SPair71k', 'IMC_PT_SparseGM', 'CUB2011']

if os_name == 'Darwin':
dataset_name_list = ['WillowObject', 'PascalVOC', 'SPair71k', 'IMC_PT_SparseGM', 'CUB2011']
problem_type_list = ['2GM', 'MGM']
set_list = ['train', 'test']
filter_list = ['intersection', 'inclusion', 'unfiltered']
Expand All @@ -74,14 +80,15 @@ def test_dataset_and_benchmark():
willow_cfg_dict['URL'] = 'https://drive.google.com/u/0/uc?export=download&confirm=Z-AR&id=18AvGwkuhnih5bFDjfJK5NYM16LvDfwW_'
dict_list.append(willow_cfg_dict)

voc_cfg_dict = dict()
voc_cfg_dict['KPT_ANNO_DIR'] = dataset_cfg.PascalVOC.KPT_ANNO_DIR
voc_cfg_dict['ROOT_DIR'] = dataset_cfg.PascalVOC.ROOT_DIR
voc_cfg_dict['SET_SPLIT'] = dataset_cfg.PascalVOC.SET_SPLIT
voc_cfg_dict['CLASSES'] = dataset_cfg.PascalVOC.CLASSES
voc_cfg_dict['CACHE_PATH'] = dataset_cfg.CACHE_PATH
voc_cfg_dict['URL'] = 'https://huggingface.co/datasets/ziaoguo/small_VOC/resolve/main/small_voc.tar?download=true'
dict_list.append(voc_cfg_dict)
if os_name != 'Darwin':
voc_cfg_dict = dict()
voc_cfg_dict['KPT_ANNO_DIR'] = dataset_cfg.PascalVOC.KPT_ANNO_DIR
voc_cfg_dict['ROOT_DIR'] = dataset_cfg.PascalVOC.ROOT_DIR
voc_cfg_dict['SET_SPLIT'] = dataset_cfg.PascalVOC.SET_SPLIT
voc_cfg_dict['CLASSES'] = dataset_cfg.PascalVOC.CLASSES
voc_cfg_dict['CACHE_PATH'] = dataset_cfg.CACHE_PATH
voc_cfg_dict['URL'] = 'https://huggingface.co/datasets/ziaoguo/small_VOC/resolve/main/small_voc.tar?download=true'
dict_list.append(voc_cfg_dict)

spair_cfg_dict = dict()
spair_cfg_dict['TRAIN_DIFF_PARAMS'] = {'mirror': 0}
Expand Down

0 comments on commit 75b8e5f

Please sign in to comment.