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.

Official repo for the work titled "SharinGAN: Combining Synthetic and Real Data for Unsupervised GeometryEstimation"

SharinGAN Official repo for the work titled "SharinGAN: Combining Synthetic and Real Data for Unsupervised GeometryEstimation" The official project we

Koutilya PNVR 23 Oct 19, 2022
GRaNDPapA: Generator of Rad Names from Decent Paper Acronyms

GRaNDPapA: Generator of Rad Names from Decent Paper Acronyms Trying to publish a new machine learning model and can't write a decent title for your pa

264 Nov 08, 2022
Sequence-tagging using deep learning

Classification using Deep Learning Requirements PyTorch version = 1.9.1+cu111 Python version = 3.8.10 PyTorch-Lightning version = 1.4.9 Huggingface

Vineet Kumar 2 Dec 20, 2022
Official repository for Few-shot Image Generation via Cross-domain Correspondence (CVPR '21)

Few-shot Image Generation via Cross-domain Correspondence Utkarsh Ojha, Yijun Li, Jingwan Lu, Alexei A. Efros, Yong Jae Lee, Eli Shechtman, Richard Zh

Utkarsh Ojha 251 Dec 11, 2022
[CVPR 2022] Unsupervised Image-to-Image Translation with Generative Prior

GP-UNIT - Official PyTorch Implementation This repository provides the official PyTorch implementation for the following paper: Unsupervised Image-to-

Shuai Yang 125 Jan 03, 2023
Get started learning C# with C# notebooks powered by .NET Interactive and VS Code.

.NET Interactive Notebooks for C# Welcome to the home of .NET interactive notebooks for C#! How to Install Download the .NET Coding Pack for VS Code f

.NET Platform 425 Dec 25, 2022
[CVPR 2019 Oral] Multi-Channel Attention Selection GAN with Cascaded Semantic Guidance for Cross-View Image Translation

SelectionGAN for Guided Image-to-Image Translation CVPR Paper | Extended Paper | Guided-I2I-Translation-Papers Citation If you use this code for your

Hao Tang 424 Dec 02, 2022
Arbitrary Distribution Modeling with Censorship in Real Time 59 2 60 3 Bidding Advertising for KDD'21

Arbitrary_Distribution_Modeling This repo implements the Neighborhood Likelihood Loss (NLL) and Arbitrary Distribution Modeling (ADM, with Interacting

7 Jan 03, 2023
Official PyTorch implementation for paper "Efficient Two-Stage Detection of Human–Object Interactions with a Novel Unary–Pairwise Transformer"

UPT: Unary–Pairwise Transformers This repository contains the official PyTorch implementation for the paper Frederic Z. Zhang, Dylan Campbell and Step

Frederic Zhang 109 Dec 20, 2022
Official PyTorch implementation of Segmenter: Transformer for Semantic Segmentation

Segmenter: Transformer for Semantic Segmentation Segmenter: Transformer for Semantic Segmentation by Robin Strudel*, Ricardo Garcia*, Ivan Laptev and

594 Jan 06, 2023
A collection of papers about Transformer in the field of medical image analysis.

A collection of papers about Transformer in the field of medical image analysis.

Junyu Chen 377 Jan 05, 2023
LibFewShot: A Comprehensive Library for Few-shot Learning.

LibFewShot Make few-shot learning easy. Supported Methods Meta MAML(ICML'17) ANIL(ICLR'20) R2D2(ICLR'19) Versa(NeurIPS'18) LEO(ICLR'19) MTL(CVPR'19) M

<a href=[email protected]&L"> 603 Jan 05, 2023
Code for "On Memorization in Probabilistic Deep Generative Models"

On Memorization in Probabilistic Deep Generative Models This repository contains the code necessary to reproduce the experiments in On Memorization in

The Alan Turing Institute 3 Jun 09, 2022
Small little script to scrape, parse and check for active tor nodes. Can be used as proxies.

TorScrape TorScrape is a small but useful script made in python that scrapes a website for active tor nodes, parse the html and then save the nodes in

5 Dec 04, 2022
Official Pytorch implementation of "Learning to Estimate Robust 3D Human Mesh from In-the-Wild Crowded Scenes", CVPR 2022

Learning to Estimate Robust 3D Human Mesh from In-the-Wild Crowded Scenes / 3DCrowdNet News 💪 3DCrowdNet achieves the state-of-the-art accuracy on 3D

Hongsuk Choi 113 Dec 21, 2022
Event-forecasting - Event Forecasting Algorithms With Python

event-forecasting Event Forecasting Algorithms Theory Correlating events in comp

Intellia ICT 4 Feb 15, 2022
OpenLT: An open-source project for long-tail classification

OpenLT: An open-source project for long-tail classification Supported Methods for Long-tailed Recognition: Cross-Entropy Loss Focal Loss (ICCV'17) Cla

Ming Li 37 Sep 15, 2022
IOT: Instance-wise Layer Reordering for Transformer Structures

Introduction This repository contains the code for Instance-wise Ordered Transformer (IOT), which is introduced in the ICLR2021 paper IOT: Instance-wi

IOT 19 Nov 15, 2022
LightningFSL: Pytorch-Lightning implementations of Few-Shot Learning models.

LightningFSL: Few-Shot Learning with Pytorch-Lightning In this repo, a number of pytorch-lightning implementations of FSL algorithms are provided, inc

Xu Luo 76 Dec 11, 2022
Object detection (YOLO) with pytorch, OpenCV and python

Real Time Object/Face Detection Using YOLO-v3 This project implements a real time object and face detection using YOLO algorithm. You only look once,

1 Aug 04, 2022