Skip to main content

Python Client for UnrealCV

PyPI version Python 3.7+

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('/Game/MetaHumans/Taro/BP_Taro.BP_Taro', 'SpawnedFromPath')
api.clear_world_annotation()

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

Documentation

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unrealcv-1.2.0.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unrealcv-1.2.0-py3-none-any.whl (32.7 kB view details)

Uploaded Python 3

File details

Details for the file unrealcv-1.2.0.tar.gz.

File metadata

  • Download URL: unrealcv-1.2.0.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for unrealcv-1.2.0.tar.gz
Algorithm Hash digest
SHA256 d4e11bde68d101f3464d27cb8fc79e704c646331f1cc7bb4221f4a64142391dc
MD5 ae1c11f812340fa5e16b2d357619daeb
BLAKE2b-256 ae8bd180d19097279eff8c78a631e2db26a920ae7314016898469f5eebffb1e6

See more details on using hashes here.

File details

Details for the file unrealcv-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: unrealcv-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 32.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for unrealcv-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 deff625acf92c957c27c2a881bebf5f3b261a8b14183858f31104fbcb8143f3e
MD5 3602655250491e5090757f0fffcb281d
BLAKE2b-256 96e294b2a29fe05d7f7f20cafbc7eb3ad6b350f39cb691e8f1237a16217c3e56

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 files

1.1.7

2 files

1.1.6

2 files

1.1.5

2 files

1.1.3

2 files

1.1.1

2 files

1.1.0

2 files

1.0.1

2 files

0.4.0

1 file

0.3.10

1 file

0.2

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page