xp3857 commited on
Commit
f56e9e2
1 Parent(s): 4755925

Update app.py

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