forked from lookbothways/vfxTools
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcopyFiles
More file actions
31 lines (22 loc) · 922 Bytes
/
Copy pathcopyFiles
File metadata and controls
31 lines (22 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# adds an output folder to the current path and copies the input path to it (as part of the detect_blur opencv tool)
import os
import shutil
def copyFile(fullImagePath):
# Make a new folder called output
extractParts = str(fullImagePath).split("/")
folderOnly = str(fullImagePath.split(extractParts[-1])[0])
fileOnly = extractParts[-1]
outputPath = folderOnly+ "output/"+fileOnly
if not os.path.exists(folderOnly+"output/"):
print "Creating output folder"
os.makedirs(folderOnly+"output")
if not os.path.exists(outputPath):
shutil.copy(fullImagePath,outputPath)
print("Copied to /output: "+ fullImagePath)
else:
print "File exists!"
return
#------
#change this to the output from the detect_blur.py script
fullImagePath="/home/mark/Desktop/atk_usefulInfo/detecting-blur/images/image_001.png"
copyFile(fullImagePath)