Coder Social home page Coder Social logo

flipnslide's Introduction

Flip-n-Slide

Flip-n-Slide is a concise tiling and augmentation strategy to prepare large scientific images for use with GPU-enabled algorithms. flipnslide is a Python package that outputs PyTorch-ready preprocessed datasets from a single large image.

Documentation

The documentation for flipnside is available on Read the Docs.

Installation and Dependencies

For now, flipnslide can be installed from PyPI using pip, by running:

pip install flipnslide

Check back later for instructions on installing from conda forge.

Attribution

If you make use of this code, please cite the companion conference paper from ML4RS @ ICLR 2024 that initially presents the algorithmic methods behind this implementation:

@inproceedings{flipnslide,
  author       = {Ellianna Abrahams and
                  Tasha Snow and
                  Matthew R. Siegfried and
                  Fernando Pérez},
  title        = {A Concise Tiling Strategy for Preserving Spatial Context in Earth Observation Imagery},
  booktitle    = {Machine Learning for Remote Sensing Workshop {ML4RS} at The Twelfth International Conference 
                  on Learning Representations, {ICLR} 2024, Vienna, Austria, May 7-11, 2024},
  doi          = {10.48550/arXiv.2404.10927},
  year         = {2024},
  month        = may,
}

License

Copyright 2024 Ellianna Abrahams, Tasha Snow, Matthew R. Siegfried, Fernando Pérez, and contributors.

flipnslide is free software made available under the MIT License. For details see the LICENSE file.

Contributors

See the AUTHORS file for a complete list of contributors to the project.

flipnslide's People

Contributors

elliesch avatar tsnow03 avatar mrsiegfried avatar

Stargazers

Matt Tankersley avatar  avatar Glenn Moncrieff avatar Quinn Brencher avatar Brent Wilder avatar Wei Ji avatar  avatar Nils Lehmann avatar Benjamin avatar Robin Cole avatar

Watchers

 avatar  avatar  avatar

flipnslide's Issues

Move code into `flipnslide.py`

Move tiling code into tiling.py

This file needs to offer users three tools:

  • Tiling without overlap
  • Tiling with 50% overlap, no augmentation
  • Flip-n-Slide method (simultaneous overlap + permutation)

Outputs should be available in three data formats:

  • numpy arrays (--> .npy)
  • pytorch tensors (--> .pt)
  • #8

Create PyPI package

Checklist for publishing package to PyPI:

  • Make setup.py file
  • Generate build, dist, test_package.egg-info files
  • Use twine to push to PyPI

Add functionality to viz.py

Add several visualization functionalities to viz.py.

  • show ingested image after preprocessing
  • show cropped image compared to ingested image
  • show randomly selected tiles

Add examples folder

Add Two Examples:

  • One for use with already downloaded data
  • One for use with coordinates (use SF Bay Area example from @elliesch's CryoCloud tutorial)

Create `pytorch` DataLoader and Datasets scripts

Add pytorch functionality to dataset.py.

  • Turn tiles into a custom pytorch dataset
  • Create a custom data loader from this dataset that loads augmentations at random
    • To do this, preserve the indexing function within the sliding transform function

Add documentation to README

The readme is currently unpopulated. Add documentation to this, including pip instructions once the repo is packaged and indexed.

Enable Input Image with No Channels

Tiling breaks down when an input image has no channels and is of shape (x px, y px).

This can easily be fixed by adding a dimension expansion:
np.expand_dims(instance_masks_20141128, axis=0)

The visualizations also need to be fixed.

Add Tests

Add unit tests through GitHub workflows.

Test ideas can be added in the comments below this. Enable GitHub Actions, and create unit tests.

Goal: >80% coverage

Add Jupyter Book with Documentation

This is going to be a multi-step process:

  • Create the Jupyter Book
  • Populate the intro page
  • Make an "easy" example page
  • #13
  • Make a references page
  • Make a Code of Conduct page
  • #14
  • Push to Read the Docs

Add Tensorflow capabilities

In Release 1, we've added capability to output a tensorflow eager tensor. This is not GPU enabled, but will take more thought on how to properly enable GPU ready tensors. It additionally brings up the question as to whether we want to make our code more GPU ready for both tensorflow and PyTorch outputs in Release 2.

Create main class to run FlipnSlide

Create a file flipnslide.py to run everything from scratch as the main class.

Write now, tiling runs with a choice of tiler. Create flipnslide class to run tiling only using Flip-n-Slide method, without requiring user to choose which type of tiling.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.