Landing AI
Florence-2 Image Caption

A tool that can caption or describe an image based on its contents. It returns a text describing the image.

Input

Generate caption for a photo

Output

python
import requests import base64 url = "https://api.landing.ai/v1/tools/florence2" with open("{{path_to_image}}", "rb") as image_file: base64_string = base64.b64encode(image_file.read()).decode('utf-8') payload = { "image": base64_string, "task": "<DETAILED_CAPTION>", "function_name": "florence2_image_caption" } headers = { "Content-Type": "application/json", "Accept": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json())