Skip to content

Commit

Permalink
Merge pull request #719 from Labelbox/develop
Browse files Browse the repository at this point in the history
v.3.27.2
  • Loading branch information
jtsodapop authored Oct 4, 2022
2 parents 402a617 + 8efb3d9 commit d8f44f7
Show file tree
Hide file tree
Showing 43 changed files with 344 additions and 248 deletions.
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
__pycache__/
*.py[cod]
*$py.class
.Python
env
pip-log.txt
pip-delete-this-directory.txt
.tox
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.log
.git
.mypy_cache
.pytest_cache
.hypothesis
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

# Version 3.27.2 (2022-10-04)

### Added
* Added deprecation warning for missing `media_type` in `create_project` in `Client`.

### Changed
* Updated docs for deprecated methods `_update_queue_mode` and `get_queue_mode` in `Project`
* Use the `queue_mode` attribute in `Project` to get and set the queue mode instead
* For more information, visit https://docs.labelbox.com/reference/migrating-to-workflows#upcoming-changes
* Updated `project.export_labels` to support filtering by start/end time formats "YYYY-MM-DD" and "YYYY-MM-DD hh:mm:ss"

### Fixed

# Version 3.27.1 (2022-09-16)
### Changed
* Removed `client.get_data_rows_for_global_keys` until further notice
Expand All @@ -17,7 +30,7 @@
### Changed
* Increase scalar metric value limit to 100m
* Added deprecation warnings when updating project `queue_mode`
## Fixed
### Fixed
* Fix bug in `feature_confusion_matrix` and `confusion_matrix` causing FPs and FNs to be capped at 1 when there were no matching annotations

# Version 3.26.2 (2022-09-06)
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ RUN apt install -y libsm6 \
libgl1-mesa-glx \
libgeos-dev

WORKDIR /usr/src/labelbox
COPY requirements.txt /usr/src/labelbox
WORKDIR /usr/src/
COPY requirements.txt /usr/src/
RUN pip install -r requirements.txt
COPY . /usr/src/labelbox
COPY . /usr/src/

RUN python setup.py install
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

# -- Project information -----------------------------------------------------

project = 'Labelbox Python API reference'
project = 'Python SDK reference'
copyright = '2021, Labelbox'
author = 'Labelbox'

release = '3.27.1'
release = '3.27.2'

# -- General configuration ---------------------------------------------------

