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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -18
app.py CHANGED
@@ -133,27 +133,26 @@ 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
 
142
- print(type(image))
143
- cv2.imwrite("Temp/input/input_img.png", image)
 
 
 
 
 
 
144
 
145
- command = ("python run.py --input_folder "
146
- + "Temp/input"
147
- + " --output_folder "
148
- + "Temp"
149
- + " --GPU "
150
- + "-1"
151
- + " --with_scratch")
152
- run_cmd(command)
153
 
154
- #result_restoration = Image.open("Temp/final_output/input_img.png")
155
- result_restoration = Image.open("home/user/app/Temp/final_output/input_img.png")
156
- shutil.rmtree("Temp")
157
 
158
  result_colorization = inferColorization(result_restoration)
159
 
 
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)
158