forked from HumanSignal/label-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Massive LSF rework (HumanSignal#403) * LSF with new deserialization and changed structure * Update LSF js * Hostname for enternal LS usage. Docker with hostname passthrough. * Username and password to docker. * update s3 signature version to s3v4 to support more aws regions (HumanSignal#402) * Release 0.7.4.post0 (HumanSignal#400) * Release 0.7.4.post0 label-studio-converter version. * Docs and version. * update s3 signature version to s3v4 to support more aws regions Co-authored-by: Max <[email protected]> * Update ml.md (HumanSignal#404) * Release 0.7.4.post0 (HumanSignal#400) * Release 0.7.4.post0 label-studio-converter version. * Docs and version. * Update ml.md * Update ml.md Co-authored-by: Max <[email protected]> * Logs for ML backend. * LSF build. * Ui fixes. * Fixes and addions for task validation in cloud storages. * Check for raise. * Back raise. * fix un-error for ML backend, add parse_config docstring * Move project loading line. * methods * Bugfixes with project_obj and docs. * New LSF build. * Improvements of navigation with hotkeys. * Minimum formatting of completed_at (HumanSignal#397) * Minimum formatting of completed_at * Fix skip formatting None timestamp * Doc fixes. * Fix order of completion picking * Docs fixes. * Pretty fixes. * New LSF build. * Mobile UI fix. * More mobile fixes. * Min height for tr in tasks. * Docs fixes. * Usage stats docs. * Docs fixes. * Docs about frontend. * Docs frontend fixes. * Docs fixes. * Docs for LS modules. * Docs fixes. * LSF build from tmp/deserialize. * New LSF build. * LSF build from tmp/deserialize. * New LSF build from tmp/deserialize. * maintain ordering in source.json and task.json (HumanSignal#414) Co-authored-by: dhruv <[email protected]> * Docs preview in iframe. * New LSF build from tmp/deserialize. * Loader for open preview. * Keypoint docs fix with stroke width. * Docs fix with ml-backend-url. * Active learning docs in ml backend. * ML examples docs. * New LSF build from tmp/deserialize. * Docs CORS new image added. * Latest LSF tmp/deserialize build * Fix LSF bug with initialization * Fix headshot export dimmer * Reduce debug logs on next task * Remove huge data from console while debug * Hide skip button on tasks page * Add table example with text fields * New LSF build from tmp/deserialize * Move external fonts to LS. Bug fix with accordion and checkboxes. * Change version 0.7.5rc1 * configure blueprint * enable PR builds for all target branches * ML patch * Update docs * Latest LSF build with tmp/deserialization * Fix buttons "Start Predictions" and "Remove ML backend" for Firefox (HumanSignal#439) * Fix correct templates_dir from config.json * Fix deprecated deploy to azure button * Litte fix with deploy buttons * Fix docs * Show task code column * UI fixes * Reworked size of left and right panels on tasks page * Fix size of right panel. rc3 release * Make left and right panels true responsible * Add call to ml backend to get task prediction on api/task/<id> * Add Table type to _DATA_TYPES * Add Table example data * Add playground examples * Lates LSF build with Text/HyperText fixes * Add host & protocol & port help for external domain * Upgrade pip in docker * Update tag docs * Change version to rc5 * Fix docs with init without project name * Make short version for task and completion paths on tasks page * Increase wait intervals in e2e tests * Sync platform with opensource in TS previews * Make tooltip for paths on tasks page. * Make pretty print for show task data * Fix displying of short paths for storages * Fix tests * Fix e2e tests * Fix api_predict (HumanSignal#480) analytics instance is in globals, not in project * Fix stats * Rename exception treatment * Refactor project/config * Refactor some api urls. Update docs about how to make predictions * Fix docs * Refactor blueprint.py * Rework ml backend apis * Move start_browser. Update LSF build * Fix ascending order * Import urls without SSL check * Merge with master * Add ML backend for Image Object Detection * Restructure docs * Revert labeling * Fix one link * Enhance ML docs, make version checker * Use id in export * Add workaround for python3.5 * Update LSF c883b7368 * Add deprecated API * Check integration with blueprint. Fix external hostname without port * Fix tests * Update LSF 57cbe6 * Add blueprint usage example * Fix mmdetection doc * Delete duplicated text * Add help text to blueprint example * Fix misspells * Add readme about ls integration * Add more readme to blueprint * Add more readme into blueprint usage example * Fix redirects on welcome and setup pages * Remove unused comment * Fix ml.md from Michael * stylistic changes and a few typos Co-authored-by: hlomzik <[email protected]> Co-authored-by: Wouter Devriendt <[email protected]> Co-authored-by: jeannefukumaru <[email protected]> Co-authored-by: nik <[email protected]> Co-authored-by: Hikonobu Kurihara <[email protected]> Co-authored-by: Dhruv Mishra <[email protected]> Co-authored-by: dhruv <[email protected]> Co-authored-by: Thomas Grainger <[email protected]> Co-authored-by: Dario Saccavino <[email protected]> Co-authored-by: hepaajan <[email protected]> Co-authored-by: Mikhail Maluyk <[email protected]>
- Loading branch information
1 parent
cf0269e
commit 4688a36
Showing
76 changed files
with
2,682 additions
and
1,531 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ on: | |
- '*' | ||
- '*/*' | ||
- '!master' | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
""" This is an example about how Label Studio could be included into your flask app as blueprint | ||
1. You need to initialize LS project in the same directory where this file is placed: | ||
> label-studio init my_project | ||
2. Run this demo flask app within Label Studio python environment: | ||
> python blueprint_usage_example.py | ||
3. Go to http://localhost:5000/ | ||
""" | ||
import json | ||
from types import SimpleNamespace | ||
from flask import Flask, make_response, g | ||
from label_studio.blueprint import (blueprint as label_studio_blueprint, | ||
LabelStudioConfig, set_external_hostname, project_get_or_create) | ||
|
||
app = Flask('my-ml-platform', static_url_path='') | ||
app.secret_key = 'some-secret-key' | ||
app.config['WTF_CSRF_ENABLED'] = False | ||
app.url_map.strict_slashes = False # it's very important to disable this option | ||
app.register_blueprint(label_studio_blueprint, url_prefix='/label-studio/') | ||
|
||
# check label_studio.utils.argparser to know all options: *_parser.add_argument(option_name, ...) | ||
input_args = {'project_name': 'my_project', 'command': 'start', 'root_dir': '.', 'force': False} | ||
set_external_hostname('http://localhost:5000/label-studio') | ||
app.label_studio = LabelStudioConfig(input_args=SimpleNamespace(**input_args)) | ||
|
||
|
||
@app.route('/') | ||
def index(): | ||
# get label studio project instance | ||
project = project_get_or_create() | ||
# get all tasks with completions from target storage and print them (target_storage ~ BaseStorage) | ||
tasks_with_completions = [task for task in project.target_storage.items()] | ||
output = json.dumps(tasks_with_completions, indent=2) | ||
return make_response('Welcome to our ML platform with ' | ||
'<a href="/label-studio">Label Studio Project "' + project.name + '"</a>' + | ||
'<br><br>Task data from project: ' | ||
'<pre style="width:500px">' + output + '</pre>', 200) | ||
|
||
|
||
if __name__ == '__main__': | ||
app.run(debug=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: Main concept & design | ||
type: guide | ||
order: 704 | ||
--- | ||
|
||
## Overview | ||
|
||
Label Studio is a self-contained Web application for multi-typed data labeling and exploration. The _backend_ is written in pure Python powered by [Flask](https://github.com/pallets/flask). The _frontend_ part is a backend-agnostic [React](https://reactjs.org/) + [MST](https://github.com/mobxjs/mobx-state-tree) app, included as a precompiled script. | ||
|
||
Here are the main concepts behind Label Studio's workflow: | ||
|
||
<div style="margin:auto; text-align:center; width:100%"><img src="/images/label-studio-ov.jpg" style="opacity: 0.7"/></div> | ||
|
||
- **Tasks** represent an individual dataset items. Label Studio is a multi-type labeling tool - you can [import](tasks.html) either text, image, audio URL, HTML text or any number and combination of these data resources. | ||
- **Completions** are the labeling results in [JSON format](export.html#Completion-fields). They could be [exported](export.html) in various common formats, ready to use in machine learning pipelines. | ||
- **Predictions** are the optional labeling results in [the same format](export.html#Completion-fields), but unlike completions they are used for generating pre-labeling during the annotation process, or validating the model predictions. | ||
- [**Machine learning backend** connects](ml.html) popular machine learning frameworks to Label Studio for active learning & generating model predictions on-the-fly. | ||
- **Labeling config** is a simple [XML tree with **tags**](setup.html#Labeling-config) used to configure UI elements, connect input data to output labeling scheme. | ||
- **Project** encompasses tasks, config, predictions and completions all-in-one in an isolated directory | ||
- **Frontend Labeling UI** is accessible from any browser, distributed as precompiled js/css scripts and could be [easily extendable with new labeling tags](frontend.html). You can also [embed Label Studio UI into your applications](frontend.html#Quickstart). | ||
|
||
|
||
### Main modules | ||
|
||
The main modules of LS are | ||
* [Label Studio Backend](https://github.com/heartexlabs/label-studio/) (LSB, main repository) | ||
* [Label Studio Frontend](https://github.com/heartexlabs/label-studio-frontend) (LSF, editor) | ||
* [Machine Learning Backends](https://github.com/heartexlabs/label-studio/tree/master/label_studio/ml) (MLB) | ||
|
||
<br> | ||
<div style="margin:auto; text-align:center;"><img src="/images/ls-modules-scheme.png" style="opacity: 0.8"/></div> | ||
|
||
### Relations among tasks, completions and results | ||
|
||
Here you can see relations among labeling objects: tasks, completions, results, etc. | ||
|
||
One user provides one completion, it’s atomic, and it consists of the result items. Result items can have relations between themselves with the specified direction of three types: left-right, right-left, or bidirectional. Normalizations are additional information in the custom string format about the current result item. | ||
|
||
<br> | ||
<center><img src="/images/labeling-scheme.png" style="width: 100%; opacity: 0.6"></center> | ||
<br> | ||
Completions and Predictions are very similar. But predictions must be generated automatically by ML models. | ||
|
||
**Usage statistics** | ||
|
||
Label Studio collects anonymous usage statistics without any sensitive info about page request number and data types from the labeling config. It helps us to improve the labeling quality and gives a better understanding about the next development. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
title: Deployment scenarios | ||
type: guide | ||
order: 907 | ||
--- | ||
|
||
|
||
## WSGIServer instead of Flask | ||
|
||
Use `--use-gevent` option on start to enable WSGI server. It wraps around app.run with gevent's WSGIServer to enable the server to better handle concurrent requests. | ||
|
||
``` | ||
label-studio start test --use-gevent | ||
``` | ||
|
||
## HTTPS & SSL | ||
|
||
You can enable https protocol for Flask or WSGIServer. You need to generate SSL certificate and key for it, e.g.: | ||
|
||
``` | ||
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem | ||
``` | ||
|
||
Than you need to use `--cert` and `--key` option on start: | ||
|
||
``` | ||
label-studio start test --cert certificate.pem --key key.pem | ||
``` | ||
|
||
|
||
## Health check | ||
|
||
LS has a special endpoint for health checks: | ||
|
||
``` | ||
/api/health | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.