# Marigold V2
Marigold V2 estimates depth, surface normals or intrinsic albedo with task-specific diffusion adapters.
Tasks: Depth, Surface normals, Albedo. Install: pip install "libreyolo[marigold]".
Verified against LibreYOLO v1.6.0.

## Install

```bash
pip install "libreyolo[marigold]"
```

The default four-bit runtime requires CUDA.

## Predict

**Python**

```python
from libreyolo import LibreYOLO, SAMPLE_IMAGE

# Requires CUDA for default four-bit inference.
model = LibreYOLO("LibreMarigoldV2b-depth.pt", device="cuda")
result = model(SAMPLE_IMAGE)
print(result)
```

The adapter downloads a separately pinned base model. Default `quantization="4bit"` requires CUDA; the snippet requires that runtime. `quantization="none"` selects the CPU-capable path. The default seed is 2025. Albedo results hold linear RGB and convert to sRGB for display. Training and export are not supported.


## Validate

**Python**

```python
from libreyolo import LibreYOLO, SAMPLE_IMAGE

# Requires CUDA for default four-bit inference.
model = LibreYOLO("LibreMarigoldV2b-depth.pt", device="cuda")
# Depth dataset YAML: images/val plus same-stem maps in depths/val.
metrics = model.val(data="path/to/your/depth.yaml", workers=0)
print(metrics)
```

Use the dataset format for this task. [Validation](/docs/train/validation) explains the dataset requirements and returned metrics.

## Checkpoints

| File | Input (px) | Task | Weights license |
| --- | --- | --- | --- |
| `LibreMarigoldV2b-depth.pt` |  | Depth | apache-2.0 |
| `LibreMarigoldV2b-depth-log-stage1.pt` |  | Depth | apache-2.0 |
| `LibreMarigoldV2b-depth-log-layered.pt` |  | Depth | apache-2.0 |
| `LibreMarigoldV2b-depth-uniform-base.pt` |  | Depth | apache-2.0 |
| `LibreMarigoldV2b-depth-uniform-layered.pt` |  | Depth | apache-2.0 |
| `LibreMarigoldV2b-depth-disparity-base.pt` |  | Depth | apache-2.0 |
| `LibreMarigoldV2b-depth-disparity-layered.pt` |  | Depth | apache-2.0 |
| `LibreMarigoldV2b-normal.pt` |  | Surface normals | apache-2.0 |
| `LibreMarigoldV2b-albedo.pt` |  | Albedo | apache-2.0 |

## Licensing

Check the license on the Hugging Face repository of the specific weights you download. That repository is authoritative and licenses are not always uniform across a family. This is a description of the licenses involved, not legal advice.

- Original work: Marigold V2, Huawei Bayer Lab
- Upstream license: Apache-2.0
- Upstream source: https://github.com/huawei-bayerlab/marigold-v2
- LibreYOLO code: MIT
- Weights: Apache-2.0, republished at https://huggingface.co/LibreYOLO
- Interpretation: The adapters and separately acquired Qwen image base declare Apache-2.0.
