Skip to main content

Python Client for UnrealCV

PyPI version Python 3.9+

This is the official Python client for UnrealCV, a project to help computer vision researchers build virtual worlds using Unreal Engine.

Installation

pip install unrealcv

Quick Start

Launch a game with the UnrealCV plugin, then connect from 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:

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('/Engine/BasicShapes/Cube.Cube', 'SpawnedFromPath')
api.clear_world_annotation()

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

Documentation

Metadata

Release files for UnrealCV 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for UnrealCV 1.3.1
File Size Uploaded
unrealcv-1.3.1.tar.gz 49.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for UnrealCV 1.3.1
File Interpreter ABI Platform
unrealcv-1.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 101.6 kB

Release files / unrealcv-1.3.1.tar.gz

Download URL unrealcv-1.3.1.tar.gz
Size 49.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c166a5d372f64088dd9cd19b395d1f5657e21c409a85fd481641aebc315a365c
BLAKE2b-256 checksum
How to use checksums
c66516756049dc62cba118d03504b79fc51787f314164be7550f84210dfe9166
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / unrealcv-1.3.1-py3-none-any.whl

Download URL unrealcv-1.3.1-py3-none-any.whl
Size 52.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b57e89cb846db2b053c9a388b5ab683fef343ac67e15c0cdf996abde47ade18
BLAKE2b-256 checksum
How to use checksums
94ebe08742ce942da3afe90e5986fc8b97c5605da7aeb91bf841965f69b2ede2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

1.3.2

2 release files

This release

1.3.1 This release

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.3

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

0.4.0

1 release file

0.3.10

1 release file

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page