Lifting API Reference
The lifting module exposes tasks that convert 2D image data into 3D representations — depth maps, point clouds, and meshes.
All point clouds emitted by lifting tasks use OpenGL/viewer camera space: X+ right, Y+ up, and Z- forward into the scene.
DepthEstimation
The primary entry point for the depth estimation task. Instantiate once and call .run() with a DepthEstimationCommand.
vizion3d.lifting.DepthEstimation
Facade for the Depth Estimation task.
This class serves as the primary entry point for triggering monocular depth estimation inference via direct Python import.
Example
from vizion3d.lifting import (
DepthEstimation,
DepthEstimationAdvanceConfig,
DepthEstimationCommand,
)
cmd = DepthEstimationCommand(
image_input=b"...",
return_point_cloud=True,
advanced_config=DepthEstimationAdvanceConfig(
fx=615.0, fy=615.0, cx=320.0, cy=240.0
),
)
result = DepthEstimation().run(cmd)
Source code in vizion3d/lifting/__init__.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
run(command)
Dispatches the provided command through the CQRS bus to the registered handler.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
DepthEstimationCommand
|
The inference parameters and flags. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
DepthEstimationResult |
DepthEstimationResult
|
The resultant depth map and optional generated files. |
Source code in vizion3d/lifting/__init__.py
38 39 40 41 42 43 44 45 46 47 48 | |
DepthEstimationCommand
Input contract for the depth estimation task. All inference parameters are declared here.
vizion3d.lifting.commands.DepthEstimationCommand
dataclass
Bases: Command[DepthEstimationResult]
Command payload to trigger a depth estimation inference task.
Attributes:
| Name | Type | Description |
|---|---|---|
image_input |
str | bytes
|
The input image. Pass a file-path string or raw image bytes. The handler auto-detects which form is supplied. |
model_backend |
str
|
Depth Anything V2 checkpoint URL or local path. Defaults
to the vizion3D release checkpoint ( |
return_depth_image |
bool
|
When |
return_raw_depth |
bool
|
When |
return_point_cloud |
bool
|
When |
advanced_config |
DepthEstimationAdvanceConfig
|
Camera intrinsics for point cloud unprojection. All fields
auto-derive from image dimensions when left as |
Source code in vizion3d/lifting/commands.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
DepthEstimationAdvanceConfig
Camera intrinsics and depth range settings. Pass an instance of this model as advanced_config on DepthEstimationCommand to override the PrimeSense defaults used for point cloud unprojection. See Camera Intrinsics Matrix for a full explanation of fx, fy, cx, and cy.
vizion3d.lifting.models.DepthEstimationAdvanceConfig
Bases: BaseModel
Camera intrinsics for depth estimation.
All fields default to None, which causes the handler to auto-derive them
from the input image dimensions (fx = fy ≈ 0.85 × width for ~63° FOV;
cx/cy at image centre). Supply explicit values for real calibrated cameras.
Attributes:
| Name | Type | Description |
|---|---|---|
fx |
float | None
|
Horizontal focal length in pixels. |
fy |
float | None
|
Vertical focal length in pixels. |
cx |
float | None
|
Principal point x — the pixel column of the optical axis. |
cy |
float | None
|
Principal point y — the pixel row of the optical axis. |
Source code in vizion3d/lifting/models.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
DepthEstimationResult
Output contract returned by DepthEstimation.run(). All fields are always present; optional geometry fields are None when the corresponding return_* flag was not set. Returned point clouds use OpenGL/viewer camera space: X+ right, Y+ up, Z- forward.
vizion3d.lifting.models.DepthEstimationResult
Bases: BaseModel
Result payload returned after a depth estimation inference task.
Attributes:
| Name | Type | Description |
|---|---|---|
depth_map |
list[list[float]]
|
Raw floating-point depth array, shape |
min_depth |
float
|
Minimum value in |
max_depth |
float
|
Maximum value in |
backend_used |
str
|
Resolved model identifier that processed the request (local file path). |
depth_image |
Image | None
|
16-bit grayscale |
raw_depth |
ndarray | None
|
Raw float32 depth array, shape |
point_cloud |
PointCloud | None
|
Coloured |
point_cloud_scale |
float
|
Scale factor for the point cloud coordinate space.
Multiply any distance measured between two points in the returned
point cloud by this value to get the equivalent distance in metres.
Always |
Source code in vizion3d/lifting/models.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |