Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -68,9 +68,15 @@ def perform_neural_transfer(content_image_input, style_image_input, super_resolu
|
|
| 68 |
stylized_image = tensor_to_image(stylized_image)
|
| 69 |
content_image_input = tensor_to_image(content_image_input)
|
| 70 |
stylized_image = stylized_image.resize(content_image_input.size)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
if super_resolution_type is "none":
|
| 72 |
return stylized_image
|
| 73 |
else:
|
|
|
|
| 74 |
stylized_image = inference(stylized_image, super_resolution_type)
|
| 75 |
return stylized_image
|
| 76 |
|
|
@@ -80,7 +86,7 @@ with gr.Blocks() as demo:
|
|
| 80 |
with gr.Row():
|
| 81 |
style_reference_input_gallery = gr.Gallery(list(style_urls.values()),
|
| 82 |
#width = 512,
|
| 83 |
-
height = 768 +
|
| 84 |
label = "Style Image gallery (click to use)")
|
| 85 |
with gr.Column():
|
| 86 |
super_resolution_type = gr.Radio(["none" ,"base", "anime"], type="value", default="none", label="model used to super resolution the Image Transformed")
|
|
@@ -102,7 +108,7 @@ with gr.Blocks() as demo:
|
|
| 102 |
image_click, style_reference_input_gallery, style_reference_input_image
|
| 103 |
)
|
| 104 |
|
| 105 |
-
trans_button.click(perform_neural_transfer, [content_image_input, style_reference_input_image], trans_image_output)
|
| 106 |
|
| 107 |
gr.Examples(
|
| 108 |
[
|
|
|
|
| 68 |
stylized_image = tensor_to_image(stylized_image)
|
| 69 |
content_image_input = tensor_to_image(content_image_input)
|
| 70 |
stylized_image = stylized_image.resize(content_image_input.size)
|
| 71 |
+
|
| 72 |
+
print("super_resolution_type :")
|
| 73 |
+
print(super_resolution_type)
|
| 74 |
+
#print(super_resolution_type.value)
|
| 75 |
+
|
| 76 |
if super_resolution_type is "none":
|
| 77 |
return stylized_image
|
| 78 |
else:
|
| 79 |
+
print("call else :")
|
| 80 |
stylized_image = inference(stylized_image, super_resolution_type)
|
| 81 |
return stylized_image
|
| 82 |
|
|
|
|
| 86 |
with gr.Row():
|
| 87 |
style_reference_input_gallery = gr.Gallery(list(style_urls.values()),
|
| 88 |
#width = 512,
|
| 89 |
+
height = 768 + 256,
|
| 90 |
label = "Style Image gallery (click to use)")
|
| 91 |
with gr.Column():
|
| 92 |
super_resolution_type = gr.Radio(["none" ,"base", "anime"], type="value", default="none", label="model used to super resolution the Image Transformed")
|
|
|
|
| 108 |
image_click, style_reference_input_gallery, style_reference_input_image
|
| 109 |
)
|
| 110 |
|
| 111 |
+
trans_button.click(perform_neural_transfer, [content_image_input, style_reference_input_image, super_resolution_type], trans_image_output)
|
| 112 |
|
| 113 |
gr.Examples(
|
| 114 |
[
|