Skip to content

Code and Description of STAMP Software

Notifications You must be signed in to change notification settings

daytoy01/STAMP-software

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STAMP Software

Beijing Normal University, CHEN-Lab

Contributors: Shuaijun Liu, Dong Qi, Xuehong Chen, Xiuchun Dong, Ping Huang, Peng Yang, Jin Chen

Resources: [[Academic Paper]] [[Demo]]

Overview

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.

Installation and Requirements

System Requirements

  • Python 3.8+
  • PyTorch 1.7.0+
  • CUDA 11.0+ (Recommended)

Installation Instructions

STAMP can be easily installed via pip or by cloning the repository.

Additional Dependencies

For mask post-processing and running example notebooks, additional packages are required.

Prerequisites

Installation

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

Getting Started with STAMP

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.

Demonstrations

Software Demo

Explore the STAMP one-page app for intuitive mask prediction. Detailed instructions are available in STAMPWindow.md.

Demo Steps

  1. Start the Demo: Double-click 'STAMP.exe'.

  2. Select and Open Image.

  3. Import or Auto-Select Processing Area.

  4. Extract Missing PFs (manually or automatically).

FieldSeg-DA Integration

Combining STAMP with FieldSeg-DA for enhanced accuracy:

Model Selection

STAMP offers three model versions to cater to different time constraints:

License and Citation

License

STAMP is licensed under beta 3.0.2.

How to Cite

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}
}

About

Code and Description of STAMP Software

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 89.5%
  • Jupyter Notebook 9.6%
  • Shell 0.6%
  • JavaScript 0.2%
  • Dockerfile 0.1%
  • Batchfile 0.0%