A light-weight image labelling tool for Python designed for creating segmentation data sets.

Overview

django-labeller

A light-weight image labelling tool for Python designed for creating segmentation data sets.

  • compatible with Django, Flask and Qt
  • polygon, box, point and oriented ellipse annotations supported
  • polygonal labels can have disjoint regions and can be editing using paintng and boolean operations; provided by polybooljs
  • can use the DEXTR algorithm to automatically generate polygonal outlines of objects identified by the user with a few clicks; provided by the dextr library
New in v0.3: schema editor for editing label classes
Django Labeller in action:

Django labeller movie


Schema editor (new in v0.3):

Django labeller movie


Django, Flask or Qt?

If you want to run django-labeller on your local machine with minimum fuss and store the image and label files on your file system, use either the Flask application or the Qt application.

If you want to incorporate django-labeller into your Django application, use the Django app/plugin as it provides model classes that store labels in your database, etc.

Installation

If you to use the example Django application or use the provided example images, clone it from GitHub and install (recommended):

> git clone https://github.com/Britefury/django-labeller.git
> python setup.py install

To use it as a library, either with Flask or Django, install from PyPI:

> pip install django-labeller

Note:

  • pip install django-labeller[django] will also install the Django dependency
  • pip install django-labeller[dextr] will also install the dextr library

Examples

Flask web app example, running on your local machine

An example Flask-based web app is provided that displays the labelling tool within a web page. To start it, change into the same directory into which you cloned the repo and run:

> python -m image_labelling_tool.flask_labeller 

Now open 127.0.0.1:5000 within a browser.

If you want to load images from a different directory, or if you installed from PyPI, tell flask_labeller where to look:

