Skip to content

Commit 0396650

Browse files
committed
2 parents d5636b1 + 4807fc2 commit 0396650

25 files changed

+611
-66
lines changed

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ PYTHON=python3
44
PYLINT=pylint
55
PYTESTS=pytest
66
COVERAGE=coverage
7-
BROWSER=google-chrome
87

98
all: coverage tests
109
$(PYTHON) setup.py build_ext --inplace
@@ -25,15 +24,17 @@ clean:
2524
coverage: test_coverage
2625

2726
test_coverage:
28-
$(COVERAGE) run -m --source=./superannotate/ $(PYTESTS)
27+
$(PYTESTS) --cov=superannotate -n 8
2928
$(COVERAGE) html
3029
@echo "\033[95m\n\nCoverage successful! View the output at file://htmlcov/index.html.\n\033[0m"
3130

3231
install:
3332
pip install .
3433

3534
lint:
36-
-$(PYLINT) superannotate/
35+
-$(PYLINT) --output-format=json superannotate/ | pylint-json2html -o pylint.html
36+
37+
lint_tests:
3738
-$(PYLINT) tests/*
3839

3940
docs:

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ pip install 'git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&sub
2929
```
3030

3131

32-
The package officially supports Python 3.6+.
32+
The package officially supports Python 3.6+ and was tested under Linux platform.
33+
For Windows based Anaconda distribution
34+
you might also need to install *shapely* package separately:
35+
36+
```console
37+
conda install shapely
38+
```
3339

3440
For further steps please have a look at the [tutorial](https://superannotate.readthedocs.io/en/latest/tutorial.sdk.html).
3541

40.6 KB
Loading
25.3 KB
Loading

docs/source/benchmark_scatter.png

60.3 KB
Loading

docs/source/cli.rst

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ To upload images from folder to project use:
5050
If optional argument *recursive* is given then subfolders of :file:`<folder_path>` are also recursively
5151
scanned for available images.
5252

53-
Optional argument *extensions* accepts comma separated list of image extensions to look for. If the argument is not given then value *jpg,png* is assumed.
53+
Optional argument *extensions* accepts comma separated list of image extensions
54+
to look for. If the argument is not given then value *jpg,png* is assumed.
5455

5556
----------
5657

@@ -69,7 +70,7 @@ To upload videos from folder to project use:
6970
[--end-time <float>]
7071
7172
If optional argument *recursive* is given then subfolders of :file:`<folder_path>` are also recursively
72-
scanned for available images.
73+
scanned for available videos.
7374

7475
Optional argument *extensions* accepts comma separated list of image extensions
7576
to look for. If the argument is not given then value *mp4,avi,mov,webm,flv,mpg,ogg* is assumed.
@@ -83,6 +84,42 @@ default is 0.0.
8384
*end-time* specifies time (in seconds) up to which to extract frames.
8485
If it is not specified, then up to end is assumed.
8586

87+
----------
88+
89+
.. _ref_upload_preannotations:
90+
91+
Uploading preannotations
92+
~~~~~~~~~~~~~~~~~~~~~~~~
93+
94+
To upload preannotations from folder to project use:
95+
96+
.. code-block:: bash
97+
98+
superannotate upload-preannotations --project <project_name> --folder <folder_path>
99+
[--format "COCO" or "SA"] [--dataset-name "<dataset_name_for_COCO_projects>"]
100+
[--task "<task_type_for_COCO_projects>]
101+
102+
103+
Optional argument *format* accepts input preannotation format. It can have COCO or SuperAnnotate values.
104+
If the argument is not given then SuperAnnotate (the native preannotation format) assumed.
105+
106+
----------
107+
108+
.. _ref_upload_annotations:
109+
110+
Uploading annotations
111+
~~~~~~~~~~~~~~~~~~~~~~~~
112+
113+
To upload annotations from folder to project use:
114+
115+
.. code-block:: bash
116+
117+
superannotate upload-annotations --project <project_name> --folder <folder_path>
118+
[--format "COCO" or "SA"] [--dataset-name "<dataset_name_for_COCO_projects>"]
119+
[--task "<task_type_for_COCO_projects>]
120+
121+
Optional argument *format* accepts input preannotation format. It can have COCO or SuperAnnotate values.
122+
If the argument is not given then SuperAnnotate (the native preannotation format) assumed.
86123

87124
----------
88125

docs/source/index.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@ for COCO annotation format converters support also need to install:
5454
pip install 'git+https://github.com/cocodataset/panopticapi.git'
5555
pip install 'git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI'
5656
57-
The package officially supports Python 3.6+.
57+
The package officially supports Python 3.6+ and was tested under Linux platform.
58+
For Windows based Anaconda distribution
59+
you might also need to install :py:obj:`shapely` package separately:
60+
61+
.. code-block:: bash
62+
63+
conda install shapely
5864
5965
For further steps please have a look at the :ref:`tutorial <ref_tutorial>`.
6066

docs/source/superannotate.sdk.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ________
2323
.. _ref_search_projects:
2424
.. autofunction:: superannotate.search_projects
2525
.. autofunction:: superannotate.create_project
26+
.. autofunction:: superannotate.clone_project
2627
.. autofunction:: superannotate.create_project_like_project
2728
.. autofunction:: superannotate.delete_project
2829
.. autofunction:: superannotate.rename_project
@@ -322,3 +323,5 @@ Utility functions
322323
--------------------------------
323324

324325
.. autofunction:: superannotate.dicom_to_rgb_sequence
326+
.. autofunction:: superannotate.consensus
327+
.. autofunction:: superannotate.benchmark

docs/source/tutorial.sdk.rst

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ for COCO annotation format converters support also need to install:
2424
pip install 'git+https://github.com/cocodataset/panopticapi.git'
2525
pip install 'git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI'
2626
27-
The package officially supports Python 3.6+.
27+
The package officially supports Python 3.6+ and was tested under Linux platform.
28+
For Windows based Anaconda distribution
29+
you might also need to install :py:obj:`shapely` package separately:
30+
31+
.. code-block:: bash
32+
33+
conda install shapely
2834
2935
----------
3036

@@ -538,4 +544,45 @@ Analogically the box plots of consensus scores for each project are colored acco
538544
Scatter plot of consensus score vs instance area is separated by projects. Hovering on a point reveals its annotator and image name.
539545
The points are colored according to class name. Each annotator is represented with separate symbol.
540546

541-
.. image:: consensus_scatter.png
547+
.. image:: consensus_scatter.png
548+
549+
----------
550+
551+
552+
Computing benchmark scores for instances between ground truth project and given project list
553+
____________________________________________________________________________________________
554+
555+
556+
Benchmark is a tool to compare the quallity of the annotations of the same image that is present in several projects with
557+
the ground truth annotation of the same image that is in a separate project.
558+
559+
To compute the benchmark scores:
560+
561+
.. code-block:: python
562+
563+
res_df = sa.benchmark("<ground_truth_project_name>",[project_names], "<path_to_export_folder>", [image_list], "<annotation_type>")
564+
565+
Here pandas DataFrame with exactly same structure as in case of consensus computation is returned.
566+
567+
Besides the pandas DataFrame there is an option to get the following plots by setting the show_plots flag to True:
568+
569+
* Box plot of benchmark scores for each annotators
570+
* Box plot of benchmark scores for each project
571+
* Scatter plots of benchmark score vs instance area for each project
572+
573+
.. code-block:: python
574+
575+
sa.benchmark("<ground_truth_project_name>", [project_names], "<path_to_export_folder>", [image_list], "<annotation_type>", show_plots=True)
576+
577+
To the left of each box plot the original score points of that annotator is depicted, the box plots are colored by annotator.
578+
579+
.. image:: benchmark_annotators_box.png
580+
581+
Analogically the box plots of benchmark scores for each project are colored according to project name.
582+
583+
.. image:: benchmark_projects_box.png
584+
585+
Scatter plot of benchmark score vs instance area is separated by projects. Hovering on a point reveals its annotator and image name.
586+
The points are colored according to class name. Each annotator is represented with separate symbol.
587+
588+
.. image:: benchmark_scatter.png

install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ pip install 'git+https://github.com/cocodataset/panopticapi.git'
1616
pip install 'git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI'
1717

1818
pip install -e .
19+
# pip install superannotate
1920

2021
# for testing
21-
pip install pytest pytest-xdist
22+
pip install pytest pytest-xdist coverage pytest-cov pylint pylint-json2html
2223

2324
# for docs
2425
pip install sphinx sphinx_rtd_theme

0 commit comments

Comments
 (0)