Skip to main content

FrontVeg V2: Foreground-Aware Zero-Shot Plant Trait Segmentation in Trellised Crops

Abdoul Djalil Ousseini Hamza (ORCID), Herearii Metuarea (ORCID), Corentin Lothodé (ORCID), Morgane Roth (ORCID), Eric Duchêne (ORCID), Lionel Ley, David Alletru (ORCID), and David Rousseau* (ORCID)

* Project Supervisor

FrontVeg V2 Logo

napari hub Python 3.10+ PyTorch License: BSD 3-Clause

FrontVeg V2

A napari plugin for automated plant organ segmentation and leaf area estimation in trellised crops using side view monocular RGB images.

Here are some examples of organ segmentation on different trellised crops:

FrontVeg V2 Segmentation Examples Grid


Prerequisites

  1. Create a virtual environment

    conda create -n <env_name> python=3.10 -y
    conda activate <env_name>
    pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
    
  2. Request SAM3 Weights Access: Request access to the SAM3 checkpoint on Hugging Face. Once approved, download sam3.pt.

  3. Download Depth-Anything V2 Weights: Download the Large model checkpoint (depth_anything_v2_vitl.pth) from the official Depth-Anything V2 repository.

  4. Place your downloaded checkpoints inside the project folder:

    • Place sam3.pt into: checkpoints/sam3_ckpts/sam3.pt
    • Place depth checkpoints into: checkpoints/depthanything_ckpts/

Installation

Option 1: Recommended (Git Clone + Editable Install)

This option automatically sets up the relative paths for external/ submodules and checkpoints/.

# 1. Clone the repository 
git clone https://github.com/djaliloh/FrontVegV2.git
cd FrontVegV2

# 2. Clone and install external models in the external/ folder:
cd external

# Depth-Anything V2
git clone https://github.com/DepthAnything/Depth-Anything-V2.git

# SAM3
git clone https://github.com/facebookresearch/sam3.git
cd sam3
pip install -e .
cd ../..

# 3. Install in editable mode 
pip install -e .

Option 2: Direct PyPI Install (Coming Soon)

ℹ️ Note: Standalone installation via pip install will be released soon. In the meantime, please follow Option 1 to use the plugin.

Usage in Napari

  1. Launch Napari: napari
  2. Open an RGB image of a row crop.
  3. Select Plugins > FrontVeg V2 Studio.
  4. Set your prompt (e.g., "leaf") and adjust parameters (Tile Overlap, Sigma, etc.).
  5. Click Run Complete Pipeline.

Acknowledgements

This work was supported by the French Programme et Équipements Prioritaires de Recherche (PEPR) AgroEcoNum (pepr-agroeconum.fr), the France 2030 program through the Agence Nationale de la Recherche (ANR), and the European Union’s Horizon Europe research and innovation programme (Grant No. 101094587, PHENET).

This research used computing resources from the GLiCID Computing Facility (Ligerien Group for Intensive Distributed Computing, doi:10.60487/glicid, Pays de la Loire, France), as well as HPC and storage resources provided by GENCI at IDRIS on the Jean Zay supercomputer’s H100 partition (Grant 2025-AD010115553R1).

The authors would like to thank Sirine Gharbi, Oumaima Karia, Justin Langlois, Paul, and Thomas for their valuable assistance in annotating the image dataset used in this study.

Contact

Imhorphen team, bioimaging research group,
IRHS, UMR 1345, INRAE,
42 Rue Georges Morel, 49070 Beaucouzé, France

Troubleshooting

  • Missing Module 'triton': On Windows, install the Windows-compatible Triton build: pip install triton-windows.
  • RuntimeError: mat1 and mat2 must have the same dtype: If running on GPUs older than NVIDIA Ampere (e.g., GTX 10xx, RTX 20xx), ensure autocast is set to float16 or float32 instead of bfloat16.
  • Missing Checkpoints Error: Verify that sam3.pt exists at the expected path or set FRONTVEG_SAM3_CKPT manually.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frontvegv2-0.1.3.tar.gz (32.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

frontvegv2-0.1.3-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file frontvegv2-0.1.3.tar.gz.

File metadata

  • Download URL: frontvegv2-0.1.3.tar.gz
  • Upload date:
  • Size: 32.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.20

File hashes

Hashes for frontvegv2-0.1.3.tar.gz
Algorithm Hash digest
SHA256 27b8e6ed97c640b4c792eb53dca2687160907ea8826a7ebef6a9c046552183ad
MD5 0b25e52483928bf1d3a1b2db8b63e940
BLAKE2b-256 bf292cdc1dc5a2545191e3eb5a6c3607eb9cce99e8cad323429f7a32f8c7ae49

See more details on using hashes here.

File details

Details for the file frontvegv2-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: frontvegv2-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.20

File hashes

Hashes for frontvegv2-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e1f6a6ca269fe042d8019bb56649831377461a8077b21a1a12cbf0f745a68bb7
MD5 c7d001520bd70226d71e5345be13e1c8
BLAKE2b-256 d00f44fd848ba5c686ce8efdc81c2c91e4ceb72aa91d894bcbcbd34623423b77

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.5

2 files

0.1.4

2 files

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page