Plot boundary extractor using segment anything model
Project description
plot-boundary-extractor module
This module is to extract field experiment plot boundary for agricultural applications.
Developed by Hansae Kim and Jinha Jung
plot-boundary-extractor installation
Set up a virtual environment
First, we need to install plot-boundary-extractor on the machine you would like to run this example tutorial. We will set up a new Python Virtual Environment called pbe.
$ conda create -n pbe -c conda-forge gdal python=3.10 -y
We need to activate the newly created virtual environment before proceeding.
$ conda activate pbe
Install plot-boundary-extractor module
Now we need to install plot-boundary-extractor module using pip.
$ pip install plot-boundary-extractor
Install torch
The plot-boundary-extractor module uses torch module, so we need to install it on the machine you would like to run this example tutorial.
CPU version
If your machine is not equipoped with NVIDIA GPU, then you will have to install the torch without GPU support.
$ pip install torch torchvision
GPU version
If your machine is equipped with NVIDIA GPU, then you will have to install the torch with GPU support.
$ pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
Install SAM
The plot-boundary-extractor uses SAM to detect plot boundary automatically, so you have to install SAM using the below command.
$ pip install git+https://github.com/facebookresearch/segment-anything.git
You also have to download a pre-trained model using the below command. Please make a note where you're downloading the pre-trained model. We will need this path information in the later tutorial.
$ wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth
Now the installation is done, and you're ready to extract plot boundaries using the plot-boundary-extractor module. An example Jupyter Notebook is available for your reference.
Citation
If you use this repository in your research, please cite the following paper:
Kim, H.S., Olaniyi, I., Chang, A., & Jung, J. (2025).
Developing a segment anything model-based framework for automated plot extraction.
Precision Agriculture, 26(3), 53. Springer.
@article{kim2025developing,
title={Developing a segment anything model-based framework for automated plot extraction},
author={Kim, Han Sae and Olaniyi, Ismail and Chang, Anjin and Jung, Jinha},
journal={Precision Agriculture},
volume={26},
number={3},
pages={53},
year={2025},
publisher={Springer}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plot_boundary_extractor-0.3.3.tar.gz.
File metadata
- Download URL: plot_boundary_extractor-0.3.3.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6259fdacc3265883009732e94c8f08d6cd63cc6764a7a0248afc1ad8f1020bd4
|
|
| MD5 |
d1cad4b27d2d493b4586fd4b277d2de4
|
|
| BLAKE2b-256 |
53093753ee3d77c400989f9026e98ef4102828f3418e3b1e049a8237d553f943
|
File details
Details for the file plot_boundary_extractor-0.3.3-py3-none-any.whl.
File metadata
- Download URL: plot_boundary_extractor-0.3.3-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b22fb5ce3c8eb0535ebb153b61de4429d5135553c31e00f842d9e3b5a7c6e19
|
|
| MD5 |
a392625efc18236a0f615f50ac4a5d98
|
|
| BLAKE2b-256 |
ae2738e5f7696023f213af472c49ef4d9d9f0bdd11e7b8a7cf8cff2129055b14
|