simple_lama / app.py
Kingtous
feat: add app
38f925c
raw
history blame
433 Bytes
import gradio as gr
import spaces
import torch
from PIL import Image
from simple_lama_inpainting import SimpleLama
lama: SimpleLama = SimpleLama()
zero = torch.Tensor([0]).cuda()
print(zero.device) # <-- 'cpu' πŸ€”
@spaces.GPU
def lama_inpainting(image: Image, mask: Image) -> Image:
return lama(image, mask)
inpaint = gr.Interface(fn=lama_inpainting, inputs=[gr.Image(), gr.ImageMask()], outputs=gr.Image())
inpaint.launch()