Doodleverse / segmentation_zoo

A collection of geoscientific image segmentation models
MIT License
7 stars 3 forks source link

:package: Segmentation Zoo :elephant:

Last Commit Maintenance Wiki GitHub Wiki Python TensorFlow Keras

zoo

Hi! This is work in progress - please check back later or use our Discussions tab if you're interested in this project and would like to say hi. The models here should be considered beta, and could improve over time, or they may change in structure, so any usage of these models should be for practice with Segmentation Gym. Better documentation is forthcoming.

:star2: Highlights

✍️ Authors

Package maintainers:

Contributions:

We welcome collaboration! Please use our Discussions tab if you're interested in this project. We welcome user-contributed models trained using Segmentation Gym, but please wait for announcements while we get our act together, and meanwhile we'll be happy to chat about your data, models, science, art, and life in general in Discussions.

⬇️ Installation

If you already have the conda environment, gym, installed from Segmentation Gym, you may use that. Otherwise, we advise creating a new conda environment to run the program.

  1. Clone the repo:
git clone --depth 1 https://github.com/Doodleverse/segmentation_zoo.git

(--depth 1 means "give me only the present code, not the whole history of git commits" - this saves disk space, and time)

  1. Create a conda environment called zoo
conda create -n zoo python=3.9
conda activate zoo
conda install -c conda-forge "tqdm>=4.64.1" scipy numpy scikit-image jupyterlab joblib pandas plotly natsort matplotlib -y
pip install tensorflow doodleverse_utils==0.0.29 ipyfilechooser aiohttp
pip install tensorflow-gpu

If you get errors associated with loading the model weights you may need to:

pip install "h5py==2.10.0" --force-reinstall

and just ignore any errors.

Segmentation Zoo User Roles

  1. User of models
    • We anticipate that most Zoo users will simply want to use published models listed in the wiki, and adapt the example notebook workflows for their own purposes
  2. Contributor of models
    • We welcome contributions of Gym models! The basic steps (to be outlined in the wiki) involve a) making a new Zenodo release including your model wrights file, config file, and modelcard file; b) cloning the Zoo wiki and adding a page explaining the model's purpose; and c) issuing a pull request for review by Doodleverse HQ
  3. Contributor of implementation workflows
    • We welcome contributions of Gym model implementations! The basic steps (to be outlined in the wiki) involve a) cloning the Zoo repo and adding a notebook or script showing your workflow; and b) issuing a pull request for review by Doodleverse HQ

Example python script

To run the example script, change directory (cd) to the scripts directory and run the python script using

python select_model_and_batch_process_folder.py

You select a task, then a model, then select a folder of images to apply it to. It will write output files into a subfolder of the input imagery called 'out'

The set of available tasks.models are listed below, by theme and more details may be found on the Models pages of the wiki for satellite, aerial, and orthomosaic imagery

Task: satellite-derived shoreline location extraction

Task: masking water in aerial images

Task: generic classification of aerial images

Task: coastal landcover classification in Orthomosaic / NAIP (Seg2Map)

Task: generic landcover classification (Seg2Map)

Example notebook

To run the example notebooks, change directory (cd) to the notebooks directory and launch jupyter using

jupyter notebook

The menu of notebooks can be accessed in the browser at http://localhost:8888/tree

You should adapt the workflows shown in these notebooks to your own imagery

User guide

Check out our wiki for further instructions