not-lain commited on
Commit
eb7fd2d
·
verified ·
1 Parent(s): de880d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -3,7 +3,7 @@ import cv2
3
  import numpy as np
4
  from loadimg import load_img
5
  import gradio as gr
6
-
7
 
8
  model = AnimeSegmentation.from_pretrained("skytnt/anime-seg")
9
 
@@ -36,7 +36,7 @@ def get_mask(model, input_img, use_amp=True, s=640):
36
  pred = cv2.resize(pred, (w0, h0))[:, :, np.newaxis]
37
  return pred
38
 
39
-
40
  def process(img):
41
  path = load_img(img,output_type="str")
42
  img = cv2.cvtColor(cv2.imread(path, cv2.IMREAD_COLOR), cv2.COLOR_BGR2RGB)
 
3
  import numpy as np
4
  from loadimg import load_img
5
  import gradio as gr
6
+ import spaces
7
 
8
  model = AnimeSegmentation.from_pretrained("skytnt/anime-seg")
9
 
 
36
  pred = cv2.resize(pred, (w0, h0))[:, :, np.newaxis]
37
  return pred
38
 
39
+ @spaces.GPU
40
  def process(img):
41
  path = load_img(img,output_type="str")
42
  img = cv2.cvtColor(cv2.imread(path, cv2.IMREAD_COLOR), cv2.COLOR_BGR2RGB)