Beijing Normal University, CHEN-Lab
Contributors: Shuaijun Liu, Dong Qi, Xuehong Chen, Xiuchun Dong, Ping Huang, Peng Yang, Jin Chen
Resources: [[
Academic Paper
]] [[Demo
]]
STAMP (Segment Anything Model for Planted Fields) is an adaptive model designed for segmentation of planted fields from remote sensing imagery. Building upon the 'Segment Anything Model', it boasts enhanced zero-shot performance in remote sensing image analysis.
- Python 3.8+
- PyTorch 1.7.0+
- CUDA 11.0+ (Recommended)
STAMP can be easily installed via pip or by cloning the repository.
For mask post-processing and running example notebooks, additional packages are required.
- numpy 1.24.3
- torchvision 0.8+
- GDAL, OpenCV
- Albumentations 1.3.1+
The code requires python>=3.8
, as well as pytorch>=1.7
and torchvision>=0.8
. Please follow the instructions here to install both PyTorch and TorchVision dependencies. Installing both PyTorch and TorchVision with CUDA support is strongly recommended.
Install STAMP:
pip install STAMP.git
or clone the repository locally and install with
git clone [email protected]:STAMPg.git
cd STAMP; pip install -e .
The following optional dependencies are necessary for mask post-processing,jupyter
is also required to run the example notebooks.
pip install opencv-python pycocotools matplotlib onnxruntime onnx
First download STAMP. Then the model can be used in just a few lines to get masks:
from STAMP import auotSTAMP
stamp = auotSTAMP["<model_type>"]
predictor = stamp(pic)
predictor.set_image(<your_image>)
masks, _, _ = predictor.predict(<input_prompts>)
or generate masks for an entire image:
from STAMP import STAMPWindow
stampWindow = STAMPWindow()
mask_generator = stampWindow(your_image)
masks = mask_generator.generate(your_image)
For detailed examples, see our notebooks.
Explore the STAMP
one-page app for intuitive mask prediction. Detailed instructions are available in STAMPWindow.md
.
-
Start the Demo: Double-click 'STAMP.exe'.
-
Select and Open Image.
-
Import or Auto-Select Processing Area.
-
Extract Missing PFs (manually or automatically).
Combining STAMP with FieldSeg-DA for enhanced accuracy:
STAMP offers three model versions to cater to different time constraints:
STAMP is licensed under beta 3.0.2.
If you use STAMP or FieldSeg-DA in your research, please use the following BibTeX entry.
@article{kirillov2023stamp,
title={STAMP},
author={Liu Shuaijun, Dong Qi, Dong Chunxiu, Huang Ping, Yang Peng, Chen Xuehong, Chen Jin},
journal={arXiv:####},
year={2023}
}
@article{liu2022deep,
title={A deep learning method for individual arable field (IAF) extraction with cross-domain adversarial capability},
author={Liu, Shuaijun and Liu, Licong and Xu, Fei and Chen, Jin and Yuan, Yuhen and Chen, Xuehong},
journal={Computers and Electronics in Agriculture},
volume={203},
pages={107473},
year={2022},
publisher={Elsevier}
}