kelvinou01
commited on
Commit
•
96e0ac2
1
Parent(s):
b3bc745
Try model
Browse files- handler.py +1 -4
handler.py
CHANGED
@@ -12,14 +12,11 @@ HOME = os.getcwd()
|
|
12 |
PACKAGE_HOME = os.path.dirname(groundingdino.__file__)
|
13 |
|
14 |
CONFIG_PATH = os.path.join(PACKAGE_HOME, "config", "GroundingDINO_SwinT_OGC.py")
|
15 |
-
WEIGHTS_PATH = os.path.join(
|
16 |
-
|
17 |
-
WEIGHTS_URL = "https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth"
|
18 |
|
19 |
class EndpointHandler():
|
20 |
def __init__(self, path):
|
21 |
# Preload all the elements you are going to need at inference.
|
22 |
-
subprocess.check_call(["wget", "-q", "-O", WEIGHTS_PATH])
|
23 |
self.model = load_model(CONFIG_PATH, WEIGHTS_PATH)
|
24 |
|
25 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
|
|
12 |
PACKAGE_HOME = os.path.dirname(groundingdino.__file__)
|
13 |
|
14 |
CONFIG_PATH = os.path.join(PACKAGE_HOME, "config", "GroundingDINO_SwinT_OGC.py")
|
15 |
+
WEIGHTS_PATH = os.path.join("model", "weights", "groundingdino_swint_ogc.pth")
|
|
|
|
|
16 |
|
17 |
class EndpointHandler():
|
18 |
def __init__(self, path):
|
19 |
# Preload all the elements you are going to need at inference.
|
|
|
20 |
self.model = load_model(CONFIG_PATH, WEIGHTS_PATH)
|
21 |
|
22 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|