Skip to content

Commit

Permalink
fix bug: save img parallel_sequential
Browse files Browse the repository at this point in the history
  • Loading branch information
nachifur committed Nov 23, 2021
1 parent cfd6a70 commit c9004fd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@ def set_img_layout(self):
self.parallel_to_sequential.Value, # 19
self.one_img.Value, # 20
self.box_position.GetSelection(), # 21
self.parallel_sequential.Value, # 22
self.checkBox_orientation.Value]

def show_img(self):
Expand Down
30 changes: 18 additions & 12 deletions utils_img.py
Original file line number Diff line number Diff line change
Expand Up @@ -1457,24 +1457,30 @@ def save_select(self, dir_name):
else:
self.check.append(0)
else:

if not self.parallel_to_sequential:
for i in range(len(dir_name)):
if not (Path(self.out_path_str)/"select_images"/dir_name[i]).exists():
os.makedirs(Path(self.out_path_str) /
"select_images" / dir_name[i])

f_path = self.flist[i]
try:
if self.layout_params[11]:
move(f_path, Path(self.out_path_str) / "select_images" /
dir_name[i] / self.name_list[self.action_count])
else:
copyfile(f_path, Path(self.out_path_str) / "select_images" /
dir_name[i] / self.name_list[self.action_count])
except:
self.check.append(1)
if self.layout_params[22]: # parallel_sequential
num_per_img = self.layout_params[1]
else:
self.check.append(0)
num_per_img = 1
for k in range(num_per_img):
f_path = self.flist[i*num_per_img+k]
name = Path(f_path).name
try:
if self.layout_params[11]:
move(f_path, Path(self.out_path_str) / "select_images" /
dir_name[i] / name)
else:
copyfile(f_path, Path(self.out_path_str) / "select_images" /
dir_name[i] / name)
except:
self.check.append(1)
else:
self.check.append(0)

if self.layout_params[11]:
if self.action_count == 0:
Expand Down

0 comments on commit c9004fd

Please sign in to comment.