Code Monkey home page Code Monkey logo

salt's Introduction

Segment Anything Labelling Tool (SALT)

Uses the Segment-Anything Model By Meta AI and adds a barebones interface to label images and saves the masks in the COCO format.

Under active development, apologies for rough edges and bugs. Use at your own risk.

Installation

  1. Install Segment Anything on any machine with a GPU. (Need not be the labelling machine.)
  2. Create a conda environment using conda env create -f environment.yaml on the labelling machine (Need not have GPU).
  3. (Optional) Install coco-viewer to scroll through your annotations quickly.

Usage

  1. Setup your dataset in the following format <dataset_name>/images/* and create empty folder <dataset_name>/embeddings.
    • Annotations will be saved in <dataset_name>/annotations.json by default.
  2. Copy the helpers scripts to the base folder of your segment-anything folder.
    • Call extract_embeddings.py to extract embeddings for your images.
    • Call generate_onnx.py generate *.onnx files in models.
  3. Copy the models in models folder.
  4. Symlink your dataset in the SALT's root folder as <dataset_name>.
  5. Call segment_anything_annotator.py with argument <dataset_name> and categories cat1,cat2,cat3...
    • There are a few keybindings that make the annotation process fast.
    • Click on the object using left clicks and right click (to indicate outside object boundary).
    • n adds predicted mask into your annotations. (Add button)
    • r rejects the predicted mask. (Reject button)
    • a and d to cycle through images in your your set. (Next and Prev)
    • l and k to increase and decrease the transparency of the other annotations.
    • Ctrl + S to save progress to the COCO-style annotations file.
  6. coco-viewer to view your annotations.
    • python cocoviewer.py -i <dataset> -a <dataset>/annotations.json

Demo

How it Works Gif!

Contributing

Follow these guidelines to ensure that your contributions can be reviewed and merged. Need a lot of help in making the UI better.

If you have found a bug or have an idea for an improvement or new feature, please create an issue on GitHub. Before creating a new issue, please search existing issues to see if your issue has already been reported.

When creating an issue, please include as much detail as possible, including steps to reproduce the issue if applicable.

Create a pull request (PR) to the original repository. Please use black formatter when making code changes.

License

The code is licensed under the MIT License. By contributing to SALT, you agree to license your contributions under the same license as the project. See LICENSE for more information.

salt's People

Contributors

anuragxel avatar daa98 avatar

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.