Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -136,8 +136,13 @@ def run(image,Restoration_mode, Colorizaition_mode):
|
|
| 136 |
os.makedirs("Temp")
|
| 137 |
os.makedirs("Temp/input")
|
| 138 |
print(type(image))
|
| 139 |
-
|
| 140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
#image=np.array(image)
|
| 142 |
image=cv2.imread(image)
|
| 143 |
cv2.imwrite("Temp/input/input_img.png", image)
|
|
@@ -167,7 +172,7 @@ with gr.Blocks() as app:
|
|
| 167 |
with gr.Row():
|
| 168 |
gr.Column()
|
| 169 |
with gr.Column():
|
| 170 |
-
im = gr.
|
| 171 |
rad1 = gr.Radio(["BOPBTL", "Pix2Pix"])
|
| 172 |
rad2 = gr.Radio(["Deoldify", "Pix2Pix Resnet 9block","Pix2Pix Unet 256"])
|
| 173 |
|
|
|
|
| 136 |
os.makedirs("Temp")
|
| 137 |
os.makedirs("Temp/input")
|
| 138 |
print(type(image))
|
| 139 |
+
h,w,c=image.shape
|
| 140 |
+
#if h > 800:
|
| 141 |
+
h1 = int(h/2)
|
| 142 |
+
w1 = int(w/2)
|
| 143 |
+
image=cv2.resize(image, dsize=(h1, w1), interpolation=cv2.INTER_LANCZOS4)
|
| 144 |
+
#max_size=(800,800)
|
| 145 |
+
#image=image.thumbnail(max_size)
|
| 146 |
#image=np.array(image)
|
| 147 |
image=cv2.imread(image)
|
| 148 |
cv2.imwrite("Temp/input/input_img.png", image)
|
|
|
|
| 172 |
with gr.Row():
|
| 173 |
gr.Column()
|
| 174 |
with gr.Column():
|
| 175 |
+
im = gr.Image(label="Input Image")
|
| 176 |
rad1 = gr.Radio(["BOPBTL", "Pix2Pix"])
|
| 177 |
rad2 = gr.Radio(["Deoldify", "Pix2Pix Resnet 9block","Pix2Pix Unet 256"])
|
| 178 |
|