skumar1998 commited on
Commit
8ab6d35
·
1 Parent(s): a8bc875

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +5 -5
handler.py CHANGED
@@ -23,16 +23,16 @@ class EndpointHandler():
23
  def __call__(self, data: Dict) -> Dict:
24
 
25
  # logging.info(f'Value of data is : {data}')
26
- logger.info(f'data: {data}')
27
- logger.info(f'type of data: {type(data)}')
28
  image_url = data.get('image_url')
29
- logger.info(f'Image url is : {image_url}')
30
  response = requests.get(image_url)
31
  pil_image = Image.open(BytesIO(response.content))
32
 
33
- logger.info('Model inference started....')
34
  t1 = time.time()
35
  results = self.model(pil_image)
36
- logger.info(f'TIME Model inference: {time.time() - t1}')
37
  # postprocess the prediction -> results[0].boxes.data.tolist()
38
  return {"bbox": results[0].boxes.data.tolist()}
 
23
  def __call__(self, data: Dict) -> Dict:
24
 
25
  # logging.info(f'Value of data is : {data}')
26
+ logging.info(f'data: {data}')
27
+ logging.info(f'type of data: {type(data)}')
28
  image_url = data.get('image_url')
29
+ logging.info(f'Image url is : {image_url}')
30
  response = requests.get(image_url)
31
  pil_image = Image.open(BytesIO(response.content))
32
 
33
+ logging.info('Model inference started....')
34
  t1 = time.time()
35
  results = self.model(pil_image)
36
+ logging.info(f'TIME Model inference: {time.time() - t1}')
37
  # postprocess the prediction -> results[0].boxes.data.tolist()
38
  return {"bbox": results[0].boxes.data.tolist()}