lm3_landmark_detector__yolo26x_pose_640
YOLO26x-pose model predicting a 31-keypoint leaf skeleton (mid15_pet5) on single-leaf crops from herbarium specimen sheets. Default landmark_detector model in LeafMachine3 >= 3.0.0.
LM3 metadata
| Field | Value |
|---|---|
| LM3 action | landmark_detector |
| LM3_default_model | true |
| LM3_version | 3.0.0 (minimum supported; later releases remain compatible) |
| Model key | yolo26x_pose_640 (training run yolo26x_pose_640_strict (iteration 2)) |
| Architecture | YOLO26x pose, end-to-end (NMS-free) |
| Base weights | yolo26x-pose.pt (Ultralytics, AGPL-3.0) |
| Input | leaf crop with a 10% white border on every side, 640 letterbox, RGB (see below) |
| Output | 1 box class leaf + 31 keypoints (x, y, conf), order below |
| Keypoints (31) | lamina_tip; apex_left, apex_center, apex_right; midvein_0 .. midvein_14; base_left, base_center, base_right; lamina_base; petiole_0 .. petiole_4, petiole_tip; width_left, width_right |
| flip_idx | [0, 3, 2, 1, 4..18, 21, 20, 19, 22..28, 30, 29] (left/right apex, base, width swap) |
| Trained | 2026-10-10 |
| Iteration | 2 |
Files
| Folder | File | Use |
|---|---|---|
pytorch/ | best.pt | Ultralytics, retraining |
onnx/ | model.onnx | LM3 default runtime (onnxruntime) |
torchscript/ | model.torchscript | libtorch |
openvino/ | model_openvino_model/ | Intel CPU/iGPU |
coreml/ | model.mlpackage/ | Apple devices |
docs/ | overlay_*.jpg | example overlays (see Examples) |
SHA-256 of every file is in manifest.json. Keypoint names, kpt_shape, and flip_idx are in manifest.json and training_metadata.json.
Input preprocessing (what the model sees)
Training images are single-leaf crops padded with a 10% white border per side; the box is the un-padded crop region (central 1/1.2 of the canvas) and keypoints are mapped into the padded frame. At inference the same 10% white pad must be added before the 640 letterbox, and keypoints mapped back by (p - 0.1) * 1.2 in normalized coordinates. Unpadded crops are not supported.
Training data
Dataset LM3_Landmarks_Pose, built 2026-07-23 from 23 Labelbox landmark projects (ontology: lamina tip/base, petiole tip, lobe tip, width, midvein trace, petiole trace, apex/base angle). 15,217 single-leaf crops, one leaf instance per image, deterministic 80/10/10 split (salt lm3landmarks). Polylines are resampled to the mid15_pet5 skeleton: midvein trace to 15 points, petiole trace to 5, apex and base angles to 3 points each, width to 2, oriented with keypoint 0 at the apex end. Images and labels are not distributed.
| Split | Images | Keypoint instances |
|---|---|---|
| train | 12,258 | 358,054 |
| val | 1,390 | 40,581 |
| test | 1,569 | 45,808 |
Training
300 epochs, no early stopping, cosine LR, batch auto, close_mosaic=150 (mosaic off for the final 50%), single_cls. Loss gains: box 2.0, cls 0.5, dfl 1.5, pose 20.0, kobj 2.0. Per-keypoint strictness: the 11 non-trace keypoints (lamina_tip, apex x3, base x3, lamina_base, petiole_tip, width x2) use OKS sigma 1/124 instead of 1/31 and 4x RLE weight; the 20 trace points keep 1/31. Augmentation: hsv 0.015/0.7/0.4, degrees 180, translate 0.1, scale 0.5, fliplr 0.5, mosaic 1.0.
Evaluation
| Split | Box mAP50 | Box mAP50-95 | Pose mAP50 | Pose mAP50-95 | Pose P | Pose R |
|---|---|---|---|---|---|---|
| val | 0.995 | 0.878 | 0.773 | 0.448 | 0.863 | 0.862 |
| test | 0.995 | 0.878 | 0.763 | 0.433 | 0.853 | 0.853 |
Pose metrics use OKS with the uniform 1/31 sigma per keypoint. Evaluated with Ultralytics val on best.pt at 640 (evaluation_metrics.json).
Examples
LeafMachine3 Reporter overlays of this model's keypoints on plant_detector leaf crops (midvein and petiole traces, apex/base angle lines, width line) with the derived landmark_measurements. Full-size images are in docs/.
Use in LeafMachine3
Stage landmark_detector (depends on plant_detector). Runs on every Leaf_WHOLE crop (Leaf_PARTIAL optional) with the 10% white pad, ONNX export at 640, conf=0.25, iou=0.45; keypoints are mapped back to the crop and then to the specimen frame and stored per leaf. Downstream consumers: landmark_measurements (traces, lengths, apex/base angles), leaf_orientation, petiole_width, bilateral_symmetry, ect, metric_grounding, and the Reporter overlays.
from huggingface_hub import hf_hub_download
path = hf_hub_download("phyloforfun/lm3_landmark_detector__yolo26x_pose_640", "onnx/model.onnx")
Citation
Weaver, W. N. (2026) LeafMachine3. https://leafmachine.org