Skip to content

Commit

Permalink
Release 0.9.0 - new onboarding & data manager (HumanSignal#514)
Browse files Browse the repository at this point in the history
* Add more detailed test for api/tasks with filter

* Add remove tabs api. Reset tabs if labeling config changed

* Use new import api

* Add import state update, remove prepare payload (HumanSignal#506)

Co-authored-by: nik <[email protected]>

* Add UI fixes

* Update welcome page design

* Fix responses from server with {detail: ...}

* Return id: none on next task 404

* Fix primary button color

* Fix old next task api

* Add debug logging

* Add import_state.selected_formats

* Return files_as_tasks_list as object

* Expose found formats, use selected_formats/selected_objects

* Fix selected objects computation

* Fix upload and file save. Fix URL. Fix json/list direct import

* Make validation error description better

* Small fixes:

- wrong labels for task counts
- fix conditions for blocks diaplying
- shorten texts in preview table
- don't display title for the only one column

* Add pyyaml to requirements

* Add Unknown column

* Make empty config on init. Process $undefined$ correctly.

* Add minor fixes

* Generate label config from object tags

* Add import by URL

* Style fixes

- Cancel & Import buttons
- fade on table on a huge amount of files
- better looking counts
- hover on dropzone

* Fix data types for dm

* Handle files as tasks list while reading

* Add one-object tag handler

* Add checkboxes for files format and csv/file list

* Fix file formats checkboxes

* Styles spinner with opossum

* Style and text fixes

- add link to old import page
- better text about import via url
- better text about "file as tasks list"
- disable last checkbox for file formats to prevent from unselecting all

* Simplify object type inference

* Update LSF build and some UI

* Collect datakeys, generate label config WIP

* Submit URL import by Enter; fix text under input

* Show loading/errors in preview; catch all errors

TODO: DRY

* Add settings to setup page. Update DM version

* Treat json format as text by default

* Add missing error icon

* Remove YAML warning

* Add advanced logic for DM api to support unknown user data

* Update DM build. Add data settings with storages

* Fix logic and styles; block import on error

* Update DM build. Tune Skip/Update logic on server side

* Update LSF to support empty <View/> config

* Fix archive extraction

* Trim hash

* Fix bytes error

* Trim preview size, move task loading on apply

* Make api tasks fast when no filters and ordering

* Fix prepare_tasks

* Fix resolving url for clouds. Fix speed up for task api

* Add confirm dialog for actions

* Show formats as radio boxes in preview; fix texts

* Add config_has_control_tags to project api

* Show errors on files upload

* sourcemap for DM

* Fix missed extensions type due to task preview

* Fix get_new_idx

* Regroup label config management code, fix deleting tasks & reimporing new files

* Show interpet files as tasks list on demand, improve UI

* Not read all tasks twice on apply

* Raise on inconsistent import

* Make tasks lists selected by default

* Update DM build

* Add scroll for lot of columns and title in preview

* Update DM build

* Prettify validation message

* Consider \n in error messages

* Calm down the user during long waiting

* Make hidden other tabs on setup page

* Fix import from tasks list and identical data keys in import/project

* Add default settings for visibility of columns

* Fix prediction counters

* Reset label config without control tags

* Align preview tables on center

* Fix ordering check for max_count in preload_tasks

* Hide cloud storage data key with default, redirect welcome page

* Make some fixes

* Revert DM build. Fix add a new completion

* Disable Import button until format is selected

* Open DM after successfull cloud import

* Freeze state before cache implementation

* Add cache for DirJSONsStorage

* Make correct actions when filters over selected items enabled

* Fix default object tag for txt import, revert preview styles

* Update all LSF builds

* Fix data manager tests

* Try to make fast scroll

* Reset selected items on filter change

* Fix included in filters

* Add "Edit config" button for related errors

* Add tricks for scroll and actions speedup

* New LSF build

* Revert DM build to 82e3b25ec8a653f4a52eee520cad8cc908cb25b3

* Update DM build

* Fix tasks page layout

* Update DM build

* Update DM build

* Make little UI fixes

* Update DM build

* Update DM build

* Fix export with redundant completion fields

* Remove json from ambiguous tasks lists format

* Update DM build

* Enhance config validation message

* Add completions/predictions in tasks preview

* Update DM build

* Don't wrap long lines in preview table

* Update DM build

* Remove timeColumn from TS examples

* Fix rare bug with non-disabled Import

* Fix delete all with sync of source storage threads

* Update DM build

* Update DM layout

* Add storage access optimizations

* Add some fixes in UI and code

* Update DM build

* Update DM build

* Update DM build

* Fix import state persistence, reimporting timeseries CSV

* Fix taxonomy template

* Fix update derived schema for taxonomy, include txt as ambiguous format

* Add thread locks on tab load/save

* Update DM build

* Reset selected formats on 2nd import

* Fix tests payloads

* Fix resetting global test state

* Fix json preview and upload the same file twice

* Update LSF build.

* Update DM build with support for external window.LabelStudio

* Add reset for labeling config

* Improve styles; add palette and theme

* Update DM build

* Update DM build

* Change opossum to the sharper one

* Temporarily disable e2e because of new user flow

* Update DM build

* Move upload stats and fix text

* Fix import title. Update predictions score text

* Update welcome image

* Update DM build

* Improve storage settings on import page

* Add autoupdate timer on data storage settings

* Change to rc0 version

* Update LSF build. Ready to 0.9.0rc1

* Fix user hash

* Fix blueprint and its example. Broken DM build

* Add e2e tests for the new import flow (HumanSignal#520)

* Add e2e test for the new import flow

* Fix upload triggering when click outside dropzone

* Fix docs

* Fix e2e tests

* Insert wait to e2e tests

* Update LSF and DM builds

* Update DM build

* Update DM build

* DM build from artifacts

* Add experimental propage completions action

* Write more about first task for propagation

* Add test for files upload; tidy up; fix Reset btn

* Temporarily disable test after removing all tasks

* Update DM build

* Update DM build

* Update DM build. Add DM version to /version

* Fix get-build script - info messages and errors

* Update and build DM

* Fix misspell

* Add first_page_full_render option to project config to speed up s3/gcs storage task loading

* Fix tests

* Fix broken value in templates

* Fix LS header's shadow over DM with Filters docked

* Update LSF and DM; build them all

* Resolve undefined in completion files

* Add prediction results field

* Fix tests

* Update DM with switching tabs bug fixed

* Update LSF with View All fixes

* Remove import button

* Add action "Predictions => completions"

* Fix comma

* Make action description more detailed

* Update DM build

* Update DM build and get-script.js

* Update DM build

* Update DM build

* Update rc4, ban python 3.9

* Update DM build

* Fix Dockerfile environment

* Update version to 0.9.0rc5

* Update functions.py

Updating copy

* Update import_files.html

Copy changes

* Update export.html

Copy changes

* Update welcome.html

Copy changes

* Update import_new.html

Updating copy

* Update setup_project.html

Copy changes

* Update base.py

Copy changes

* Update setup.html

Copy changes

* Update storages_old.html

Copy changes

* Fix tests: no Import on menu; new project Reset

* Update DM

* Update LSF

* Fix tests - block icon and better English

* Change version to 0.9.0

* Update DM build

* Fix ordering for dicts. Fix fields order in columns api

* Change error message

* Update DM build

Co-authored-by: hlomzik <[email protected]>
Co-authored-by: makseq-ubnt <[email protected]>
Co-authored-by: nik <[email protected]>
Co-authored-by: panoplied <[email protected]>
Co-authored-by: Nikita Skryabin <[email protected]>
Co-authored-by: Michael Malyuk <[email protected]>
  • Loading branch information
7 people authored Jan 12, 2021
1 parent 86915cd commit 7deadf4
Show file tree
Hide file tree
Showing 117 changed files with 29,337 additions and 1,908 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ label_studio.egg-info/
my_project/
my_project1/
label-studio-projects
build/
./build/
dist/
venv/
tmp/
scripts/build-tmp
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ FROM python:3.6-slim

WORKDIR /label-studio

RUN apt-get update && apt-get install -y build-essential

# Copy and install requirements.txt first for caching
COPY requirements.txt /label-studio
RUN pip install --upgrade pip
Expand Down
8 changes: 4 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include label_studio/examples/*/*.xml
include label_studio/examples/*.xml
recursive-include label_studio/static *
include label_studio/templates/includes/*.html
include label_studio/templates/*.html
recursive-include label_studio *.yml
recursive-include label_studio *.html
include label_studio/utils/schema/*.json
include label_studio/logger.json
include label_studio/config.json
include label_studio/ml/default_configs/*
include requirements.txt
include requirements.txt
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SHELL:=/bin/bash
UNAME:=$(shell uname)

install= \
pip install -e .

start= \
python label_studio/server.py start labeling_project --init

start:
$(call start)

install:
$(call install)
11 changes: 8 additions & 3 deletions blueprint_usage_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,19 @@
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)
from label_studio.blueprint import (blueprint as label_studio_blueprint, data_manager_blueprint, data_import_blueprint,
LabelStudioConfig, set_external_hostname, project_get_or_create,
app_before_request_callback, app_after_request_callback)

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/')
app.register_blueprint(data_manager_blueprint, url_prefix='/label-studio/')
app.register_blueprint(data_import_blueprint, url_prefix='/label-studio/')
app.before_request(app_before_request_callback)
app.after_request(app_after_request_callback)

# 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}
Expand All @@ -34,7 +39,7 @@ def index():
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>' +
'<a href="/label-studio/">Label Studio Project "' + project.name + '"</a>' +
'<br><br>Task data from project: '
'<pre style="width:500px">' + output + '</pre>', 200)

Expand Down
8 changes: 8 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "3"

services:
label-studio:
volumes:
- .:/label-studio
- ./my_project:/label-studio/my_project
command: "label-studio start -d my_project ${INIT_COMMAND} --host 0.0.0.0"
112 changes: 56 additions & 56 deletions docs/source/guide/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ You can include `main.<hash>.css` and `main.<hash>.js` files from CDN directly.

```xhtml
<!-- Theme included stylesheets -->
<link href="https://unpkg.com/browse/[email protected]/build/static/css/main.14acfaa5.css" rel="stylesheet">
<link href="https://unpkg.com/[email protected]/build/static/css/main.14acfaa5.css" rel="stylesheet">

<!-- Main Label Studio library -->
<script src="https://unpkg.com/browse/[email protected]/build/static/js/main.0249ea16.js"></script>
<script src="https://unpkg.com/[email protected]/build/static/js/main.0249ea16.js"></script>
```


Expand All @@ -49,61 +49,61 @@ You can include `main.<hash>.css` and `main.<hash>.js` files from CDN directly.
You can use Label Studio Frontend separately in your own projects: just include it in your HTML page. Instantiate a new Label Studio object with a selector for the div that should become the editor. To see all the available options for the initialization of LabelStudio object, please check the [Reference](frontend_reference.html).

``` xhtml
<!-- Include Label Studio stylesheet -->
<link href="https://unpkg.com/browse/[email protected]/build/static/css/main.09b8161e.css" rel="stylesheet">

<!-- Create the Label Studio container -->
<div id="label-studio"></div>

<!-- Include the Label Studio library -->
<script src="https://unpkg.com/browse/[email protected]/build/static/js/main.e963e015.js"></script>

<!-- Initialize Label Studio -->
<script>
var labelStudio = new LabelStudio('editor', {
config: `
<View>
<Image name="img" value="$image"></Image>
<RectangleLabels name="tag" toName="img">
<Label value="Hello"></Label>
<Label value="World"></Label>
</RectangleLabels>
</View>
`,
interfaces: [
"panel",
"update",
"controls",
"side-column",
"completions:menu",
"completions:add-new",
"completions:delete",
"predictions:menu"
],
user: {
pk: 1,
firstName: "James",
lastName: "Dean"
},
task: {
completions: [],
predictions: [],
id: 1,
data: {
image: "https://htx-misc.s3.amazonaws.com/opensource/label-studio/examples/images/nick-owuor-astro-nic-visuals-wDifg5xc9Z4-unsplash.jpg"
}
},
onLabelStudioLoad: function(LS) {
var c = LS.completionStore.addCompletion({
userGenerate: true
});
LS.completionStore.selectCompletion(c.id);
}
<!-- Include Label Studio stylesheet -->
<link href="https://unpkg.com/[email protected]/build/static/css/main.09b8161e.css" rel="stylesheet">

<!-- Create the Label Studio container -->
<div id="label-studio"></div>

<!-- Include the Label Studio library -->
<script src="https://unpkg.com/[email protected]/build/static/js/main.e963e015.js"></script>

<!-- Initialize Label Studio -->
<script>
var labelStudio = new LabelStudio('label-studio', {
config: `
<View>
<Image name="img" value="$image"></Image>
<RectangleLabels name="tag" toName="img">
<Label value="Hello"></Label>
<Label value="World"></Label>
</RectangleLabels>
</View>
`,
interfaces: [
"panel",
"update",
"controls",
"side-column",
"completions:menu",
"completions:add-new",
"completions:delete",
"predictions:menu"
],
user: {
pk: 1,
firstName: "James",
lastName: "Dean"
},
task: {
completions: [],
predictions: [],
id: 1,
data: {
image: "https://htx-misc.s3.amazonaws.com/opensource/label-studio/examples/images/nick-owuor-astro-nic-visuals-wDifg5xc9Z4-unsplash.jpg"
}
},
onLabelStudioLoad: function(LS) {
var c = LS.completionStore.addCompletion({
userGenerate: true
});
</script>
LS.completionStore.selectCompletion(c.id);
}
});
</script>
```

## Custom LSF + LSB integration
Expand Down
6 changes: 4 additions & 2 deletions docs/source/guide/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ Check the browser console (Ctrl + Shift + i in Chromium) for errors if you have

* You must specify the `region` when you create a new bucket. Don't forget to change it in your `.aws/config` file. Otherwise your bucket objects will have problems with access.

E.g.: `~/.aws/config`
E.g.: `~/.aws/config`

```
[default]
region=us-east-2 # change to the region of your bucket
```
```
* Use LS version >= 0.7.5, it has a signature version s3v4 to support more aws regions.
Expand Down
2 changes: 1 addition & 1 deletion docs/themes/htx/layout/partials/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@
style="max-height:280px; position:relative; top: 20px" />
<img src="/images/opossum/other/opossum_looking.svg" width="70px" style="position: relative; top: -20px">
</a>
<div style="font-weight: lighter; position: relative; top: -10px">Last version is 0.8.0</div>
<div style="font-weight: lighter; position: relative; top: -10px">Last version is 0.9.0</div>
</div>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions e2e/assets/list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
https://user.fm/files/v2-901310d5cb3fa90e0616ca10590bacb3/spacexmoon-800x501.jpg
https://htx-misc.s3.amazonaws.com/opensource/label-studio/examples/images/nick-owuor-astro-nic-visuals-wDifg5xc9Z4-unsplash.jpg
https://htx-misc.s3.amazonaws.com/opensource/label-studio/examples/images/history-in-hd-e5eDHbmHprg-unsplash.jpg
https://htx-misc.s3.amazonaws.com/opensource/label-studio/examples/images/soroush-karimi-crjPrExvShc-unsplash.jpg
Binary file added e2e/assets/photo.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"scripts": {
"server:reset": "cd .. && rm -rf _e2e_project && python label_studio/server.py start --init _e2e_project -b",
"server": "cd .. && python label_studio/server.py start _e2e_project -b",
"client": "sleep 2 && codeceptjs run --steps",
"client:headless": "sleep 2 && HEADLESS=true codeceptjs run --steps",
"client": "sleep 5 && codeceptjs run --steps",
"client:headless": "sleep 5 && HEADLESS=true codeceptjs run --steps",
"test": "npm-run-all -p -r server:reset client",
"test:headless": "npm-run-all -p -r server:reset client:headless"
},
Expand Down
17 changes: 17 additions & 0 deletions e2e/steps_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,22 @@ module.exports = function() {
// Define custom steps here, use 'this' to access default methods of I.
// It is recommended to place a general 'login' function here.

async reset() {
const I = this;
I.amOnPage("/settings")
const config = await I.grabValueFrom("#id_label_config")
// if config is not empty
if (config.replace(/\s+/, "") !== "<View></View>") {
I.say("Reset app state to the empty one")
I.click("Project settings")
// there are many Reset button on other tabs, click one on the active tab
I.click(locate(".ui.tab.active button").withText("Reset"))
I.click("Labeling config")
I.click("Reset")
// config is validated on backend
I.wait(2)
I.click("Save")
}
},
});
}
9 changes: 6 additions & 3 deletions e2e/tests/0.choices.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Feature('choices');

Scenario('Setup choices config from start', (I) => {
xScenario('Setup choices config from start', (I) => {
I.wait(7);
I.amOnPage("/");
I.waitForText("Welcome to"); // Label Studio uses &nbsp; so don't check it
Expand All @@ -19,10 +19,12 @@ Scenario('Setup choices config from start', (I) => {

I.click("Save");
I.click("Import Tasks");
I.waitInUrl("/import", 6);
I.waitInUrl("/import-old", 6);
I.click("Add Sample Task");
// empty table cell in the first row of data table
I.click(locate("td").after(locate("td").withText("0")));
I.wait(4);
/* TODO: Fix it for new data manager
I.click(locate("span").withText("Filters"));
I.dontSee("Update");
I.see("Submit");
Expand All @@ -31,4 +33,5 @@ Scenario('Setup choices config from start', (I) => {
I.see("Update");
I.dontSee("Submit");
I.seeCheckboxIsChecked("Positive");
*/
});
69 changes: 69 additions & 0 deletions e2e/tests/import-files.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
const assert = require("assert")

Feature("Import by upload")

Before(I => I.reset())

Scenario("Import images from list.txt", async (I) => {
I.amOnPage("/")
I.see("Welcome to")
I.seeNumberOfVisibleElements(locate("a").withText("Import"), 1)
I.click(locate("a.button").withText("Import"))
I.waitInUrl("/import")

I.say("Upload list of files")
I.attachFile("#file-input", "assets/list.txt")
I.see("4 tasks loaded")
I.click("Interpret each line")
I.see("1 tasks loaded")
I.click("Interpret each line")
I.click(locate("button").withText("Import"))

I.say("Redirect to DM with imported tasks")
I.see("Tab 1")
// table with imported items — should be only one already
I.see("Tasks: 4 / 4")
// images have no type yet, so no thumbnails are displayed, click just somewhere
I.click(".select-row + div")
I.see("Labeling is not yet fully configured")
I.click("Go to setup")

I.say("Config setup")
I.click("Bbox object detection")
I.waitForVisible(locate("div.button").withText("Proceed"))
I.click(locate("div.button").withText("Proceed"))
// config is validated on backend
I.wait(2)
I.click("Save")
I.click("Explore Tasks")

I.say("Work with task in DM")
// open the task
I.click("img[alt=Data]")
I.see("Airplane")
I.see("Regions (0)")
I.click("Skip")
// skipped icon in completions list
I.seeElement("[aria-label=stop]")
// completion date are filled in
const completed = await I.grabTextFrom(".table-row > div:nth-child(3)")
// there are 4 rows so array is returned
assert.notEqual(completed[0], "")
I.click("Back")

I.say("Check task status and remove all the tasks")
// both completions and skipped counts are equal to 1
// check only the first row (2nd after header)
I.seeTextEquals("1", ".row-wrapper:nth-child(2) .table-row > div:nth-child(4)")
I.seeTextEquals("1", ".row-wrapper:nth-child(2) .table-row > div:nth-child(5)")
// select task
I.click(".select-all input[type=checkbox]")
I.click("Delete tasks")
I.click("OK")
// @todo it fails sometimes so wait for fix
// empty state
// I.see("Looks like you have not imported any data yet")
// I.see("0 / 0")
// Back to origins
// I.click("Go to import")
})
Loading

0 comments on commit 7deadf4

Please sign in to comment.