train
train
#
train — a splat from posed images, on the GPU one call at a time.
- Toolchain. The trainer runs in the interpreter
CG_GPU_PYTHONnames (else the onens-trainon the path belongs to): torch, gsplat and nerfstudio live there, never in the library's own environment. - Lock. The whole run holds
cg.lock("gpu"), so calls from every page worker, process and script on the machine train one after another and a waiting call says so in its progress. - Progress. The driver writes
progress.jsonas it trains; a watcher thread reads it into aTrainingstep, so the count, loss and gaussian count reach a page or terminal while the run is live.
GPU_PYTHON_ENV = 'CG_GPU_PYTHON'
module-attribute
#
Names the interpreter holding torch, gsplat and nerfstudio.
gpu_python()
#
The interpreter the trainer runs in.
Raises:
| Type | Description |
|---|---|
RecipeError
|
If |
Source code in capturegraph-lib/capturegraph/recipes/splats/train.py
train(frames, seed, iterations=15000, optimize_cameras=False)
#
A 3D Gaussian splat trained on frames from seed with nerfstudio's splatfacto.
frames = cg.splats.scene_dataset(session.capture)
splat = cg.splats.train(frames, cg.splats.seed(frames))
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frames
|
Array[PosedImage]
|
The posed images to fit. |
required |
seed
|
PointCloud
|
The coloured points the gaussians start from. |
required |
iterations
|
int
|
How many optimizer steps to run. |
15000
|
optimize_cameras
|
bool
|
Whether to refine the camera poses while training, for poses a sensor estimated rather than a tracker. |
False
|
Raises:
| Type | Description |
|---|---|
RecipeError
|
If no GPU interpreter can be found. |
CalledProcessError
|
If training fails; the exception carries the tail of the trainer's log. |