Transformers
Safetensors
vision-encoder-decoder
plant-architecture
dinov2
gpt2
cowpea
3d-reconstruction
helios
Instructions to use heesup/dinov2-base_448_RGB_Sideview_gpt2-medium with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use heesup/dinov2-base_448_RGB_Sideview_gpt2-medium with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("heesup/dinov2-base_448_RGB_Sideview_gpt2-medium") model = AutoModel.from_pretrained("heesup/dinov2-base_448_RGB_Sideview_gpt2-medium", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from heesup/dinov2-base_448_RGB_Sideview_gpt2-medium: direct link, hf CLI and curl.
- Browser
- Download file 3.67 kB
-
https://huggingface.co/heesup/dinov2-base_448_RGB_Sideview_gpt2-medium/resolve/main/README.md
- Command line
-
hf download hf://heesup/dinov2-base_448_RGB_Sideview_gpt2-medium/README.md
-
curl -L -o README.md https://huggingface.co/heesup/dinov2-base_448_RGB_Sideview_gpt2-medium/resolve/main/README.md
3.67 kB
metadata
license: mit
library_name: transformers
datasets:
- heesup/Cowpea-Architecture-XML
tags:
- plant-architecture
- vision-encoder-decoder
- dinov2
- gpt2
- cowpea
- 3d-reconstruction
- helios
Image2PlantArchitecture: DINOv2-Base (448x448, Multi-View RGB) + GPT-2-Medium
This is the best-performing checkpoint from the paper "A vision language model for generating XML-based organ-level plant architecture representations of cowpea from simulated images" (Frontiers in Artificial Intelligence, 2026).
Model Details
- Vision Encoder:
facebook/dinov2-base(ViT-B, frozen during training) - Text Decoder:
gpt2-medium(with cross-attention) - Input Resolution:
448 x 448RGB - View Configuration: Multi-view (top-down + 3 side views)
- Training Dataset: heesup/Cowpea-Architecture-XML (train plots
0000–7999, val plots8000–8999, seed42)
Evaluation Results (4,000 Test Samples, Plots 9000–9099)
| Metric | Score |
|---|---|
| BLEU-4 | 94.00% |
| ROUGE-L | 0.5182 |
| Leaf Area MAPE | 3.2% |
| Leaf Count MAPE | 4.1% |
Usage
See the GitHub repository for the custom PlantArchitectureModel class and tokenizer/XML conversion utilities:
import torch
from models.model import PlantArchitectureModel
from src.plant_tokenizer import token2vec, SOS_TOKEN, EOS_TOKEN, PAD_TOKEN
from src.string_to_xml_to_vec import vec2xml
from src.linked_xml_to_recursive_xml import recursive_to_linked, pretty_print_xml
checkpoint_path = "heesup/dinov2-base_448_RGB_Sideview_gpt2-medium"
model = PlantArchitectureModel.from_pretrained(checkpoint_path, torch_dtype=torch.float16).to("cuda")
model.eval()
with torch.no_grad():
with torch.cuda.amp.autocast():
result = model.generate(
pixel_values,
decoder_start_token_id=SOS_TOKEN,
decoder_input_ids=plant_info,
eos_token_id=EOS_TOKEN,
pad_token_id=PAD_TOKEN,
max_length=4096 * 2,
repetition_penalty=1.1,
use_cache=True,
)
result_tokens = result.squeeze().cpu().numpy()[6:]
plant_vec = token2vec(result_tokens)
plant_xml = recursive_to_linked(vec2xml(plant_vec))
plant_xml_str = pretty_print_xml(plant_xml)
Citation
@article{yun2026vision,
title={A vision language model for generating XML-based organ-level plant architecture representations of cowpea from simulated images},
author={Yun, Heesup and Uyehara, Isaac Kazuo and Droutsas, Ioannis and Ranario, Earl and Diepenbrock, Christine H. and Bailey, Brian N. and Earles, J. Mason},
journal={Frontiers in Artificial Intelligence},
volume={9},
pages={1844338},
year={2026},
doi={10.3389/frai.2026.1844338},
url={https://www.frontiersin.org/journals/artificial-intelligence/articles/10.3389/frai.2026.1844338/full}
}