Skip to content

Commit

Permalink
Merge pull request #103 from jolibrain/fix_base_dataset_validation_no…
Browse files Browse the repository at this point in the history
…_label

fix: validation with no label, e.g. simple cut model
  • Loading branch information
beniz authored Dec 14, 2021
2 parents a337990 + 53984f4 commit bb366b7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions data/base_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,18 @@ def __getitem__(self, index):
def get_validation_set(self,size):
return_A_list = []
return_B_list = []
if not hasattr(self,'A_label_paths') :
A_label_paths = [None for k in range(size)]
else:
A_label_paths = self.A_label_paths
if not hasattr(self,'B_img_paths') :
self.B_img_paths = [None for k in range(size)]
if not hasattr(self,'B_label_paths') :
self.B_label_paths = [None for k in range(size)]

for A_img_path,A_label_path,B_img_path,B_label_path in zip(self.A_img_paths,self.A_label_paths,self.B_img_paths,self.B_label_paths):
B_label_paths = [None for k in range(size)]
else:
B_label_paths = self.B_label_paths

for A_img_path,A_label_path,B_img_path,B_label_path in zip(self.A_img_paths,A_label_paths,self.B_img_paths,B_label_paths):
if len(return_A_list) >=size :
break
images=self.get_img(A_img_path,A_label_path,B_img_path,B_label_path)
Expand Down

0 comments on commit bb366b7

Please sign in to comment.