{"id":18792527,"url":"https://github.com/prbonn/leaf-plant-instance-segmentation","last_synced_at":"2025-06-13T05:04:30.090Z","repository":{"id":100745545,"uuid":"416759031","full_name":"PRBonn/leaf-plant-instance-segmentation","owner":"PRBonn","description":"In-Field Phenotyping Based on Crop Leaf and Plant Instance Segmentation","archived":false,"fork":false,"pushed_at":"2023-07-14T10:03:37.000Z","size":27104,"stargazers_count":19,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-13T14:47:29.930Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PRBonn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-13T13:39:37.000Z","updated_at":"2025-03-21T18:29:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"f7b1abb1-0d83-441d-b946-c3b68cec135b","html_url":"https://github.com/PRBonn/leaf-plant-instance-segmentation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PRBonn/leaf-plant-instance-segmentation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRBonn%2Fleaf-plant-instance-segmentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRBonn%2Fleaf-plant-instance-segmentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRBonn%2Fleaf-plant-instance-segmentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRBonn%2Fleaf-plant-instance-segmentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PRBonn","download_url":"https://codeload.github.com/PRBonn/leaf-plant-instance-segmentation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRBonn%2Fleaf-plant-instance-segmentation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259584783,"owners_count":22880198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T21:20:21.300Z","updated_at":"2025-06-13T05:04:30.072Z","avatar_url":"https://github.com/PRBonn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# In-Field Phenotyping Based on Crop Leaf and Plant Instance Segmentation\n\nIn this codebase we present an approach to perform in-field phenotyping based on\ncrop leaf and plant instance segmentation. \n\n![Teaser](./static/teaser.png)\n\nWe propose a vision-based approach that performs instance segmentation of\nindividual crop leaves and associates each with its corresponding crop plant in\nreal fields.\n\nOur method is a bottom-up approach based on an end-to-end trainable\nconvolutional neural network~(CNN). We generate two different representations of\nthe input image that are eligible to cluster individual crop leaf and plant\ninstances within a predicted clustering region. \n\n![Network](./static/network.png)\n\n## Prerequisites\nCreate a virtual environment and install dependencies:\n```bash\nconda create -n venv python=3.7\nconda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch\nconda install matplotlib tqdm scikit-image pandas\nconda install -c conda-forge tensorboard\nconda install -c anaconda future\nconda install -c conda-forge opencv \nconda install -c conda-forge pycocotools\nconda install -c anaconda h5py\n```\n\n## Training\n\nFirst, start training the network: \n```bash\nexport DATASET_DIR=path/to/dataset\npython src/train.py\n```\n\nYou can set different training options in the file ```train_config.py```.\n\nSecond, to perform the automated postprocessing step to cluster individual crop leaf and plant instances:\n```bash\npython src/report.py\n```\n\nYou can set different postprocessing options in the file ```report_config.py```.\n\n## Test\n\nWe provide a model pretraind on our dataset and a minimal example to perform instance segmentation of crop leaves and plants.\n\nFirst, define the path to the provided dataset:\n```bash\nexport DATASET_DIR=./dataset-mini\n```\n\nSecond, make sure that the option ```only_eval``` in ```train_config.py``` is to ```True```\n\nThird, we provide the pretrained model at ```./src/exp/```. Please make sure that the ```resume_path``` option in ```train_config.py``` is set accordingly.\n\nYou can run the model as following:\n```bash\npython src/train.py\n```\nThis will save the model predicitions to disk at ```./logs```.\n\nFinally, run the automated postprocessing to cluster individual crop leaf and plant instances:\n```bash\npython src/report.py\n```\n\nPlease find a visualization of all predicitions in the directory ```./logs/reports```\n\n## License\n\nThis software is released under a [creative commons license](https://creativecommons.org/licenses/by-nc/4.0/legalcode) which allows for personal and research use only.\n\n## Attribution\n- This work is partially based on [Instance Segmentation by Jointly Optimizing Spatial Embeddings and Clustering Bandwidth](https://arxiv.org/pdf/1906.11109.pdf), used under [CC BY](https://creativecommons.org/licenses/by-nc/4.0/)\n- The authors are Davy Neven, Bert De Brabandere, Marc Proesmans, and Luc Van Gool (Dept. ESAT, Center for Processing Speech and Images KU Leuven)\n- [Source](https://github.com/davyneven/SpatialEmbeddings/blob/master/README.md) is licensed under CC BY-NC 4.0\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprbonn%2Fleaf-plant-instance-segmentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprbonn%2Fleaf-plant-instance-segmentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprbonn%2Fleaf-plant-instance-segmentation/lists"}