hpc-yekin commited on
Commit
44e4a4a
1 Parent(s): 92e0882

changes for gpu usage

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +2 -1
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🏢
4
  colorFrom: green
5
  colorTo: red
6
  sdk: gradio
7
- sdk_version: 3.48.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
4
  colorFrom: green
5
  colorTo: red
6
  sdk: gradio
7
+ sdk_version: 4.0.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
app.py CHANGED
@@ -1,5 +1,5 @@
 
1
  import gradio as gr
2
- import sys
3
  import torch
4
  from omegaconf import OmegaConf
5
  from PIL import Image
@@ -45,6 +45,7 @@ def combine_masks(uploaded_mask, sketched_mask):
45
  else:
46
  raise ValueError("Please provide a mask")
47
 
 
48
  def remove_obj(image, uploaded_mask, seed):
49
  image_pil, sketched_mask = image["image"], image["mask"]
50
  mask = dilate_mask(combine_masks(uploaded_mask, sketched_mask))
 
1
+ import spaces
2
  import gradio as gr
 
3
  import torch
4
  from omegaconf import OmegaConf
5
  from PIL import Image
 
45
  else:
46
  raise ValueError("Please provide a mask")
47
 
48
+ @spaces.GPU
49
  def remove_obj(image, uploaded_mask, seed):
50
  image_pil, sketched_mask = image["image"], image["mask"]
51
  mask = dilate_mask(combine_masks(uploaded_mask, sketched_mask))