SASP is an end-to-end pipeline for strawberry canopy volume estimation from multi-view RGB images. The workflow combines PGSR reconstruction, SAGA-based 3D segmentation, YOLO-assisted object localization, automated color-based prompt selection, and concave-hull volume estimation with reference-box calibration to recover real-world canopy volume. This repository is structured as a clean, reproducible open-source package with a single CLI for all major stages.
Paper: https://www.sciencedirect.com/science/article/pii/S2772375525002503
multi-view image acquisition -> PGSR reconstruction -> SAGA training -> scene sampling -> YOLOv8 detection (plants + reference box) -> color-based auto prompt selection -> SAGA segmentation -> clustering -> concave hull volume -> reference box calibration -> final canopy volume outputs
src/sasp/: canonical Python package and pipeline implementationscripts/: thin command wrappersconfigs/: example YAML configuration filesdocs/: method details and troubleshootingtests/: lightweight CPU-only unit testsdata/: placeholder directories only (no real data committed)third_party/: preserved upstream/legacy code and licenses
- OS: Linux/macOS (tested on Linux)
- Python: 3.10+
- GPU/CUDA: required for full PGSR/SAGA training and large-scene inference; not required for CLI import/help and unit tests
git clone https://github.com/Sycamorers/SASP.git
cd SASP
pip install -e .Optional extras:
pip install -e .[volume] # alpha-shape volume dependencies
pip install -e .[vision] # YOLO-related dependenciesAll stages write to --out_dir (default under outputs/, which is gitignored).
python -m sasp reconstruct \
--legacy_root third_party/saga_pgsr \
--command "python train_PGSR.py --help" \
--out_dir outputs/reconstructpython -m sasp train_saga \
--legacy_root third_party/saga_pgsr \
--command "python train_contrastive_feature.py --help" \
--out_dir outputs/train_sagapython -m sasp detect \
--detections_file /path/to/yolo_detections.json \
--out_dir outputs/detectpython -m sasp segment \
--sample_points /path/to/scene_points.npy \
--out_dir outputs/segmentpython -m sasp cluster \
--segment_points outputs/segment/plant_segment_points.npy \
--radius 0.03 \
--min_points 50 \
--out_dir outputs/clusterpython -m sasp volume \
--plant_points outputs/segment/plant_segment_points.npy \
--box_points outputs/segment/reference_box_segment_points.npy \
--alpha 0.02 \
--reference_gt_volume_cm3 789.36 \
--out_dir outputs/volumepython -m sasp run_all --config configs/example_run_all.yaml --out_dir outputs/run_allImportant parameters that affect results:
- HSV thresholds for automatic prompt point selection (
plant_hsv,box_hsv) - Concave hull alpha parameter (
alpha) - Clustering radius and minimum cluster size (
radius,min_points) - Reference box ground-truth volume for calibration
- Image resolution/downsampling and camera-view coverage
Typical outputs by stage:
detect/detections.json: YOLO detections for plants and reference boxsegment/plant_segment_points.npy: segmented canopy pointssegment/reference_box_segment_points.npy: segmented reference box pointscluster/cluster_*.npy: clustered canopy componentsvolume/volume_results.jsonandvolume/volume_results.csv: calibrated canopy volume, scale factor, and metadatarun_all/run_all_manifest.json: stage output manifest
Please cite the SASP paper and include this repository citation metadata (CITATION.cff).
@article{huang2025sasp,
title={SASP: Segment any strawberry plant, an end-to-end strawberry canopy volume estimation},
author={Huang, Zijing and Lee, Won Suk and Zhang, Peigeng and Jeon, Hongyoung and Zhu, Heping},
journal={Smart Agricultural Technology},
volume={11},
pages={101017},
year={2025},
doi={10.1016/j.atech.2025.101017},
url={https://www.sciencedirect.com/science/article/pii/S2772375525002503}
}