English
detection
open-world
open-set
Inference Endpoints
kelvinou01 commited on
Commit
22bf258
1 Parent(s): 46c271a

Fix handler

Browse files
Files changed (1) hide show
  1. handler.py +3 -1
handler.py CHANGED
@@ -1,10 +1,12 @@
1
 
2
  import os
3
  from typing import Dict, List, Any
 
4
  from groundingdino.util.inference import load_model, load_image, predict, annotate
5
 
6
  HOME = os.getcwd()
7
- CONFIG_PATH = os.path.join(HOME, "GroundingDINO/groundingdino/config/GroundingDINO_SwinT_OGC.py")
 
8
  WEIGHTS_PATH = os.path.join(HOME, "weights", "groundingdino_swint_ogc.pth")
9
 
10
  class EndpointHandler():
 
1
 
2
  import os
3
  from typing import Dict, List, Any
4
+ import groundingdino
5
  from groundingdino.util.inference import load_model, load_image, predict, annotate
6
 
7
  HOME = os.getcwd()
8
+ PACKAGE_HOME = groundingdino.__file__
9
+ CONFIG_PATH = os.path.join(PACKAGE_HOME, "config", "GroundingDINO_SwinT_OGC.py")
10
  WEIGHTS_PATH = os.path.join(HOME, "weights", "groundingdino_swint_ogc.pth")
11
 
12
  class EndpointHandler():