> python -m image_labelling_tool.flask_labeller --images_pat=<images_directory>/*.<jpg|png>

Flask app with DEXTR assisted labelling

First, install the dextr library:

> pip install dextr

Now tell the Flask app to enable DEXTR using the --enable_dextr option:

> python -m image_labelling_tool.flask_labeller --enable_dextr

The above will use the ResNet-101 based DEXTR model trained on Pascal VOC 2012 that is provided by the dextr library. If you want to use a custom DEXTR model that you trained for your purposes, use the --dextr_weights option:

> python -m image_labelling_tool.flask_labeller --dextr_weights=path/to/model.pth

Qt desktop application

Requirements

PyQt5 and flask need to be installed, both of which can be installed using conda if using an Anaconda distribution.
Optionally install PyTorch and the dextr library if you want to use a DEXTR model for automatically assisted annotation.

Running

A simple Qt-based desktop application allows you to choose a directory of images to label. To start it, change into the same directory into which you cloned the repo and run:

> python -m image_labelling_tool_qt.simple_labeller 

A dialog will appear prompting you to choose a directory of images to label. The Enable DEXTR checkbox will enable DEXTR assisted automated labelling. Note that this requires that PyTorch and the dextr library are both installed in your Python environment.

The Qt desktop application uses QWebEngine to show the web-based component in a Qt UI. A Flask server is started in the background that serves the tool HTML, static files and images.

Django web app example

The example Django-based web app provides a little more functionality than the Flask app. It stores the label data in a database (only SQLite in the example) and does basic image locking so that multiple users cannot work on the same image at the same time.

To initialise, first perform migrations:

> python simple_django_labeller/manage.py migrate

Now you need to import a labelling schema. Labelling schemes are stored as JSON files. For now, there is a special one called demo that you can use. Load it into a schema named default:

> python simple_django_labeller/manage.py import_schema default demo

Then populate the database with the example images in the images directory (replace images with the path of another directory if you wish to use different images):

> python simple_django_labeller/manage.py populate images

Then run the app:

> python simple_django_labeller/manage.py runserver

Django app with DEXTR assisted labelling

First, install the dextr library and celery:

> pip install dextr
> pip install celery

Now install RabbitMQ, using the appropriate approach for your platform (you could use a different Celery backend if you don't mind editing settings.py as needed).

Enable DEXTR within tests/example_labeller_app/settings.py; change the line

LABELLING_TOOL_DEXTR_AVAILABLE = False

so that LABELLING_TOOL_DEXTR_AVAILABLE is set to True.

You can also change the LABELLING_TOOL_DEXTR_WEIGHTS_PATH option to a path to a custom model, otherwise the default ResNet-101 based U-net trained on Pascal VOC 2012 provided by the dextr library will be used.

Now run the Django application:

> cd simple_django_labeller
> python manage.py runserver

Now start a celery worker:

> cd simple_django_labeller
> celery -A example_labeller_app worker -l info

Note that Celery v4 and above are not strictly compatible with Windows, but it can work if you run:

> celery -A example_labeller_app worker --pool=solo -l info

API and label access

Please see the Jupyter notebook Image labeller notebook.ipynb for API usage. It will show you how to load labels and render them into class maps, instance maps, or image stacks.

Changes

Please see the change log for recent changes.

Libraries, Credits and License

Incorporates the public domain json2.js library. Uses d3.js, jQuery, popper.js, PolyK, polybooljs, Bootstrap 4, Vue.js v3 and spectrum.js.

This software was developed by Geoffrey French in collaboration with Dr. M. Fisher and Dr. M. Mackiewicz at the School of Computing Sciences at the University of East Anglia as part of a project funded by Marine Scotland.

It is licensed under the MIT license.

Lightweight plotting to the terminal. 4x resolution via Unicode.

Uniplot Lightweight plotting to the terminal. 4x resolution via Unicode. When working with production data science code it can be handy to have plotti

Olav Stetter 203 Dec 29, 2022
This repository contains all data used for writing a research paper Multiple Object Trackers in OpenCV: A Benchmark, presented in ISIE 2021 conference in Kyoto, Japan.

OpenCV-Multiple-Object-Tracking Python is version 3.6.7 to install opencv: pip uninstall opecv-python pip uninstall opencv-contrib-python pip install

6 Dec 19, 2021
Official implementation of the paper 'Details or Artifacts: A Locally Discriminative Learning Approach to Realistic Image Super-Resolution' in CVPR 2022

LDL Paper | Supplementary Material Details or Artifacts: A Locally Discriminative Learning Approach to Realistic Image Super-Resolution Jie Liang*, Hu

150 Dec 26, 2022
This is an open source python repository for various python tests

Welcome to Py-tests This is an open source python repository for various python tests. This is in response to the hacktoberfest2021 challenge. It is a

Yada Martins Tisan 3 Oct 31, 2021
Arabic Car License Recognition. A solution to the kaggle competition Machathon 3.0.

Transformers Arabic licence plate recognition 🚗 Solution to the kaggle competition Machathon 3.0. Ranked in the top 6️⃣ at the final evaluation phase

Noran Hany 17 Dec 04, 2022
Improving Machine Translation Systems via Isotopic Replacement

CAT (Improving Machine Translation Systems via Isotopic Replacement) Machine translation plays an essential role in people’s daily international commu

Zeyu Sun 10 Nov 30, 2022
A python implementation of Physics-informed Spline Learning for nonlinear dynamics discovery

PiSL A python implementation of Physics-informed Spline Learning for nonlinear dynamics discovery. Sun, F., Liu, Y. and Sun, H., 2021. Physics-informe

Fangzheng (Andy) Sun 8 Jul 13, 2022
This repository contains the implementation of the paper: "Towards Frequency-Based Explanation for Robust CNN"

RobustFreqCNN About This repository contains the implementation of the paper "Towards Frequency-Based Explanation for Robust CNN" arxiv. It primarly d

Sarosij Bose 2 Jan 23, 2022
Code for "FGR: Frustum-Aware Geometric Reasoning for Weakly Supervised 3D Vehicle Detection", ICRA 2021

FGR This repository contains the python implementation for paper "FGR: Frustum-Aware Geometric Reasoning for Weakly Supervised 3D Vehicle Detection"(I

Yi Wei 31 Dec 08, 2022
Bridging the Gap between Label- and Reference based Synthesis(ICCV 2021)

Bridging the Gap between Label- and Reference based Synthesis(ICCV 2021) Tensorflow implementation of Bridging the Gap between Label- and Reference-ba

huangqiusheng 8 Jul 13, 2022
Author's PyTorch implementation of TD3+BC, a simple variant of TD3 for offline RL

A Minimalist Approach to Offline Reinforcement Learning TD3+BC is a simple approach to offline RL where only two changes are made to TD3: (1) a weight

Scott Fujimoto 193 Dec 23, 2022
[SDM 2022] Towards Similarity-Aware Time-Series Classification

SimTSC This is the PyTorch implementation of SDM2022 paper Towards Similarity-Aware Time-Series Classification. We propose Similarity-Aware Time-Serie

Daochen Zha 49 Dec 27, 2022
Implementation of paper "Graph Condensation for Graph Neural Networks"

GCond A PyTorch implementation of paper "Graph Condensation for Graph Neural Networks" Code will be released soon. Stay tuned :) Abstract We propose a

Wei Jin 66 Dec 04, 2022
The implementation of "Shuffle Transformer: Rethinking Spatial Shuffle for Vision Transformer"

Shuffle Transformer The implementation of "Shuffle Transformer: Rethinking Spatial Shuffle for Vision Transformer" Introduction Very recently, window-

87 Nov 29, 2022
Learning Facial Representations from the Cycle-consistency of Face (ICCV 2021)

Learning Facial Representations from the Cycle-consistency of Face (ICCV 2021) This repository contains the code for our ICCV2021 paper by Jia-Ren Cha

Jia-Ren Chang 40 Dec 27, 2022
"Projelerle Yapay Zeka Ve Bilgisayarlı Görü" Kitabımın projeleri

"Projelerle Yapay Zeka Ve Bilgisayarlı Görü" Kitabımın projeleri Bu Github Reposundaki tüm projeler; kaleme almış olduğum "Projelerle Yapay Zekâ ve Bi

Ümit Aksoylu 4 Aug 03, 2022
Code for paper "Learning to Reweight Examples for Robust Deep Learning"

learning-to-reweight-examples Code for paper Learning to Reweight Examples for Robust Deep Learning. [arxiv] Environment We tested the code on tensorf

Uber Research 261 Jan 01, 2023
BOVText: A Large-Scale, Multidimensional Multilingual Dataset for Video Text Spotting

BOVText: A Large-Scale, Bilingual Open World Dataset for Video Text Spotting Updated on December 10, 2021 (Release all dataset(2021 videos)) Updated o

weijiawu 47 Dec 26, 2022
DynaTune: Dynamic Tensor Program Optimization in Deep Neural Network Compilation

DynaTune: Dynamic Tensor Program Optimization in Deep Neural Network Compilation This repository is the implementation of DynaTune paper. This folder

4 Nov 02, 2022