Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -129,12 +129,16 @@ def run_cmd(command):
|
|
| 129 |
|
| 130 |
def run(image,Restoration_mode, Colorizaition_mode):
|
| 131 |
if Restoration_mode == "BOPBTL":
|
|
|
|
| 132 |
if os.path.isdir("Temp"):
|
| 133 |
shutil.rmtree("Temp")
|
| 134 |
|
| 135 |
os.makedirs("Temp")
|
| 136 |
os.makedirs("Temp/input")
|
| 137 |
print(type(image))
|
|
|
|
|
|
|
|
|
|
| 138 |
cv2.imwrite("Temp/input/input_img.png", image)
|
| 139 |
|
| 140 |
command = ("python run.py --input_folder "
|
|
@@ -163,9 +167,8 @@ with gr.Blocks() as app:
|
|
| 163 |
gr.Column()
|
| 164 |
with gr.Column():
|
| 165 |
im = gr.Image(label="Input Image")
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
rad2 = gr.Radio(["Deoldify", "Pix2Pix Resnet 9block","Pix2Pix Unet 256"])
|
| 169 |
|
| 170 |
im_btn=gr.Button(label="Restore")
|
| 171 |
out_im = gr.Image(label="Restored Image")
|
|
|
|
| 129 |
|
| 130 |
def run(image,Restoration_mode, Colorizaition_mode):
|
| 131 |
if Restoration_mode == "BOPBTL":
|
| 132 |
+
|
| 133 |
if os.path.isdir("Temp"):
|
| 134 |
shutil.rmtree("Temp")
|
| 135 |
|
| 136 |
os.makedirs("Temp")
|
| 137 |
os.makedirs("Temp/input")
|
| 138 |
print(type(image))
|
| 139 |
+
image.thumbnail(800,800)
|
| 140 |
+
|
| 141 |
+
|
| 142 |
cv2.imwrite("Temp/input/input_img.png", image)
|
| 143 |
|
| 144 |
command = ("python run.py --input_folder "
|
|
|
|
| 167 |
gr.Column()
|
| 168 |
with gr.Column():
|
| 169 |
im = gr.Image(label="Input Image")
|
| 170 |
+
rad1 = gr.Radio(["BOPBTL", "Pix2Pix"])
|
| 171 |
+
rad2 = gr.Radio(["Deoldify", "Pix2Pix Resnet 9block","Pix2Pix Unet 256"])
|
|
|
|
| 172 |
|
| 173 |
im_btn=gr.Button(label="Restore")
|
| 174 |
out_im = gr.Image(label="Restored Image")
|