Lifting API Reference
The lifting module exposes tasks that convert 2D image data into 3D representations — depth maps, point clouds, and meshes.
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, depth_trunc=5.0
),
)
result = DepthEstimation().run(cmd)
Source code in vizion3d/lifting/__init__.py
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 49 | |
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
39 40 41 42 43 44 45 46 47 48 49 | |
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
|
Model backend to use for inference.
|
return_depth_image |
bool
|
When |
return_point_cloud |
bool
|
When |
advanced_config |
DepthEstimationAdvanceConfig
|
Camera intrinsics and depth range settings. Override any
field to customise — e.g.
|
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.
vizion3d.lifting.models.DepthEstimationAdvanceConfig
Bases: BaseModel
Camera intrinsics and depth range settings for depth estimation.
All fields are optional overrides — unspecified fields retain their defaults, which match the Open3D PrimeSense preset (640×480 RGB-D sensor).
Attributes:
| Name | Type | Description |
|---|---|---|
fx |
float
|
Horizontal focal length in pixels. Controls the horizontal field of view: a larger value means a narrower FOV and more perspective compression. |
fy |
float
|
Vertical focal length in pixels. Usually equal to |
cx |
float
|
Principal point x — the pixel column of the optical axis, typically near the horizontal image centre. |
cy |
float
|
Principal point y — the pixel row of the optical axis, typically near the vertical image centre. |
depth_scale |
float
|
Divisor applied to raw uint16 depth values to convert them to
metres. |
depth_trunc |
float
|
Maximum depth in metres. Points beyond this distance are discarded from the point cloud. |
Source code in vizion3d/lifting/models.py
6 7 8 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 | |
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.
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 |
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
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 | |