eagle0504 commited on
Commit
f584587
·
verified ·
1 Parent(s): ed84011

Update utils/helpers.py

Browse files
Files changed (1) hide show
  1. utils/helpers.py +2 -2
utils/helpers.py CHANGED
@@ -235,7 +235,7 @@ def draw_boxes(image: Any, predictions: List[Dict[str, Any]]) -> Any:
235
  return image
236
 
237
 
238
- def draw_bounding_boxes_for_textract(image: Image.Image, json_data: str) -> Image.Image:
239
  """
240
  Draws bounding boxes on an image based on the provided JSON data from Textract.
241
 
@@ -251,7 +251,7 @@ def draw_bounding_boxes_for_textract(image: Image.Image, json_data: str) -> Imag
251
 
252
  # Parse the JSON data
253
  try:
254
- data = json.loads(json_data)
255
  blocks = json.loads(data['body']) if 'body' in data else None
256
  except json.JSONDecodeError:
257
  st.error('Invalid JSON data.')
 
235
  return image
236
 
237
 
238
+ def draw_bounding_boxes_for_textract(image: Image.Image, json_data: Dict[str, Any]) -> Image.Image:
239
  """
240
  Draws bounding boxes on an image based on the provided JSON data from Textract.
241
 
 
251
 
252
  # Parse the JSON data
253
  try:
254
+ data = json_data
255
  blocks = json.loads(data['body']) if 'body' in data else None
256
  except json.JSONDecodeError:
257
  st.error('Invalid JSON data.')