oscarfu0501
commited on
Commit
•
8f4d6ad
1
Parent(s):
071e154
Update handler.py
Browse files- handler.py +4 -3
handler.py
CHANGED
@@ -18,11 +18,12 @@ class EndpointHandler:
|
|
18 |
# current_directory = os.getcwd()
|
19 |
# print("Current working directory:", current_directory)
|
20 |
|
|
|
|
|
21 |
url = "https://drive.google.com/file/d/1jB8sDYYOTfuF7B1PMcDjkm5R7huv97Wm/view?usp=sharing"
|
22 |
gdown.download(url, 'best.pt', quiet=False)
|
23 |
|
24 |
-
|
25 |
-
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
26 |
inputs = data.get("inputs")
|
27 |
print("in call")
|
28 |
|
@@ -33,7 +34,7 @@ class EndpointHandler:
|
|
33 |
print("is path")
|
34 |
print(path)
|
35 |
# path = "http://10.10.2.100/cam-lo.jpg"
|
36 |
-
model = self.model
|
37 |
########################### Load Image #################################
|
38 |
if(isurl): # for url set isurl = 1
|
39 |
print("checkpoint 2-1")
|
|
|
18 |
# current_directory = os.getcwd()
|
19 |
# print("Current working directory:", current_directory)
|
20 |
|
21 |
+
|
22 |
+
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
23 |
url = "https://drive.google.com/file/d/1jB8sDYYOTfuF7B1PMcDjkm5R7huv97Wm/view?usp=sharing"
|
24 |
gdown.download(url, 'best.pt', quiet=False)
|
25 |
|
26 |
+
model = YOLO("best.pt")
|
|
|
27 |
inputs = data.get("inputs")
|
28 |
print("in call")
|
29 |
|
|
|
34 |
print("is path")
|
35 |
print(path)
|
36 |
# path = "http://10.10.2.100/cam-lo.jpg"
|
37 |
+
# model = self.model
|
38 |
########################### Load Image #################################
|
39 |
if(isurl): # for url set isurl = 1
|
40 |
print("checkpoint 2-1")
|