(response)
| 74 | prompt_user_start = """Question: {question}""" |
| 75 | |
| 76 | def extract_json(response): |
| 77 | response = response.replace("```json","").replace("```","") |
| 78 | response = response.replace("```\n","").replace("\n```","") |
| 79 | response_json = json.loads(response) |
| 80 | return response_json |
| 81 | |
| 82 | def crop_and_dump(image_path, bbox, output_folder=image_output_dir): |
| 83 | if not os.path.exists(output_folder): |