Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -173,7 +173,7 @@ def init_weights(net, init='norm', gain=0.02):
|
|
| 173 |
nn.init.constant_(m.bias.data, 0.)
|
| 174 |
|
| 175 |
net.apply(init_func)
|
| 176 |
-
print(f"model initialized with {init} initialization")
|
| 177 |
return net
|
| 178 |
|
| 179 |
def init_model(model, device):
|
|
@@ -314,7 +314,7 @@ def visualize(model, data, dims):
|
|
| 314 |
|
| 315 |
def log_results(loss_meter_dict):
|
| 316 |
for loss_name, loss_meter in loss_meter_dict.items():
|
| 317 |
-
print(f"{loss_name}: {loss_meter.avg:.5f}")
|
| 318 |
|
| 319 |
# pip install fastai==2.4
|
| 320 |
from fastai.vision.learner import create_body
|
|
@@ -379,7 +379,7 @@ description = "Gradio demo for Image Colorization project. You can give an image
|
|
| 379 |
gr.Interface(
|
| 380 |
main_func,
|
| 381 |
[gr.Image(type="filepath", label="Input Image") ],
|
| 382 |
-
[gr.Textbox(label="Image Size"
|
| 383 |
title=title,
|
| 384 |
description=description,
|
| 385 |
examples=[ ['face.jpg'], ['montains.jpg'],['tree.jpg'] ])
|
|
|
|
| 173 |
nn.init.constant_(m.bias.data, 0.)
|
| 174 |
|
| 175 |
net.apply(init_func)
|
| 176 |
+
# print(f"model initialized with {init} initialization")
|
| 177 |
return net
|
| 178 |
|
| 179 |
def init_model(model, device):
|
|
|
|
| 314 |
|
| 315 |
def log_results(loss_meter_dict):
|
| 316 |
for loss_name, loss_meter in loss_meter_dict.items():
|
| 317 |
+
# print(f"{loss_name}: {loss_meter.avg:.5f}")
|
| 318 |
|
| 319 |
# pip install fastai==2.4
|
| 320 |
from fastai.vision.learner import create_body
|
|
|
|
| 379 |
gr.Interface(
|
| 380 |
main_func,
|
| 381 |
[gr.Image(type="filepath", label="Input Image") ],
|
| 382 |
+
[gr.Textbox(label="Image Size"),gr.Image(type="pil", label="Output Image"),"image",gr.Image( label="Output Image2"),"image"],
|
| 383 |
title=title,
|
| 384 |
description=description,
|
| 385 |
examples=[ ['face.jpg'], ['montains.jpg'],['tree.jpg'] ])
|