Upload layer_diff_dataset/copy_my.py with huggingface_hub
Browse files
layer_diff_dataset/copy_my.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import shutil
|
| 3 |
+
from tqdm import tqdm
|
| 4 |
+
folder_path = '/mnt/workspace/workgroup/sihui.jsh/layer_diff_dataset/try/im'
|
| 5 |
+
in_path = '/mnt/workspace/workgroup/sihui.jsh/layer_diff_dataset/train/im'
|
| 6 |
+
folder_path_1 = '/mnt/workspace/workgroup/sihui.jsh/layer_diff_dataset/try/gt'
|
| 7 |
+
in_path_1 = '/mnt/workspace/workgroup/sihui.jsh/layer_diff_dataset/train/gt'
|
| 8 |
+
folder_path_2 = '/mnt/workspace/workgroup/sihui.jsh/layer_diff_dataset/try/rgba'
|
| 9 |
+
in_path_2 = '/mnt/workspace/workgroup/sihui.jsh/layer_diff_dataset/train/rgba'
|
| 10 |
+
file_list = os.listdir(folder_path)
|
| 11 |
+
file_list = [i.replace('.jpg','.png') for i in file_list if i.endswith('.jpg')]
|
| 12 |
+
file_list.sort()
|
| 13 |
+
|
| 14 |
+
pbar = tqdm(enumerate(file_list),total=len(file_list))
|
| 15 |
+
for i, image_name in pbar:
|
| 16 |
+
shutil.copy(os.path.join(in_path_1,image_name),os.path.join(folder_path_1,image_name))
|
| 17 |
+
shutil.copy(os.path.join(in_path_2,image_name),os.path.join(folder_path_2,image_name))
|