> For the complete documentation index, see [llms.txt](https://docs.eyepop.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eyepop.ai/sdks/python.md). Agents can also search and read this documentation through its [MCP server](https://docs.eyepop.ai/~gitbook/mcp).

# Python

Call EyePop from Python

The EyePop Python SDK calls the inference and data APIs from Python. Install it, set an API key, and run a Pop against an image, video, or stream.

```shell
pip install eyepop
```

Requires Python 3.12 or newer.

### Your first prediction

```python
from eyepop import EyePopSdk
from eyepop.worker.worker_types import InferenceComponent, Pop

pop = Pop(components=[
    InferenceComponent(ability="eyepop.person:latest")
])

with EyePopSdk.sync_worker(pop=pop) as endpoint:
    result = endpoint.upload("photo.jpg").predict()
    print(result)
```

`upload()` queues the file and `predict()` blocks until the result is ready. A single image yields one prediction; a video or multi-frame container yields one per frame, so call `predict()` in a loop until it returns `None`.

Pass the Pop when you open the session so EyePop can schedule the right compute before any media is processed.

To run on your own hardware instead of EyePop's cloud, point the SDK at an [on-premise instance](https://docs.eyepop.ai/developer-documentation/cli/on-premise) with **local mode**, `is_local_mode=True`. See [Local mode](https://docs.eyepop.ai/sdks/python/configuration.md#local-mode).

### Next steps

* [Configuration](https://docs.eyepop.ai/sdks/python/configuration.md) — credentials and environment variables
* [Running Inference](https://docs.eyepop.ai/sdks/python/inference.md) — files, streams, URLs, video, and image groups
* [Composable Pops](https://docs.eyepop.ai/sdks/python/composable-pops.md) — chain models into a pipeline
* [Data Endpoint](https://docs.eyepop.ai/sdks/python/data-endpoint.md) — datasets, VLM inference, and evaluation


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.eyepop.ai/sdks/python.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
