Code Monkey home page Code Monkey logo

simple-semantic-segment-anything-annotator's Introduction

simple-semantic-segment-anything-annotator

Super simple one line of code to use semantic-segment-anything to auto annotate your datasets.

This repo is 100% based on the amazing Semantic-Segment-Anything project but an ultra-simplified version for those who just wanna run one line of code to annotate your datasets and don't give a heck to the underlying processes.

What You Need to Run it ?

The follows are important

  • GPU Memory >= 13 GB (as SAM is GPU memory consuming)
  • nvidia docker installed
  • nvidia driver installed on host machine

This repo is tested at the following environment

  • Ubuntu 22.04
  • Single GPU 3090 Ti
  • NVIDIA Driver 530

One Line to Set up Environment

make run

One Line to Run Demo

In the input, you will see a demo picture:

demo

whereas the output folder is empty.

Once you are inside the container, run:

make annotate-single-gpu

You will see that the demo image will be annotated and yields results in output folder.

One Line to Batch Annotate Your Own Datasets

Put all images that you would like to annotate under input, such as:

├── input
│   ├── whatever_name_you_like.jpg
│   ├── whatever_format_you_like.png
│   ├──...

Then:

make annotate-single-gpu

Then, you will get all output in the output folder. That's it.

Re-draw The Labels

If you have a really dense objects, the visualization can be hard to tell. demo_semantic

I have prepared one script simple_visualizer.py to parse the json and re-draw the image.

Simply do:

python simple_visualizer.py redraw \
--image_path=input/demo.jpg \
--json_path=output/demo_semantic.json \
--classes_to_keep="[\"person\"]"

And you will see that a new visualization is available:

demo_semantic

simple-semantic-segment-anything-annotator's People

Contributors

kleinyuan 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.