Metadata-Version: 2.4
Name: UnrealCV
Version: 1.2.0
Summary: UnrealCV client for python. see http://unrealcv.org for more detail.
Author: Hai Ci, Kui Wu
Author-email: Weichao Qiu <qiuwch@gmail.com>, Fangwei Zhong <zfw1226@gmail.com>
License: MIT
Project-URL: Homepage, http://unrealcv.org
Project-URL: Documentation, http://unrealcv.github.io
Project-URL: Repository, https://github.com/unrealcv/unrealcv
Keywords: computer vision,unreal engine,ue4/5,synthetic,simulator,robotics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: docker
Requires-Dist: opencv-python
Requires-Dist: pillow
Requires-Dist: numpy
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: pre-commit>=3.7; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: ruff>=0.5; extra == "dev"

# Python Client for UnrealCV

[![PyPI version](https://badge.fury.io/py/unrealcv.svg)](https://pypi.org/project/unrealcv/)
[![Python 3.7+](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/)

This is the official Python client for [UnrealCV](https://unrealcv.org), a project to help computer vision researchers build virtual worlds using [Unreal Engine](https://www.unrealengine.com/).

## Installation

```bash
pip install unrealcv
```

## Quick Start

Launch a game with the UnrealCV plugin, then connect from Python:

```python
from unrealcv import client
client.connect()  # Connect to the game
if not client.isconnected():
    print('UnrealCV server is not running.')
else:
    # Capture an image
    filename = client.request('vget /camera/0/lit')
    print(f'Image saved to {filename}')

    # Get camera location
    location = client.request('vget /camera/0/location')
    print(f'Camera at: {location}')
```

## High-Level API

For more advanced usage (image processing, object manipulation, camera control), use the `UnrealCv_API` class:

```python
from unrealcv import UnrealCv_API

api = UnrealCv_API(port=9000, ip='127.0.0.1', resolution=(640, 480))

# Get an RGB image as a numpy array
image = api.get_image(0, 'lit')

# Get depth map
depth = api.get_depth(0)

# List all objects in the scene
objects = api.get_objects()
for obj in objects:
    location = api.get_obj_location(obj)
    print(f'{obj}: {location}')

# Annotation helpers and asset-path spawning
api.annotate_world()
spawned = api.spawn_object_from_path('/Game/MetaHumans/Taro/BP_Taro.BP_Taro', 'SpawnedFromPath')
api.clear_world_annotation()
```

> **Note:** The high-level API requires `opencv-python`, `numpy`, and `pillow`.

## Documentation

- [Full Documentation](https://docs.unrealcv.org)
- [Command Reference](https://docs.unrealcv.org/en/latest/reference/commands.html)
- [Getting Started Tutorial](https://unrealcv.github.io/tutorial/getting_started.html)

## Links

- [GitHub Repository](https://github.com/unrealcv/unrealcv)
- [UnrealZoo - Pre-built Binaries](http://unrealzoo.site/)
