Skip to content

Commit d8f44f7

Browse files
authored
Merge pull request #719 from Labelbox/develop
v.3.27.2
2 parents 402a617 + 8efb3d9 commit d8f44f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+344
-248
lines changed

.dockerignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
__pycache__/
2+
*.py[cod]
3+
*$py.class
4+
.Python
5+
env
6+
pip-log.txt
7+
pip-delete-this-directory.txt
8+
.tox
9+
.coverage
10+
.coverage.*
11+
.cache
12+
nosetests.xml
13+
coverage.xml
14+
*.cover
15+
*.log
16+
.git
17+
.mypy_cache
18+
.pytest_cache
19+
.hypothesis

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
# Version 3.27.2 (2022-10-04)
4+
5+
### Added
6+
* Added deprecation warning for missing `media_type` in `create_project` in `Client`.
7+
8+
### Changed
9+
* Updated docs for deprecated methods `_update_queue_mode` and `get_queue_mode` in `Project`
10+
* Use the `queue_mode` attribute in `Project` to get and set the queue mode instead
11+
* For more information, visit https://docs.labelbox.com/reference/migrating-to-workflows#upcoming-changes
12+
* Updated `project.export_labels` to support filtering by start/end time formats "YYYY-MM-DD" and "YYYY-MM-DD hh:mm:ss"
13+
14+
### Fixed
15+
316
# Version 3.27.1 (2022-09-16)
417
### Changed
518
* Removed `client.get_data_rows_for_global_keys` until further notice
@@ -17,7 +30,7 @@
1730
### Changed
1831
* Increase scalar metric value limit to 100m
1932
* Added deprecation warnings when updating project `queue_mode`
20-
## Fixed
33+
### Fixed
2134
* Fix bug in `feature_confusion_matrix` and `confusion_matrix` causing FPs and FNs to be capped at 1 when there were no matching annotations
2235

2336
# Version 3.26.2 (2022-09-06)

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ RUN apt install -y libsm6 \
1010
libgl1-mesa-glx \
1111
libgeos-dev
1212

13-
WORKDIR /usr/src/labelbox
14-
COPY requirements.txt /usr/src/labelbox
13+
WORKDIR /usr/src/
14+
COPY requirements.txt /usr/src/
1515
RUN pip install -r requirements.txt
16-
COPY . /usr/src/labelbox
16+
COPY . /usr/src/
1717

1818
RUN python setup.py install

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717

1818
# -- Project information -----------------------------------------------------
1919

20-
project = 'Labelbox Python API reference'
20+
project = 'Python SDK reference'
2121
copyright = '2021, Labelbox'
2222
author = 'Labelbox'
2323

24-
release = '3.27.1'
24+
release = '3.27.2'
2525

2626
# -- General configuration ---------------------------------------------------
2727

examples/annotation_import/basics.ipynb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
" ClassificationAnnotation, ClassificationAnswer\n",
117117
")\n",
118118
"from labelbox.data.serialization import NDJsonConverter\n",
119+
"from labelbox.schema.media_type import MediaType\n",
119120
"import uuid\n",
120121
"import json"
121122
]
@@ -203,8 +204,14 @@
203204
"])\n",
204205
"\n",
205206
"\n",
206-
"mal_project = client.create_project(name=\"image_mal_project\")\n",
207-
"li_project = client.create_project(name=\"image_label_import_project\")\n",
207+
"mal_project = client.create_project(\n",
208+
" name=\"image_mal_project\",\n",
209+
" media_type=MediaType.Image\n",
210+
")\n",
211+
"li_project = client.create_project(\n",
212+
" name=\"image_label_import_project\",\n",
213+
" media_type=MediaType.Image\n",
214+
")\n",
208215
"\n",
209216
"\n",
210217
"dataset = client.create_dataset(name=\"annotation_import_demo_dataset\")\n",

examples/annotation_import/image.ipynb

