Package: labeller
LabellerQuickly set up an image labelling web application for the tagging of images by humans for supervised machine learning tasks.IntroductionLabellerallows you to quickly set up an image tagging web application for labelling of images.UsageInstallLabellerusingpip install labellerfrom the command lineNavigate to the directory where you wish to create your web application. This directory should contain a subdirectory namedstatic/imagesthat contains the images you wish to labelRunpython -m labeller class_1 class_2 ... class_nwhereclass_1 class_2 ... class_nis a list of your class names separated by spacesRunpython -m flask runto start the web applicationExample:$python-mlabellercartreebikehouse
$python-mflaskrunSee the Options section below for configuration options.Runpython -m labeller -hfor quick help.How Labeller WorksWhen you create a new labelling application,Labellerwill generate a web application based on the number of classes you have defined during initialisation. Images stored instatic/imageswill be displayed randomly to the user, and they can be labelled with one of the classes provided during the app initialisation.The built application will have the following structure:project_folder
├── app.py
├── db
│   └── labels.db
├── static
│   ├── favicon.ico
│   ├── images
│   │   ├── im_1.jpg
│   │   ├── im_2.jpg
│   │   ├── ...
│   │   └── im_n.jpg
│   └── styles
│       └── dashboard.css
└── templates
    ├── about.html
    ├── footer.html
    ├── index.html
    ├── labels.html
    └── navbar.htmlThelabels.dbfile is an SQLite database containing the labels for the images that have been labelled so far. To export them to CSV format, run the following:$ sqlite3 -header -csv labels.db "select * from labels;" > labels.csvFAQI want to clear the database and start labelling againDelete the sqlite database in thedbdirectory. The app will regenerate a new, empty database when run if no database exists.How can I export the data from the database as a CSV file?Try something like:sqlite3 -header -csv labels.db "select * from labels;" > labels.csvEnsure you place your images in a the directory pathstatic/images, so that a path to an image would be./static/images/im_1.pngfor example. In other words your directory structure should look as follows before you build your application:project_folder
└── static
    └── images
        ├── im_1.jpg
        ├── im_2.jpg
        ├── im_3.jpg
        ├── ...
        └── im_n.jpgOptionsCurrently, the only user definable parameters is the list of class names. This will change as the application develops.Flask OptionsLabelleruses Flask as its web development framework. You can pass arguments to Flask as normal when invokingpython -m flask run, or through environment variables. For example development mode can be enabled by setting an environment variable, e.g:export FLASK_ENV=developmentin Linux (in Windows useset FLASK_ENV=developmentor$env:FLASK_ENV = "development"in Powershell).Some common options that can be passed withpython -m flask runare:To serve the application over the network pass--host=0.0.0.0, sopython -m flask run --host=0.0.0.0To use a different port other than the default of 5000, e.g. port 5001, pass--port 5001, sopython -m flask run --port 5001RequirementsPython >=3.5The following Python packages are required, and will be downloaded automatically bypipduring installation:flaskflask-bootstrapas well and their requirements.Known IssuesHTML formatting of generated output needs workImages that are particularly large may have issues rendering and this will be fixed in the next updateFuture WorkText snippet labellingConsensus labelling (combining labelling efforts across users)Multi class labelling (labelling an image with more than one label)Free-text tagging/labellingAllow an option to resize all images in theimagesdirectory to a certain size when creating the web appAPI access for running instances to get image tagsProvide option to not use CDNs for JQuery and BootstrapDocker image?