# Image Detection (`geneius/image-detection`) Actor

High-precision object detection powered by state-of-the-art vision models. Provide an image URL and entity list to receive precise bounding box coordinates, annotated images, and accurate counts.

- **URL**: https://apify.com/geneius/image-detection.md
- **Developed by:** [Gene](https://apify.com/geneius) (community)
- **Categories:** AI, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 12 total users, 0 monthly users, 96.6% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Image Detection

High-precision object detection powered by state-of-the-art vision models. Provide an image URL and entity list to receive precise bounding box coordinates, annotated images, and accurate counts.

### Examples

| Input | Output | Input | Output |
|-------|--------|-------|--------|
| <img src="https://apify-public.s3.us-west-1.amazonaws.com/test.jpg" width="450"> | <img src="https://apify-public.s3.us-west-1.amazonaws.com/result_image.webp" width="450"> | <img src="https://apify-public.s3.us-west-1.amazonaws.com/shopping_cart.png" width="450"> | <img src="https://apify-public.s3.us-west-1.amazonaws.com/shopping_cart_result.webp" width="450"> |
| *Cats* | *Detecting cats* | *Shopping cart* | *Detecting onions* |
| <img src="https://apify-public.s3.us-west-1.amazonaws.com/product_listings.png" width="450"> | <img src="https://apify-public.s3.us-west-1.amazonaws.com/product_listings_result.webp" width="450"> | <img src="https://apify-public.s3.us-west-1.amazonaws.com/police%20chase.jpg" width="450"> | <img src="https://apify-public.s3.us-west-1.amazonaws.com/police_chase_result.webp" width="450"> |
| *Product listings* | *Detecting product listings* | *Police chase* | *Detecting police cars* |

### What it does

This Actor analyzes images and finds objects you specify. It returns:

- **Detection coordinates** — Precise bounding box locations for each detected object
- **Annotated image** — Visual output with bounding boxes drawn on the original image

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `imageUrl` | string | Yes | URL of the image to analyze |
| `categories` | string\[] | Yes | Objects to detect (e.g., `["cat", "dog", "person"]`) |

#### Example

```json
{
    "imageUrl": "https://media.hswstatic.com/eyJidWNrZXQiOiJjb250ZW50Lmhzd3N0YXRpYy5jb20iLCJrZXkiOiJnaWZcL3NodXR0ZXJzdG9jay0yMjc4Nzc2MTg3LWhlcm8uanBnIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjo4Mjh9fX0=",
    "categories": ["cat"]
}
```

### Output

#### Dataset

Each run produces a result with:

| Field | Description |
|-------|-------------|
| `imageUrl` | The analyzed image URL |
| `categories` | Categories you searched for |
| `detections` | Array of detected objects with labels and bounding boxes |
| `detectionSummary` | Human-readable summary of what was found |
| `annotatedImageKey` | Key to download the annotated image |
| `annotatedImageContentType` | MIME type of the annotated image |

##### Example Output

```json
{
    "imageUrl": "https://media.hswstatic.com/eyJidWNrZXQiOiJjb250ZW50Lmhzd3N0YXRpYy5jb20iLCJrZXkiOiJnaWZcL3NodXR0ZXJzdG9jay0yMjc4Nzc2MTg3LWhlcm8uanBnIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjo4Mjh9fX0=",
    "categories": ["cat"],
    "detections": [
        {
            "label": "cat",
            "count": 3,
            "boxes": [
                {"x1": 46, "y1": 140, "x2": 401, "y2": 984},
                {"x1": 305, "y1": 3, "x2": 658, "y2": 988},
                {"x1": 640, "y1": 306, "x2": 934, "y2": 985}
            ]
        }
    ],
    "detectionSummary": "- cat: 3 instances detected",
    "annotatedImageKey": "annotated-image-1766024606223.png",
    "annotatedImageContentType": "image/png"
}
```

#### Key-Value Store

The annotated image with bounding boxes is saved to the key-value store with a unique timestamped key. Access it via the `annotatedImageKey` from the dataset output.

### Use Cases

- **E-commerce** — Detect products in user-uploaded images
- **Content moderation** — Find specific objects in photos
- **Inventory management** — Count and locate items in warehouse images
- **Wildlife monitoring** — Detect animals in camera trap images
- **Quality control** — Identify defects or specific components in manufacturing images

### Integrations

Connect this Actor with other tools using [Apify integrations](https://apify.com/integrations):

- Trigger detection from Zapier, Make, or n8n workflows
- Store results in Google Sheets, Airtable, or databases
- Send notifications when specific objects are detected

# Actor input Schema

## `imageUrl` (type: `string`):

URL of the image to analyze for object detection

## `categories` (type: `array`):

List of object categories to detect in the image (e.g. \['cat', 'dog'])

## Actor input object example

```json
{
  "imageUrl": "https://media.hswstatic.com/eyJidWNrZXQiOiJjb250ZW50Lmhzd3N0YXRpYy5jb20iLCJrZXkiOiJnaWZcL3NodXR0ZXJzdG9jay0yMjc4Nzc2MTg3LWhlcm8uanBnIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjo4Mjh9fX0=",
  "categories": [
    "cat"
  ]
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "imageUrl": "https://media.hswstatic.com/eyJidWNrZXQiOiJjb250ZW50Lmhzd3N0YXRpYy5jb20iLCJrZXkiOiJnaWZcL3NodXR0ZXJzdG9jay0yMjc4Nzc2MTg3LWhlcm8uanBnIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjo4Mjh9fX0=",
    "categories": [
        "cat"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("geneius/image-detection").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "imageUrl": "https://media.hswstatic.com/eyJidWNrZXQiOiJjb250ZW50Lmhzd3N0YXRpYy5jb20iLCJrZXkiOiJnaWZcL3NodXR0ZXJzdG9jay0yMjc4Nzc2MTg3LWhlcm8uanBnIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjo4Mjh9fX0=",
    "categories": ["cat"],
}

# Run the Actor and wait for it to finish
run = client.actor("geneius/image-detection").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "imageUrl": "https://media.hswstatic.com/eyJidWNrZXQiOiJjb250ZW50Lmhzd3N0YXRpYy5jb20iLCJrZXkiOiJnaWZcL3NodXR0ZXJzdG9jay0yMjc4Nzc2MTg3LWhlcm8uanBnIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjo4Mjh9fX0=",
  "categories": [
    "cat"
  ]
}' |
apify call geneius/image-detection --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,geneius/image-detection"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/fBsqX5e8ai5l9FQfV/builds/NpQ452H6UObjWYYPs/openapi.json
