model
model
#
Model — a learned depth model as a value: the driver that runs it and the weights it loads.
- Driver. A
Driveris the capturegraph-free script itself, a file hashed by its bytes, so editing it invalidates every prediction it made. - Weights.
Weightsnames a Hugging Face repository at one commit, which is how the weights are content-addressed without hashing gigabytes;snapshotdownloads them into the scratch. - Model. The two together are the
Modela page passes topredictandmultiview; the built-inDA3_LARGEandPI3Xare values like any a user constructs.
DA3_LARGE = Model(driver=(Driver(DRIVERS / 'depth_anything_3.py')), weights=(Weights(repo_id='depth-anything/DA3-LARGE', revision='c54c26b16ec04d218e8d584ecf4bce082a9fcc20')))
module-attribute
#
Depth Anything 3, large: monocular and multi-view.
PI3X = Model(driver=(Driver(DRIVERS / 'pi3.py')), weights=(Weights(repo_id='yyfz233/Pi3X', revision='bb1deea4d7423de5b30691739cb451a3f57dc1d5')))
module-attribute
#
Pi3X: multi-view, run one image at a time when monocular.
Driver
#
Bases: FileScalar
A depth driver script, honouring the cgr.depth contract, hashed by its bytes.
Analysis-only: code, never captured, so it has no platform mirror and no place in a schema.
Source code in capturegraph-recipes/capturegraph_recipes/depth/models/model.py
Model
#
Bases: Struct
A learned depth model: its driver and its weights.
mine = cgr.depth.Model(
driver=cgr.depth.Driver("my_driver.py"),
weights=cgr.depth.Weights(repo_id="me/my-weights", revision="0123abcd…"),
)
Source code in capturegraph-recipes/capturegraph_recipes/depth/models/model.py
Weights
#
Bases: JSONScalar
A Hugging Face repository at one commit.
revision is a full commit hash, never a branch name: it is what
identifies the weights everywhere they are cached, and a floating
"main" would name the snapshot first downloaded forever.
Attributes:
| Name | Type | Description |
|---|---|---|
repo_id |
str
|
The repository, |
revision |
str
|
The 40-hex commit hash of the weights. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in capturegraph-recipes/capturegraph_recipes/depth/models/model.py
__post_init__()
#
Reject a repository that is not owner/name or a revision that is not a commit.