in src/co_op_translator/utils/vision/image_utils.py [0:0]
def retrieve_bounding_boxes_by_image_path(image_path):
image_name = os.path.basename(image_path).split(".")[0]
json_path = f"./bounding_boxes/{image_name}.json"
if os.path.exists(json_path):
bounding_boxes = load_bounding_boxes(json_path)
if os.path.exists(image_path):
return bounding_boxes
else:
print(f"Image file {image_path} does not exist.")
else:
print(f"Bounding box data {json_path} does not exist.")