oscarfu0501 commited on
Commit
a7d8e83
·
verified ·
1 Parent(s): 6ce0e8f

Upload handler.py

Browse files
Files changed (1) hide show
  1. handler.py +5 -1
handler.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import supervision as sv
2
  import urllib.request
3
  import numpy as np
@@ -12,7 +13,10 @@ class EndpointHandler():
12
  api_key=key
13
  )
14
 
15
- def __call__(self, path , isurl):
 
 
 
16
  ########################### Load Image #################################
17
  if(isurl): # for url set isurl = 1
18
  req = urllib.request.urlopen(path)
 
1
+ from typing import Dict, List, Any
2
  import supervision as sv
3
  import urllib.request
4
  import numpy as np
 
13
  api_key=key
14
  )
15
 
16
+ def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
17
+ inputs = data.get("inputs")
18
+ isurl = inputs.get("isurl")
19
+ path = inputs.get("path")
20
  ########################### Load Image #################################
21
  if(isurl): # for url set isurl = 1
22
  req = urllib.request.urlopen(path)