xp3857 commited on
Commit
bcb21e4
·
1 Parent(s): 24d75d8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -133,25 +133,25 @@ def run_cmd(command):
133
 
134
  def run(image):
135
 
136
- if os.path.isdir("Temp"):
137
- shutil.rmtree("Temp")
138
-
139
- os.makedirs("Temp")
140
- os.makedirs("Temp/input")
141
- print(type(image))
142
- cv2.imwrite("Temp/input/input_img.png", image)
143
 
144
- command = ("python run.py --input_folder "
145
- + "Temp/input"
146
- + " --output_folder "
147
- + "Temp"
148
- + " --GPU "
149
- + "-1"
150
- + " --with_scratch")
151
- run_cmd(command)
152
 
153
- result_restoration = Image.open("Temp/final_output/input_img.png")
154
- shutil.rmtree("Temp")
155
 
156
 
157
  result_colorization = inferColorization(result_restoration)
 
133
 
134
  def run(image):
135
 
136
+ if os.path.isdir("Temp"):
137
+ shutil.rmtree("Temp")
138
+
139
+ os.makedirs("Temp")
140
+ os.makedirs("Temp/input")
141
+ print(type(image))
142
+ cv2.imwrite("Temp/input/input_img.png", image)
143
 
144
+ command = ("python run.py --input_folder "
145
+ + "Temp/input"
146
+ + " --output_folder "
147
+ + "Temp"
148
+ + " --GPU "
149
+ + "-1"
150
+ + " --with_scratch")
151
+ run_cmd(command)
152
 
153
+ result_restoration = Image.open("Temp/final_output/input_img.png")
154
+ shutil.rmtree("Temp")
155
 
156
 
157
  result_colorization = inferColorization(result_restoration)