Python Client for UnrealCV
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, andpillow.
Documentation
Links
Metadata
Release files for UnrealCV 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| unrealcv-1.3.0.tar.gz | 43.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| unrealcv-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 88.4 kB
Release files / unrealcv-1.3.0.tar.gz
| Download URL | unrealcv-1.3.0.tar.gz |
|---|---|
| Size | 43.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6bb1ff47ff60dbfbb7088a71e35af56e3012f4b4067ecb0bf30fd20741265acc
|
|
BLAKE2b-256 checksum How to use checksums |
ebfd230cc87cf94856252a42db9046b9ab91f4fdbcd267e25810de24453a2578
|
| 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.0-py3-none-any.whl
| Download URL | unrealcv-1.3.0-py3-none-any.whl |
|---|---|
| Size | 45.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1a0e14d535058dfd98791f0d3a3ae0d10fce8a5a1df240d79774e231131fbc3
|
|
BLAKE2b-256 checksum How to use checksums |
170a101abc3fca3d4f226db829cb53c749048cf936b92e8d548661d275f095ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|