Expand Down
11 changes: 9 additions & 2 deletions examples/annotation_import/basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
" ClassificationAnnotation, ClassificationAnswer\n",
")\n",
"from labelbox.data.serialization import NDJsonConverter\n",
"from labelbox.schema.media_type import MediaType\n",
"import uuid\n",
"import json"
]
Expand Down Expand Up @@ -203,8 +204,14 @@
"])\n",
"\n",
"\n",
"mal_project = client.create_project(name=\"image_mal_project\")\n",
"li_project = client.create_project(name=\"image_label_import_project\")\n",
"mal_project = client.create_project(\n",
" name=\"image_mal_project\",\n",
" media_type=MediaType.Image\n",
")\n",
"li_project = client.create_project(\n",
" name=\"image_label_import_project\",\n",
" media_type=MediaType.Image\n",
")\n",
"\n",
"\n",
"dataset = client.create_dataset(name=\"annotation_import_demo_dataset\")\n",
Expand Down
95 changes: 51 additions & 44 deletions examples/annotation_import/image.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@
"execution_count": 1,
"id": "4d63074b-2379-48af-b9d6-2a66190f03c4",
"metadata": {
"id": "4d63074b-2379-48af-b9d6-2a66190f03c4",
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "4d63074b-2379-48af-b9d6-2a66190f03c4",
"outputId": "2560882d-6542-4dda-c075-d197ef2da5e3"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[K |████████████████████████████████| 172 kB 9.3 MB/s \n",
"\u001b[K |████████████████████████████████| 6.3 MB 15.2 MB/s \n",
Expand Down Expand Up @@ -130,6 +130,7 @@
" ClassificationAnnotation, ClassificationAnswer\n",
")\n",
"from labelbox.data.serialization import NDJsonConverter\n",
"from labelbox.schema.media_type import MediaType\n",
"import uuid\n",
"import json\n",
"import numpy as np"
Expand Down Expand Up @@ -196,15 +197,15 @@
},
{
"cell_type": "markdown",
"id": "49i_juOUr6av",
"metadata": {
"id": "49i_juOUr6av"
},
"source": [
"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",
"- [Model-Assisted Labeling](https://docs.labelbox.com/docs/model-assisted-labeling) (annotations/labels are not submitted)\n",
"- [Ground Truth](https://docs.labelbox.com/docs/import-ground-truth) (annotations/labels are submitted)"
],
"metadata": {
"id": "49i_juOUr6av"
},
"id": "49i_juOUr6av"
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -258,13 +259,13 @@
},
{
"cell_type": "markdown",
"source": [
"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."
],
"id": "1GdimALBuzRU",
"metadata": {
"id": "1GdimALBuzRU"
},
"id": "1GdimALBuzRU"
"source": [
"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."
]
},
{
"cell_type": "code",
Expand All @@ -276,8 +277,14 @@
"outputs": [],
"source": [
"# Create two Labelbox projects\n",
"mal_project = client.create_project(name=\"image_mal_project\")\n",
"li_project = client.create_project(name=\"image_label_import_project\")\n",
"mal_project = client.create_project(\n",
" name=\"image_mal_project\",\n",
" media_type=MediaType.Image\n",
")\n",
"li_project = client.create_project(\n",
" name=\"image_label_import_project\",\n",
" media_type=MediaType.Image\n",
")\n",
"\n",
"# Create one Labelbox dataset\n",
"dataset = client.create_dataset(name=\"image_annotation_import_demo_dataset\")\n",
Expand Down Expand Up @@ -319,6 +326,12 @@
},
{
"cell_type": "code",
"execution_count": 33,
"id": "qzBqhV4Pv3yp",
"metadata": {
"id": "qzBqhV4Pv3yp"
},
"outputs": [],
"source": [
"point_annotation=ObjectAnnotation(\n",
" value=Point(x=882,y=159), # Coordinates for this point annotation\n",
Expand Down Expand Up @@ -363,13 +376,7 @@
" ),\n",
" name=\"mask\" # Name of the tool in your ontology\n",
")"
],
"metadata": {
"id": "qzBqhV4Pv3yp"
},
"id": "qzBqhV4Pv3yp",
"execution_count": 33,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -383,6 +390,12 @@
},
{
"cell_type": "code",
"execution_count": 34,
"id": "f2RtQQPCymOB",
"metadata": {
"id": "f2RtQQPCymOB"
},
"outputs": [],
"source": [
"text_annotation=ClassificationAnnotation(\n",
" value=Text( # String value for the text annotation\n",
Expand All @@ -409,13 +422,7 @@
" ), \n",
" name=\"radio\" # Name of the classification in your ontology\n",
")"
],
"metadata": {
"id": "f2RtQQPCymOB"
},
"id": "f2RtQQPCymOB",
"execution_count": 34,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -440,15 +447,14 @@
},
"outputs": [
{
"output_type": "stream",
"name": "stderr",
"output_type": "stream",
"text": [
"/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",
" warnings.warn(\"Dropdown classification is deprecated and will be \"\n"
]
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"{'annotations': [ObjectAnnotation(name='point', feature_schema_id=None, extra={}, value=Point(extra={}, x=882.0, y=159.0), classifications=[]),\n",
Expand All @@ -464,8 +470,9 @@
" 'uid': None}"
]
},
"execution_count": 35,
"metadata": {},
"execution_count": 35
"output_type": "execute_result"
}
],
"source": [
Expand Down Expand Up @@ -518,30 +525,29 @@
},
{
"cell_type": "code",
"source": [
"import copy # We import this python package so we can create copies of our hard-coded annotations and upload one copy to each"
],
"execution_count": 16,
"id": "0U_cA2Cw0pH1",
"metadata": {
"id": "0U_cA2Cw0pH1"
},
"id": "0U_cA2Cw0pH1",
"execution_count": 16,
"outputs": []
"outputs": [],
"source": [
"import copy # We import this python package so we can create copies of our hard-coded annotations and upload one copy to each"
]
},
{
"cell_type": "code",
"execution_count": 39,
"id": "53aaf87b-114f-4b56-a417-8c7cddc1f532",
"metadata": {
"id": "53aaf87b-114f-4b56-a417-8c7cddc1f532",
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "53aaf87b-114f-4b56-a417-8c7cddc1f532",
"outputId": "e525feac-9f8e-49e7-95d0-33932998b0bd"
},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"[{'classifications': [],\n",
Expand Down Expand Up @@ -620,8 +626,9 @@
" 'uuid': '7e92e01b-740d-48b4-935e-560ba0b63fa5'}]"
]
},
"execution_count": 39,
"metadata": {},
"execution_count": 39
"output_type": "execute_result"
}
],
"source": [
Expand Down Expand Up @@ -663,8 +670,8 @@
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
"Errors: []\n"
]
Expand Down Expand Up @@ -702,15 +709,14 @@
"execution_count": 36,
"id": "e8d4e99b-ad7e-48b9-8073-afb764d7c5b4",
"metadata": {
"id": "e8d4e99b-ad7e-48b9-8073-afb764d7c5b4",
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "e8d4e99b-ad7e-48b9-8073-afb764d7c5b4",
"outputId": "704fac54-8f45-46f0-ce2d-3769c5b11f23"
},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"[{'classifications': [],\n",
Expand Down Expand Up @@ -789,8 +795,9 @@
" 'uuid': 'f413b3a2-1e71-473c-b3b0-c952791284df'}]"
]
},
"execution_count": 36,
"metadata": {},
"execution_count": 36
"output_type": "execute_result"
}
],
"source": [
Expand Down Expand Up @@ -832,8 +839,8 @@
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
"Errors: []\n"
]
Expand Down
3 changes: 2 additions & 1 deletion examples/annotation_import/pdf_mal.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
" ClassificationAnnotation, ClassificationAnswer\n",
")\n",
"from labelbox.data.serialization import NDJsonConverter\n",
"from labelbox.schema.media_type import MediaType\n",
"import uuid\n",
"import json"
]
Expand Down Expand Up @@ -208,7 +209,7 @@
"outputs": [],
"source": [
"# Create two Labelbox projects\n",
"mal_project = client.create_project(name=\"pdf_mal_project\")\n",
"mal_project = client.create_project(name=\"pdf_mal_project\", media_type=MediaType.Document)\n",
"\n",
"# Create one Labelbox dataset\n",
"dataset = client.create_dataset(name=\"pdf_annotation_import_demo_dataset\")\n",
Expand Down
Loading

0 comments on commit d8f44f7

Please sign in to comment.