Upload layer_diff_dataset/copy_gt.py with huggingface_hub
Browse files
layer_diff_dataset/copy_gt.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import shutil
|
3 |
+
from tqdm import tqdm
|
4 |
+
|
5 |
+
image_dir_path = '/mnt/workspace/workgroup/sihui.jsh/layer_diff_dataset/try/gt_inp_iic_dilate'
|
6 |
+
image_dir_path_1 = '/mnt/workspace/workgroup/sihui.jsh/layer_diff_dataset/train/gt_inp_iic_gt_dilate'
|
7 |
+
image_dir_path_2 = '/mnt/workspace/workgroup/sihui.jsh/layer_diff_dataset/try/gt_inp_iic_gt_dilate'
|
8 |
+
os.makedirs(image_dir_path_2,exist_ok=True)
|
9 |
+
image_dir = os.listdir(image_dir_path)
|
10 |
+
image_dir.sort()
|
11 |
+
pbar = tqdm(enumerate(image_dir),total=len(image_dir))
|
12 |
+
for idx, image_name in pbar:
|
13 |
+
shutil.copy(os.path.join(image_dir_path_1,image_name),os.path.join(image_dir_path_2,image_name))
|