yxchng commited on
Commit
a1eaffc
1 Parent(s): 01c029d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -11,7 +11,7 @@ print("B")
11
  #os.system('pip install tokenizers==0.8.1rc1')
12
  print("C")
13
 
14
- os.system('wget https://huggingface.co/yxchng/elia_refcoco/resolve/main/model_best_refcoco_0508.pth')
15
  image_path = './image001.png'
16
  sentence = 'spoon on the dish'
17
  weights = 'model_best_refcoco_0508.pth'
@@ -45,6 +45,7 @@ from addict import Dict
45
  #from bert.modeling_bert import BertLMPredictionHead, BertEncoder
46
  import cv2
47
  import textwrap
 
48
 
49
  class WrapperModel(nn.Module):
50
  def __init__(self, image_model, language_model, classifier) :
@@ -252,7 +253,7 @@ def overlay_davis(image, mask, colors=[[0, 0, 0], [255, 0, 0]], cscale=1, alpha=
252
 
253
  return im_overlay.astype(image.dtype)
254
 
255
-
256
  def run_model(img, sentence):
257
 
258
  #img = Image.open(image_path).convert("RGB")
 
11
  #os.system('pip install tokenizers==0.8.1rc1')
12
  print("C")
13
 
14
+ os.system('wget https://huggingface.co/yxchng/magnet_weights/resolve/main/magnet_refcoco.pth')
15
  image_path = './image001.png'
16
  sentence = 'spoon on the dish'
17
  weights = 'model_best_refcoco_0508.pth'
 
45
  #from bert.modeling_bert import BertLMPredictionHead, BertEncoder
46
  import cv2
47
  import textwrap
48
+ import spaces
49
 
50
  class WrapperModel(nn.Module):
51
  def __init__(self, image_model, language_model, classifier) :
 
253
 
254
  return im_overlay.astype(image.dtype)
255
 
256
+ @spaces.GPU(duration=10)
257
  def run_model(img, sentence):
258
 
259
  #img = Image.open(image_path).convert("RGB")