# 3D-MOOD
3D-MOOD predicts three-dimensional boxes from a single image.
Tasks: 3D detection. Install: pip install "libreyolo[hf]".
Verified against LibreYOLO v1.6.0.

## Install

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

## Predict

**Python**

```python
from libreyolo import Libre3DMOOD, SAMPLE_IMAGE
import numpy as np
from PIL import Image

# Requires the separately installed upstream runtime.
model = Libre3DMOOD(device="cpu")
# Rough 3x3 pinhole guess; replace with measured calibration for the original image.
w, h = Image.open(SAMPLE_IMAGE).size
intrinsics = np.array([[w, 0, w / 2], [0, w, h / 2], [0, 0, 1]], dtype=np.float32)
result = model.predict(SAMPLE_IMAGE, intrinsics=intrinsics, text="person")
print(result.boxes3d)
```

3D-MOOD performs open-set detection using text labels and original-image camera intrinsics. Install its separate upstream runtime and provide `runtime_path` and `runtime_python` when needed.

`result.boxes3d` holds centers, dimensions and wxyz quaternions in camera coordinates, plus confidence, class and intrinsics. Plotting projects cuboids into the image. Training, validation, tracking and export are not supported. See [3D detection](/docs/tasks/3d-object-detection).

## 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: 3D-MOOD, ETH Zurich, Computer Vision and Geometry Lab
- Upstream license: Apache-2.0
- Upstream source: https://github.com/cvg/3D-MOOD
- LibreYOLO code: MIT
- Weights: Apache-2.0, republished at https://huggingface.co/LibreYOLO
- Interpretation: The source and model publisher declare Apache-2.0.

## Citation

```bibtex
@InProceedings{Yang_2025_ICCV,
    author    = {Yang, Yung-Hsu and Piccinelli, Luigi and Segu, Mattia and Li, Siyuan and Huang, Rui and Fu, Yuqian and Pollefeys, Marc and Blum, Hermann and Bauer, Zuria},
    title     = {3D-MOOD: Lifting 2D to 3D for Monocular Open-Set Object Detection},
    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
    month     = {October},
    year      = {2025},
    pages     = {7429-7439}
}
```

Copied from https://raw.githubusercontent.com/cvg/3D-MOOD/main/README.md
