# gizai/tasks/object

the 3D task. A model family that makes 3D Gaussians of a picture of an object, or of a video through a place, gives a Sculptor (gizai/family's `object`): its GPU, and `make`, which makes the Gaussians as a 3DGS PLY file. `giz ai object`, a worker (objectService: operation object.generate) and a program use every such model so.

```gizlang
import * as Object from "gizai/tasks/object";
```

## Types

### `ObjectAsk`

```gizlang
type ObjectAsk = { picture: bytes; video: string; photo: bool; steps: i64; seed: i64; gaussians: i64; full: bool; }
```

What is asked of a 3D model: the picture (a JPEG, PNG or WebP file's bytes; its alpha, when it has one, is the
object's outline) or, for a model of places, the path of a video file that moves through one (""; none), whether
the picture is a photograph (a looser crop) and not a render of one object, and the steps, the noise's seed and the
Gaussians, each 0 for the model's own. `full`: the model's full sampling, not its fast distilled one (a model
without one has only the full).

- `picture`: `bytes`
- `video`: `string`
- `photo`: `bool`
- `steps`: `i64`
- `seed`: `i64`
- `gaussians`: `i64`
- `full`: `bool`

### `Sculptor`

```gizlang
type Sculptor = { gpu: Gpu; make: (ask: ObjectAsk, progress: (stage: string, step: i64, total: i64) => bool) => bytes throws string; }
```

What a family gives: the card it loaded on, and `make`, which returns the PLY of ASK. `progress` hears the stage,
the step done and the steps; false from it stops the work.

- `gpu`: `M7.Gpu`
- `make`: `(ask: M80.ObjectAsk, progress: (stage: string, step: i64, total: i64) => bool) => bytes throws string`

## Functions

### `objectService`

```gizlang
function objectService(name: string, load: (gpu: Gpu) => Sculptor throws string, capacity: i64 = 4): Hosting.Service
```

The service of object model `name` as giz's inference worker: operation object.generate, `capacity` jobs held;
`load` makes the model on the host's GPU. A job's input: `image` (an uploaded picture) or `video` (an uploaded video),
and optionally `photo`, `steps`, `seed`, `gaussians` and `full` (ObjectAsk); its result is object.ply.

Effects: fail, read, write, console, io, alloc.

