Mireu-Lab commited on
Commit
008bc8c
Β·
1 Parent(s): b0d2487

feat: create fileNum-check.py

Browse files
Files changed (1) hide show
  1. Processing/fileNum-check.py +31 -0
Processing/fileNum-check.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from glob import glob
2
+ from tqdm import tqdm
3
+
4
+ import shutil
5
+ import os
6
+
7
+
8
+ path = "/home/limmireu/λ‹€μš΄λ‘œλ“œ/All"
9
+ fileNames = sorted(glob(path+"/*.png"))
10
+
11
+ fileNum = 0
12
+
13
+ for fileName in tqdm(fileNames[0: 7000]):
14
+
15
+ fileName = os.path.basename(fileName)
16
+ fileName = fileName.split(".")[0]
17
+
18
+ if fileNum == 7000:
19
+ break
20
+
21
+ if (os.path.isfile(f"/home/limmireu/λ‹€μš΄λ‘œλ“œ/All/{fileName}.png") and
22
+ os.path.isfile(f"/home/limmireu/λ‹€μš΄λ‘œλ“œ/All/{fileName}.xml")):
23
+
24
+ shutil.move(f"/home/limmireu/λ‹€μš΄λ‘œλ“œ/All/{fileName}.png",
25
+ f"/home/limmireu/λ‹€μš΄λ‘œλ“œ/file/{fileName}.png")
26
+
27
+ shutil.move(f"/home/limmireu/λ‹€μš΄λ‘œλ“œ/All/{fileName}.xml",
28
+ f"/home/limmireu/λ‹€μš΄λ‘œλ“œ/file/{fileName}.xml")
29
+
30
+ fileNum += 2
31
+