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.2

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.2
File Size Uploaded
unrealcv-1.3.2.tar.gz 49.6 kB Details

Built distribution (wheel)

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

Total release size: 101.8 kB

Release files / unrealcv-1.3.2.tar.gz

Download URL unrealcv-1.3.2.tar.gz
Size 49.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fb6eacfd0bd6a19a14c8695770960ce9ddc76a8dd7aa696b557601aeeb345ad2
BLAKE2b-256 checksum
How to use checksums
31cbf52971b2750e1df4e810a4980ce00ba81b3bd51516939cf52e4776f3e1eb
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.2-py3-none-any.whl

Download URL unrealcv-1.3.2-py3-none-any.whl
Size 52.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f41c8942d2ebfd6c2e619632792f267ff937ed823a6946fbb71f322d4a78d637
BLAKE2b-256 checksum
How to use checksums
d7b46b0b4b77aeae30522c19bbabf1a9eda36cceec01fda4e749032ac88d4310
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

This release

1.3.2 This release

2 release files

1.3.1

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