Landing AI
Loca Zero Shot Counting

a tool that counts the dominant foreground object given an image and no other information about the content. It returns only the count of the objects in the image.

Input

Count birds on wires

Output

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