Spaces:
Running
on
Zero
Running
on
Zero
File size: 580 Bytes
ecdf655 9ec2c07 dc5e397 ebbe9bc dc5e397 9dbf9f0 dc5e397 0c3c890 dc5e397 7004c43 dc5e397 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
import numpy
import spaces
import gradio as gr
from PIL import Image
import upscale_image
import numpy as np
@spaces.GPU(duration=120)
def gradio_upscale(image):
pil_image = Image.fromarray(np.uint8(image)).convert('RGB')
return upscale_image.execute(image)
if __name__ == "__main__":
# Gradio UIの設定
iface = gr.Interface(
fn=gradio_upscale,
inputs="image",
outputs="image",
title="Image Upscale",
description="Upload an image to Upscale",
)
# インターフェースを公開
iface.launch(share=True)
|