Demeter is a plant parametric models that is learned from 3D scans of real-world plants. It explicitly models the plant as a graph of stem and leaf.
Small processed 3D parametric plant examples are included in this repository.
The raw soybean mesh data can be found on DemeterData. It contains 607 unprocessed meshes for 3D generation and representation learning. These raw scans are neither aligned nor segmented.
Per-species arrays of fitted 3D leaf surfaces [n_leaf, 43, 45, 3] (hosted on
DemeterData) are
the samples used to fit sample_params/<species>/3d_leaf_pca.pth.
The complete processed dataset is hosted on
DemeterData as a
single archive. It contains all 78 soybean instances, the sample instances for
the other species, and their fitted parametric graphs and point-cloud
segmentations. Within each sample_params/<species>/instances/<sample>/
directory, raw/*.ply stores the per-organ segments in the original scan
coordinate frame;
Install the Hugging Face CLI with pip install -U huggingface_hub, then run the
following commands from the repository root to restore the complete processed
sample_params/ folder:
set -euo pipefail
REPO="TianhangCheng7/DemeterData"
ARCHIVE="sample_params.tar.gz"
hf download "$REPO" "$ARCHIVE" --repo-type dataset --local-dir .
tar -xzf "$ARCHIVE"
rm -f "$ARCHIVE"
echo "Done. Processed data restored under ./sample_params"- Linux
- Python 3.11
- CUDA 12.1
- Pytorch 2.5.0
Install PyTorch and other dependencies.
conda create -n demeter python=3.11 -y
conda activate demeter
pip install torch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 --index-url https://download.pytorch.org/whl/cu121
# basic dependencies for decoding
pip install -r requirements.txtInstall in editable mode
pip install -e .
for reconstruction from 3d point cloud (script_auto_reconstruction), a few extra dependencies (Point Transformer / Pointcept) are installed into this same demeter environment — no separate environment is needed; see script_auto_reconstruction/readme.md. We still recommend using manual annotation to create demeter parameters for now.
decode demeter parameter to 3d mesh of soybean
python decode.py --data_folder sample_params --sample_name 24_o --species soybean
python decode.py --data_folder sample_params --sample_name 08 --species ribes
python decode.py --data_folder sample_params --sample_name 10008da --species maize
python decode.py --data_folder sample_params --sample_name 1 --species tobacco
python decode.py --data_folder sample_params --sample_name 02 --species roseVisualize both the parametric mesh and the original segmented point cloud.
Download and extract the processed dataset above before running these examples.
With --show_segmentation_color, each organ segment receives a distinct color;
otherwise, the original RGB colors are used.
python viz_segmentation.py --sample_name 24_o --species soybean --data_folder sample_params --show_segmentation_color
python viz_segmentation.py --sample_name 08 --species ribes --data_folder sample_params
python viz_segmentation.py --sample_name 2_i --species soybean --data_folder sample_params Visualize every soybean in the instances folder:
python viz_segmentation.py --batch --species soybean --data_folder sample_params --instance_root instances-
(Optional): Fitting 2D leaf shape from images if you need other species script_process_leaf_contour/readme.md
-
(Optional): Fitting 3D leaf shape from aligned leaf mesh array. See script_fit_leaf_3d_pca/readme.md for downloading the data and (re)fitting / visualizing the 3D leaf PCA.
-
Step 1: Get point cloud Monocular RGB video -> Raw 3D point clouds
third_party/2d-gaussian-splatting/readme.md -
Step 2, Option A: manual annotate point clouds -> Demeter parameters
script_manual_annotation/readme.md -
Step 2, Option B: automatic multi-stage 3D point clouds -> Demeter parameters
script_auto_reconstruction/readme.md Note that this method is not accurate, so it's more recommanded to use manual segementation -
Step 2, Option C: automatic feed-forward one-pass 3D point clouds -> Demeter parameters
Working in progress. -
Others: raw 3D point clouds -> baseline L-system parameteres
third_party/CropCraft/readme.md
Please refer to Helios Tutorial for now.
- editing tutorial (TBD)
- full soybean 2d image dataset (2026-8-13)
- learning leaf shape PCA from 2D leaf scanns (2026-5-26)
- release 3D leaf deformation arrays for 3D leaf PCA training (2026-8-13)
- building demeter representation from your own annotated 3d point cloud (2026-4-24)
- full soybean 3d dataset (2025-12-17)
- sample data of other species (2025-11-1)
- sample data of soybean (2025-10-7)
- decoding (2025-10-7)
- reconstruction from 3d point cloud (2025-10-8)
- L-system baseline (2025-10-13)
This project is supported by NSF Awards #1847334 #2331878, #2340254, #2312102, #2414227, and #2404385. We greatly appreciate the NCSA for providing computing resources.
This code is released under the Academic Research License (Non-Commercial). For commercial inquiries, please contact shenlong@illinois.edu. For code issue and academic collaboration, please contact tcheng12@illinois.edu.

