@@ -35,7 +35,7 @@ def step(self):
3535 param_group ['lr' ] = lr
3636
3737class DomainGeneralization_tester :
38- def __init__ (self , train_dataset , test_dataset , img_mean_mode = None , distillation = False , wait = False , data_dir = None ):
38+ def __init__ (self , train_dataset , test_dataset , img_mean_mode = None , distillation = False , wait = False , data_dir = None , first_run = False ):
3939 """
4040 Conditional constructor to enable creating testers without immediately triggering the dataset loader.
4141
@@ -47,6 +47,7 @@ def __init__(self, train_dataset, test_dataset, img_mean_mode=None, distillation
4747 :param wait: (bool) If True, then the constructor will onyl create the instance and
4848 wait for manual activation to actually load the dataset
4949 :param data_dir: (str) relative filepath to datasets
50+ :param first_run: (bool) to initiate COCO benchmark preprocessing
5051 """
5152 # Base class variables
5253 ROOT_DIR = os .path .dirname (os .path .abspath (__file__ ))
@@ -57,7 +58,8 @@ def __init__(self, train_dataset, test_dataset, img_mean_mode=None, distillation
5758 self .training_set_size = None
5859 self .img_mean_mode = img_mean_mode
5960 self .distillation = distillation
60- self .data_dir = os .path .join (ROOT_DIR , "../../datasets" ) if data_dir is None else data_dir
61+ self .data_dir = os .path .join (ROOT_DIR , "../../datasets" ) if data_dir is None else "../%s" % data_dir
62+ self .first_run = first_run
6163
6264 # Loss func init
6365 self .classification_loss = None
@@ -77,7 +79,7 @@ def activate(self):
7779
7880 # Deploy the dataset
7981 if "COCO" == self .train_dataset :
80- self .dataset = Datasets .load_COCO (first_run = False , train = True , img_mean_mode = self .img_mean_mode , distillation = self .distillation , data_dir = self .data_dir )
82+ self .dataset = Datasets .load_COCO (first_run = self . first_run , train = True , img_mean_mode = self .img_mean_mode , distillation = self .distillation , data_dir = self .data_dir )
8183 self .x_test , self .y_test = Datasets .load_COCO (first_run = False , train = False , img_mean_mode = self .img_mean_mode , data_dir = self .data_dir )
8284
8385 elif "FullDomainNet" in self .train_dataset :
0 commit comments