Lines changed: 51 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@
8181
"execution_count": 1,
8282
"id": "4d63074b-2379-48af-b9d6-2a66190f03c4",
8383
"metadata": {
84-
"id": "4d63074b-2379-48af-b9d6-2a66190f03c4",
8584
"colab": {
8685
"base_uri": "https://localhost:8080/"
8786
},
87+
"id": "4d63074b-2379-48af-b9d6-2a66190f03c4",
8888
"outputId": "2560882d-6542-4dda-c075-d197ef2da5e3"
8989
},
9090
"outputs": [
9191
{
92-
"output_type": "stream",
9392
"name": "stdout",
93+
"output_type": "stream",
9494
"text": [
9595
"\u001b[K |████████████████████████████████| 172 kB 9.3 MB/s \n",
9696
"\u001b[K |████████████████████████████████| 6.3 MB 15.2 MB/s \n",
@@ -130,6 +130,7 @@
130130
" ClassificationAnnotation, ClassificationAnswer\n",
131131
")\n",
132132
"from labelbox.data.serialization import NDJsonConverter\n",
133+
"from labelbox.schema.media_type import MediaType\n",
133134
"import uuid\n",
134135
"import json\n",
135136
"import numpy as np"
@@ -196,15 +197,15 @@
196197
},
197198
{
198199
"cell_type": "markdown",
200+
"id": "49i_juOUr6av",
201+
"metadata": {
202+
"id": "49i_juOUr6av"
203+
},
199204
"source": [
200205
"First, we create an ontology with all the possible tools and classifications supported for images. The official list of supported annotations to import can be found here:\n",
201206
"- [Model-Assisted Labeling](https://docs.labelbox.com/docs/model-assisted-labeling) (annotations/labels are not submitted)\n",
202207
"- [Ground Truth](https://docs.labelbox.com/docs/import-ground-truth) (annotations/labels are submitted)"
203-
],
204-
"metadata": {
205-
"id": "49i_juOUr6av"
206-
},
207-
"id": "49i_juOUr6av"
208+
]
208209
},
209210
{
210211
"cell_type": "code",
@@ -258,13 +259,13 @@
258259
},
259260
{
260261
"cell_type": "markdown",
261-
"source": [
262-
"To show the two different ways to upload annotations, we create two projects - one to showcase MAL (Model-Assisted Labeling) and one to showcase Label Import."
263-
],
262+
"id": "1GdimALBuzRU",
264263
"metadata": {
265264
"id": "1GdimALBuzRU"
266265
},
267-
"id": "1GdimALBuzRU"
266+
"source": [
267+
"To show the two different ways to upload annotations, we create two projects - one to showcase MAL (Model-Assisted Labeling) and one to showcase Label Import."
268+
]
268269
},
269270
{
270271
"cell_type": "code",
@@ -276,8 +277,14 @@
276277
"outputs": [],
277278
"source": [
278279
"# Create two Labelbox projects\n",
279-
"mal_project = client.create_project(name=\"image_mal_project\")\n",
280-
"li_project = client.create_project(name=\"image_label_import_project\")\n",
280+
"mal_project = client.create_project(\n",
281+
" name=\"image_mal_project\",\n",
282+
" media_type=MediaType.Image\n",
283+
")\n",
284+
"li_project = client.create_project(\n",
285+
" name=\"image_label_import_project\",\n",
286+
" media_type=MediaType.Image\n",
287+
")\n",
281288
"\n",
282289
"# Create one Labelbox dataset\n",
283290
"dataset = client.create_dataset(name=\"image_annotation_import_demo_dataset\")\n",
@@ -319,6 +326,12 @@
319326
},
320327
{
321328
"cell_type": "code",
329+
"execution_count": 33,
330+
"id": "qzBqhV4Pv3yp",
331+
"metadata": {
332+
"id": "qzBqhV4Pv3yp"
333+
},
334+
"outputs": [],
322335
"source": [
323336
"point_annotation=ObjectAnnotation(\n",
324337
" value=Point(x=882,y=159), # Coordinates for this point annotation\n",
@@ -363,13 +376,7 @@
363376
" ),\n",
364377
" name=\"mask\" # Name of the tool in your ontology\n",
365378
")"
366-
],
367-
"metadata": {
368-
"id": "qzBqhV4Pv3yp"
369-
},
370-
"id": "qzBqhV4Pv3yp",
371-
"execution_count": 33,
372-
"outputs": []
379+
]
373380
},
374381
{
375382
"cell_type": "markdown",
@@ -383,6 +390,12 @@
383390
},
384391
{
385392
"cell_type": "code",
393+
"execution_count": 34,
394+
"id": "f2RtQQPCymOB",
395+
"metadata": {
396+
"id": "f2RtQQPCymOB"
397+
},
398+
"outputs": [],
386399
"source": [
387400
"text_annotation=ClassificationAnnotation(\n",
388401
" value=Text( # String value for the text annotation\n",
@@ -409,13 +422,7 @@
409422
" ), \n",
410423
" name=\"radio\" # Name of the classification in your ontology\n",
411424
")"
412-
],
413-
"metadata": {
414-
"id": "f2RtQQPCymOB"
415-
},
416-
"id": "f2RtQQPCymOB",
417-
"execution_count": 34,
418-
"outputs": []
425+
]
419426
},
420427
{
421428
"cell_type": "markdown",
@@ -440,15 +447,14 @@
440447
},
441448
"outputs": [
442449
{
443-
"output_type": "stream",
444450
"name": "stderr",
451+
"output_type": "stream",
445452
"text": [
446453
"/usr/local/lib/python3.7/dist-packages/labelbox/data/annotation_types/classification/classification.py:85: UserWarning: Dropdown classification is deprecated and will be removed in a future release\n",
447454
" warnings.warn(\"Dropdown classification is deprecated and will be \"\n"
448455
]
449456
},
450457
{
451-
"output_type": "execute_result",
452458
"data": {
453459
"text/plain": [
454460
"{'annotations': [ObjectAnnotation(name='point', feature_schema_id=None, extra={}, value=Point(extra={}, x=882.0, y=159.0), classifications=[]),\n",
@@ -464,8 +470,9 @@
464470
" 'uid': None}"
465471
]
466472
},
473+
"execution_count": 35,
467474
"metadata": {},
468-
"execution_count": 35
475+
"output_type": "execute_result"
469476
}
470477
],
471478
"source": [
@@ -518,30 +525,29 @@
518525
},
519526
{
520527
"cell_type": "code",
521-
"source": [
522-
"import copy # We import this python package so we can create copies of our hard-coded annotations and upload one copy to each"
523-
],
528+
"execution_count": 16,
529+
"id": "0U_cA2Cw0pH1",
524530
"metadata": {
525531
"id": "0U_cA2Cw0pH1"
526532
},
527-
"id": "0U_cA2Cw0pH1",
528-
"execution_count": 16,
529-
"outputs": []
533+
"outputs": [],
534+
"source": [
535+
"import copy # We import this python package so we can create copies of our hard-coded annotations and upload one copy to each"
536+
]
530537
},
531538
{
532539
"cell_type": "code",
533540
"execution_count": 39,
534541
"id": "53aaf87b-114f-4b56-a417-8c7cddc1f532",
535542
"metadata": {
536-
"id": "53aaf87b-114f-4b56-a417-8c7cddc1f532",
537543
"colab": {
538544
"base_uri": "https://localhost:8080/"
539545
},
546+
"id": "53aaf87b-114f-4b56-a417-8c7cddc1f532",
540547
"outputId": "e525feac-9f8e-49e7-95d0-33932998b0bd"
541548
},
542549
"outputs": [
543550
{
544-
"output_type": "execute_result",
545551
"data": {
546552
"text/plain": [
547553
"[{'classifications': [],\n",
@@ -620,8 +626,9 @@
620626
" 'uuid': '7e92e01b-740d-48b4-935e-560ba0b63fa5'}]"
621627
]
622628
},
629+
"execution_count": 39,
623630
"metadata": {},
624-
"execution_count": 39
631+
"output_type": "execute_result"
625632
}
626633
],
627634
"source": [
@@ -663,8 +670,8 @@
663670
},
664671
"outputs": [
665672
{
666-
"output_type": "stream",
667673
"name": "stdout",
674+
"output_type": "stream",
668675
"text": [
669676
"Errors: []\n"
670677
]
@@ -702,15 +709,14 @@
702709
"execution_count": 36,
703710
"id": "e8d4e99b-ad7e-48b9-8073-afb764d7c5b4",
704711
"metadata": {
705-
"id": "e8d4e99b-ad7e-48b9-8073-afb764d7c5b4",
706712
"colab": {
707713
"base_uri": "https://localhost:8080/"
708714
},
715+
"id": "e8d4e99b-ad7e-48b9-8073-afb764d7c5b4",
709716
"outputId": "704fac54-8f45-46f0-ce2d-3769c5b11f23"
710717
},
711718
"outputs": [
712719
{
713-
"output_type": "execute_result",
714720
"data": {
715721
"text/plain": [
716722
"[{'classifications': [],\n",
@@ -789,8 +795,9 @@
789795
" 'uuid': 'f413b3a2-1e71-473c-b3b0-c952791284df'}]"
790796
]
791797
},
798+
"execution_count": 36,
792799
"metadata": {},
793-
"execution_count": 36
800+
"output_type": "execute_result"
794801
}
795802
],
796803
"source": [
@@ -832,8 +839,8 @@
832839
},
833840
"outputs": [
834841
{
835-
"output_type": "stream",
836842
"name": "stdout",
843+
"output_type": "stream",
837844
"text": [
838845
"Errors: []\n"
839846
]

examples/annotation_import/pdf_mal.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
" ClassificationAnnotation, ClassificationAnswer\n",
8989
")\n",
9090
"from labelbox.data.serialization import NDJsonConverter\n",
91+
"from labelbox.schema.media_type import MediaType\n",
9192
"import uuid\n",
9293
"import json"
9394
]
@@ -208,7 +209,7 @@
208209
"outputs": [],
209210
"source": [
210211
"# Create two Labelbox projects\n",
211-
"mal_project = client.create_project(name=\"pdf_mal_project\")\n",
212+
"mal_project = client.create_project(name=\"pdf_mal_project\", media_type=MediaType.Document)\n",
212213
"\n",
213214
"# Create one Labelbox dataset\n",
214215
"dataset = client.create_dataset(name=\"pdf_annotation_import_demo_dataset\")\n",

0 commit comments

Comments
 (0)