We provide the first deep learning approach to learn the human viewpoint preference directly from annotated data. Moreover, we provide several designs to compute such metrics in a few milliseconds enabling its use in real-time applications.
See our video.
- 8th June 2022: Added links to our dataset and supplementary material.
- 10th January 2023: Added train and test code.
- March 2026: Dataset published on HuggingFace; codebase migrated to Lightning CLI.
The dataset is based on 3D models from ModelNet40 and is automatically downloaded from HuggingFace during training — no manual setup required.
- HuggingFace: kopetri/human_viewpoint_preferences
You can download our supplementary material here.
Option A — uv (recommended):
pip install uv
uv syncThen prefix every command below with uv run (handles the virtualenv automatically).
Option B — plain pip:
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install .Then replace uv run with python in every command in this README.
All training is driven by run.py using LightningCLI. Configs for both tasks are in configs/.
uv run run.py fit --config configs/score.yamluv run run.py fit --config configs/ranking.yamlOverride any config value on the command line, e.g.:
uv run run.py fit --config configs/score.yaml \
--trainer.max_epochs 100 \
--trainer.accelerator gpu \
--data.init_args.batch_size 32Checkpoints and metrics are saved to lightning_logs/version_<N>/.
Use the test subcommand with the same config and a checkpoint:
uv run run.py test --config configs/score.yaml \
--ckpt_path model.ckptuv run run.py test --config configs/ranking.yaml \
--ckpt_path model.ckptinfer.py loads a checkpoint directly and runs on individual images — no training infrastructure needed.
uv run infer.py score \
--ckpt score_model.ckpt \
--image imgs/viewpoint_a.jpg imgs/viewpoint_b.jpg imgs/viewpoint_c.jpgOutput:
viewpoint_a.jpg score = 0.5942
viewpoint_b.jpg score = 0.5839
viewpoint_c.jpg score = 0.7846
uv run infer.py rank \
--ckpt model.ckpt \
--image0 view_a.png \
--image1 view_b.pngOutput:
image0 : view_a.png
image1 : view_b.png
preferred : view_a.png (margin = 0.4624, p(image0) = 0.7312)
| Task | Checkpoint |
|---|---|
| Ranking | rank_model.ckpt |
| Scoring | score_model.ckpt |



