Giter Site home page Giter Site logo

tristanratz / interactive-image-segmentation Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 1.0 743 KB

An AI-aided image segmentation ML-Module for Heartexlab/Label-Studio. Easy to deploy. Great to use.

License: Apache License 2.0

Dockerfile 2.09% Python 97.91%
labeling-tool image-segmentation ml ai python mask-rcnn rle rle-compression-algorithm label-studio interactive-labeling annotation interactive

interactive-image-segmentation's Introduction

Image Segmentation Module for Label Studio

This module was build facilitate the creation of large image segmentation datasets with the help of artificial intelligence with label-studio. Create image segmentations and get on the fly predictions for the dataset your labeling.

It was build with the help of Matterports MaskRCNN implementation and is meant to help you label images. After configuring the program for your needs and labeling a certain amount of images, the program should start to label images itself.

Demo Image

Installation

First clone the project

git clone --recurse-submodules -j8 https://github.com/tristanratz/Interactive-Image-Segmentation.git

Make sure you have docker and docker-compose installed to start the ml module.

Run

To start the ML Module change to the img-sgm-ml folder and execute the following.

docker-compose up -d # The -d stands for no output

The ML-Image-Segmentation Application is now up and running. Open http://localhost:8080/

Now you have to label about 70 images. After you are done, change to the model tab in label studio and train the model. After it finished learning you can continue labeling and should get predictions for your images.

Let the pre-labeling begin...!

Use with own data

To create own labels go into img_sgm_ml/model/config.py and enter your labels in the following format

CLASSES = {
                0: '__background__',
                1: 'YOUR_FIRST_CLASS',
                2: ...
          }       

Make sure that you safe the first spot for __background__. After that enter your class count (+1 for background)

Lastly add the images you want to label with the following command to the labeling tool:

label-studio init -i ./upload/ --input-format image-dir

or import them via the web interface (http://localhost:8080/import). Then (re)start the program. Now you can label your images and train the model under http://localhost:8080/model.

Change of classes

Make sure you delete the contents of rsc/checkpoints directory after you decided to change the classes you train on. Otherwise the model will try to load an existing model and will try to train it even if the classes do not match.

Use your own model

This projects holds a complete implementation to communicate with Label Studio and to predicting image segmentations with MaskRCNN. If you want to use a diffrent model for image segmentation you may have to rewrite or change the img_sgm_ml/model/model.py and img_sgm_ml/model/dataset.py classes.

This project contains code to transform the Label Studio format into the Matterport/MaskRCNN format.

Dataset and pretrained model

Under rsc resides a dataset consisting out of ballons, it is devided into three subsets, which were used to test this tool. The first dataset consists out of 70 labeled images of balloons, the second dataset are additional 70 images of balloons to test semi-automatic labeling, and the last set consists out of 10 unrelated images. The model which resulted out of the testing can be found under rsc/checkpoints. It was trained 5 epochs on the images of the first dataset.

Citation

@misc{LS_IMG_SGM_MODULE,
  title={{Interactive Labeling}: Facilitating the creation of comprehensive datasets with artificial intelligence},
  url={https://github.com/tristanratz/Label-Studio-image-segmentation-ML-Module},
  note={Open source software available from ttps://github.com/tristanratz/Label-Studio-image-segmentation-ML-Module},
  author={
    Tristan Ratz
  },
  year={2020},
}

Disclaimer

This project was created for my Bachelor Thesis "Facilitating the creation of comprehensive datasets with artificial intelligence" at the TU Darmstadt. (read it here)

A special thanks to the Finanz Informatik Solutions Plus GmbH for the great support!

interactive-image-segmentation's People

Contributors

tristanratz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

hussainfolio3

interactive-image-segmentation's Issues

init() missing 1 required positional argument: 'project_dir'

I am getting this error

Project loading error
init() missing 1 required positional argument: 'project_dir'
Traceback
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/label_studio/utils/misc.py", line 89, in exception_f
return f(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/label_studio/server.py", line 150, in prepare_globals
g.project = project_get_or_create()
File "/usr/local/lib/python3.7/site-packages/label_studio/server.py", line 126, in project_get_or_create
input_args, context={'multi_session': False})
File "/usr/local/lib/python3.7/site-packages/label_studio/project.py", line 889, in get_or_create
project = cls.get(project_name, args, context)
File "/usr/local/lib/python3.7/site-packages/label_studio/project.py", line 872, in get
project = cls._load_from_dir(project_dir, project_name, args, context)
File "/usr/local/lib/python3.7/site-packages/label_studio/project.py", line 860, in _load_from_dir
return cls(config, project_name, context=context, root_dir=args.root_dir)
File "/usr/local/lib/python3.7/site-packages/label_studio/project.py", line 91, in init
self.load_converter()
File "/usr/local/lib/python3.7/site-packages/label_studio/project.py", line 241, in load_converter
self.converter = Converter(self.parsed_label_config)
TypeError: init() missing 1 required positional argument: 'project_dir'

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.