Spaces:
Sleeping
Sleeping
Kingtous
commited on
Commit
·
38f925c
1
Parent(s):
28ab66a
feat: add app
Browse files- app.py +16 -0
- requirements.txt +2 -0
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import spaces
|
3 |
+
import torch
|
4 |
+
from PIL import Image
|
5 |
+
from simple_lama_inpainting import SimpleLama
|
6 |
+
lama: SimpleLama = SimpleLama()
|
7 |
+
|
8 |
+
zero = torch.Tensor([0]).cuda()
|
9 |
+
print(zero.device) # <-- 'cpu' 🤔
|
10 |
+
|
11 |
+
@spaces.GPU
|
12 |
+
def lama_inpainting(image: Image, mask: Image) -> Image:
|
13 |
+
return lama(image, mask)
|
14 |
+
|
15 |
+
inpaint = gr.Interface(fn=lama_inpainting, inputs=[gr.Image(), gr.ImageMask()], outputs=gr.Image())
|
16 |
+
inpaint.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
simple_lama_inpainting==0.1.2
|
2 |
+
Pillow
|