Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
03f72fc
Update CHANGELOG.md
Nov 9, 2020
c3350bf
Update CHANGELOG.md
Nov 9, 2020
e6d9f16
Update setup.py
Nov 9, 2020
29b8938
Revert "Update setup.py"
Feb 15, 2021
d703104
Revert "Update CHANGELOG.md"
Feb 15, 2021
e9e94eb
Revert "Update CHANGELOG.md"
Feb 15, 2021
55c3b3c
Merge pull request #109 from Labelbox/develop
msokoloff1 Feb 15, 2021
97b4a5a
Merge pull request #107 from Labelbox/master-fix
msokoloff1 Feb 15, 2021
dab5d9e
Merge pull request #113 from Labelbox/develop
msokoloff1 Mar 9, 2021
ba990b3
Merge pull request #120 from Labelbox/develop
msokoloff1 Mar 15, 2021
ba5a500
Merge pull request #122 from Labelbox/develop
msokoloff1 Mar 15, 2021
4bf87e0
Merge pull request #128 from Labelbox/develop
msokoloff1 Mar 29, 2021
13bdba8
Merge pull request #132 from Labelbox/develop
msokoloff1 Apr 1, 2021
1d02e9c
Merge pull request #142 from Labelbox/develop
msokoloff1 Apr 22, 2021
464e218
generalize color rgb
Apr 27, 2021
e129fab
Merge pull request #155 from Labelbox/develop
msokoloff1 May 17, 2021
8c0c935
Merge pull request #159 from Labelbox/develop
msokoloff1 May 20, 2021
25144b7
wip
Jun 7, 2021
7863082
replace asset metadata with attachments
Jun 9, 2021
6c3ed54
minor changes
Jun 9, 2021
543c534
rename parama
Jun 9, 2021
679c2dd
reorder imports
Jun 9, 2021
dddfcde
update requirements
Jun 9, 2021
b08b3f1
yapf
Jun 9, 2021
0b19391
Merge pull request #152 from Labelbox/edit_mask_ndjson
msokoloff1 Jun 11, 2021
3af6a11
Merge pull request #165 from Labelbox/ms/update-requirements
msokoloff1 Jun 11, 2021
c633cff
Merge pull request #164 from Labelbox/ms/metadata-to-attachment
msokoloff1 Jun 11, 2021
18e83e9
prep for release
Jun 11, 2021
6983bfb
Merge pull request #170 from Labelbox/release-2.6.0
msokoloff1 Jun 11, 2021
dbbe2d8
Merge pull request #172 from Labelbox/develop
msokoloff1 Jun 11, 2021
06ee896
Merge branch 'master' of https://github.com/Labelbox/labelbox-python …
Jun 16, 2021
db3b3c6
update notebook
Jun 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
# Changelog

# Next mea release
* Added `ModelRun.annotation_groups()` to fetch data rows and label information for a model run

# Version 2.6b0+mea (2021-06-16)
## Added
* `ModelRun.annotation_groups()` to fetch data rows and label information for a model run


# Version 2.6.0 (2021-06-11)
## Fix
* Upated `create_mask_ndjson` helper function in `image_mal.ipynb` to use the color arg
instead of a hardcoded color.

## Added
* asset_metadata is now deprecated and has been replaced with asset_attachments
* `AssetAttachment` replaces `AssetMetadata` ( see definition for updated attribute names )
* Use `DataRow.attachments()` instead of `DataRow.metadata()`
* Use `DataRow.create_attachment()` instead of `DataRow.create_metadata()`
* Update pydantic version

# Version 2.5b0+mea (2021-06-11)
## Added
Expand All @@ -11,6 +26,7 @@
* Added notebook to demonstrate how to use MEA
* Added `datarow_miou` for calculating datarow level iou scores


# Version 2.5.6 (2021-05-19)
## Fix
* MAL validation no longer raises exception when NER tool has same start and end location
Expand Down
62 changes: 31 additions & 31 deletions examples/basics/data_rows.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "posted-nation",
"metadata": {},
"outputs": [],
Expand All @@ -34,7 +34,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"id": "beautiful-ready",
"metadata": {},
"outputs": [],
Expand All @@ -47,7 +47,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"id": "vertical-stockholm",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -78,21 +78,21 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"id": "rural-fellow",
"metadata": {},
"outputs": [],
"source": [
"# Pick a project that has a dataset attached, data has external ids, and there are some labels\n",
"# This will modify the project so just pick a dummy one that you don't care about\n",
"PROJECT_ID = \"ckk4q1viuc0w20704eh69u28h\"\n",
"PROJECT_ID = \"ckpnfquwy0kyg0y8t9rwb99cz\"\n",
"# Only update this if you have an on-prem deployment\n",
"ENDPOINT = \"https://api.labelbox.com/graphql\""
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"id": "proof-detective",
"metadata": {},
"outputs": [],
Expand All @@ -102,7 +102,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"id": "selective-reconstruction",
"metadata": {},
"outputs": [],
Expand All @@ -123,7 +123,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 6,
"id": "extra-paris",
"metadata": {},
"outputs": [],
Expand All @@ -134,17 +134,17 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 7,
"id": "packed-going",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Associated dataset <Dataset {'created_at': datetime.datetime(2021, 3, 28, 23, 35, 34, tzinfo=datetime.timezone.utc), 'description': '', 'name': 'image_mal_dataset', 'uid': 'ckmtsvzps21f80y6205t304se', 'updated_at': datetime.datetime(2021, 3, 28, 23, 35, 34, tzinfo=datetime.timezone.utc)}>\n",
"Associated label(s) <Label {'agreement': None, 'benchmark_agreement': None, 'created_at': datetime.datetime(2021, 3, 29, 17, 53, 36, tzinfo=datetime.timezone.utc), 'is_benchmark_reference': False, 'label': '{\"objects\":[{\"featureId\":\"ckmuw40nm00013g68kfua4i88\",\"schemaId\":\"ckk4q1vo80nhv0y92b7vgctgt\",\"title\":\"Frog\",\"value\":\"frog\",\"color\":\"#00D4FF\",\"bbox\":{\"top\":815,\"left\":847,\"height\":247,\"width\":512},\"instanceURI\":\"https://api.labelbox.com/masks/feature/ckmuw40nm00013g68kfua4i88\"}],\"classifications\":[]}', 'seconds_to_label': 0, 'uid': 'ckmuw42qy00033g68zdhpove7', 'updated_at': datetime.datetime(2021, 3, 29, 17, 54, 32, tzinfo=datetime.timezone.utc)}>\n",
"External id dbb168f6-4f2c-46e0-a22a-abc837fda3f1\n"
"Associated dataset <Dataset {'created_at': datetime.datetime(2021, 6, 8, 2, 40, 10, tzinfo=datetime.timezone.utc), 'description': '', 'name': 'image_mea_dataset', 'uid': 'ckpnfqv6g1rvb0ybt85hjephs', 'updated_at': datetime.datetime(2021, 6, 8, 2, 40, 10, tzinfo=datetime.timezone.utc)}>\n",
"Associated label(s) <Label {'agreement': None, 'benchmark_agreement': None, 'created_at': datetime.datetime(2021, 6, 8, 2, 42, 11, tzinfo=datetime.timezone.utc), 'is_benchmark_reference': False, 'label': '{\"objects\":[{\"featureId\":\"ckpnftdgo00013h693jxji4wa\",\"schemaId\":\"ckpnfqw600kyt0y8tgwsb01xg\",\"title\":\"person\",\"value\":\"person\",\"color\":\"#ff0000\",\"bbox\":{\"top\":1044,\"left\":1460,\"height\":265,\"width\":118},\"instanceURI\":\"https://api.labelbox.com/masks/feature/ckpnftdgo00013h693jxji4wa\"},{\"featureId\":\"ckpo2bsq800013h69mi1w6xz1\",\"schemaId\":\"ckpnfqw610kyx0y8t4hotc6ld\",\"title\":\"car\",\"value\":\"car\",\"color\":\"#00ffff\",\"instanceURI\":\"https://api.labelbox.com/masks/feature/ckpo2bsq800013h69mi1w6xz1\"}],\"classifications\":[]}', 'seconds_to_label': 101.633, 'uid': 'ckpnftgpx00033h69z83erv92', 'updated_at': datetime.datetime(2021, 6, 9, 0, 51, 34, tzinfo=datetime.timezone.utc)}>\n",
"External id 3b983504-bfbd-4c26-8719-8ef2d5a2c14f\n"
]
}
],
Expand All @@ -157,15 +157,15 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 8,
"id": "above-vocabulary",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<DataRow {'created_at': datetime.datetime(2021, 3, 28, 23, 35, 35, tzinfo=datetime.timezone.utc), 'external_id': 'dbb168f6-4f2c-46e0-a22a-abc837fda3f1', 'row_data': 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/08/Kitano_Street_Kobe01s5s4110.jpg/2560px-Kitano_Street_Kobe01s5s4110.jpg', 'uid': 'ckmtsvzx421fb0y62bbsmbavz', 'updated_at': datetime.datetime(2021, 3, 29, 17, 54, 56, tzinfo=datetime.timezone.utc)}>\n"
"<DataRow {'created_at': datetime.datetime(2021, 6, 8, 2, 40, 10, tzinfo=datetime.timezone.utc), 'external_id': '3b983504-bfbd-4c26-8719-8ef2d5a2c14f', 'media_attributes': {'width': 2560, 'height': 1707, 'mimeType': 'image/jpeg'}, 'row_data': 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/08/Kitano_Street_Kobe01s5s4110.jpg/2560px-Kitano_Street_Kobe01s5s4110.jpg', 'uid': 'ckpnfqvcb0t2o0yane73d3whi', 'updated_at': datetime.datetime(2021, 6, 9, 0, 51, tzinfo=datetime.timezone.utc)}>\n"
]
}
],
Expand All @@ -185,17 +185,17 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 9,
"id": "medical-portuguese",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<DataRow ID: ckmuw60q700ur0y8wcu178hbi>"
"<DataRow ID: ckporcoee1c7s0z7fha6l5x0d>"
]
},
"execution_count": 14,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -213,7 +213,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 10,
"id": "round-perfume",
"metadata": {},
"outputs": [],
Expand All @@ -228,7 +228,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 11,
"id": "breeding-brother",
"metadata": {},
"outputs": [],
Expand All @@ -243,7 +243,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 12,
"id": "thrown-designation",
"metadata": {},
"outputs": [],
Expand All @@ -256,7 +256,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 13,
"id": "japanese-jefferson",
"metadata": {},
"outputs": [],
Expand All @@ -272,7 +272,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 14,
"id": "accessible-effort",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -304,15 +304,15 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 15,
"id": "floral-elimination",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"18201a8d-34a5-41ea-8ea0-feede9776b4a 18201a8d-34a5-41ea-8ea0-feede9776b4a\n"
"337e90de-c13c-48be-a87d-94d331b5e9a7 337e90de-c13c-48be-a87d-94d331b5e9a7\n"
]
}
],
Expand All @@ -325,28 +325,28 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 16,
"id": "collect-cosmetic",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AssetMetadata ID: ckmuw6mme5mpr0y839dzheh7c>"
"<AssetAttachment ID: ckporcvj61dni0y632e6cb217>"
]
},
"execution_count": 21,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# We can also create attachments\n",
"# Attachments are visible for all projects connected to the data_row \n",
"data_row.create_metadata(meta_type=\"TEXT\", meta_value=\"LABELERS WILL SEE THIS \")\n",
"data_row.create_attachment(attachment_type=\"TEXT\", attachment_value=\"LABELERS WILL SEE THIS \")\n",
"# See more information here:\n",
"# https://docs.labelbox.com/data-model/en/index-en#attachments\n",
"# Note that meta_value must always be a string (url to a video/image or a text value to display)"
"# Note that attachment_value must always be a string (url to a video/image or a text value to display)"
]
},
{
Expand All @@ -359,7 +359,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 17,
"id": "dental-banana",
"metadata": {},
"outputs": [],
Expand All @@ -370,7 +370,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 18,
"id": "binary-organic",
"metadata": {},
"outputs": [],
Expand Down
4 changes: 2 additions & 2 deletions examples/model_assisted_labeling/image_mal.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@
" },\n",
" \"mask\": {\n",
" \"instanceURI\": url,\n",
" \"colorRGB\": [255, 0, 0]\n",
" \"colorRGB\": color\n",
" }\n",
" }\n",
" return result\n",
Expand Down Expand Up @@ -553,4 +553,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
10 changes: 7 additions & 3 deletions examples/model_assisted_labeling/image_mea.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install labelbox==2.5b0 \\\n",
"!pip install labelbox==2.6b0 \\\n",
" requests \\\n",
" ndjson \\\n",
" scikit-image \\\n",
Expand Down Expand Up @@ -63,7 +63,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "committed-richards",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -421,7 +421,11 @@
"id": "velvet-bread",
"metadata": {},
"outputs": [],
"source": []
"source": [
"# View the uploaded predictions and labels (annotation group) in the web app\n",
"annotation_group = next(model_run.annotation_groups())\n",
"print(annotation_group.url)"
]
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion labelbox/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "labelbox"
__version__ = "2.5b0"
__version__ = "2.6b0"

from labelbox.client import Client
from labelbox.schema.model import Model
Expand Down
5 changes: 4 additions & 1 deletion labelbox/orm/db_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ def __init__(self, source, relationship, value=None):
def __call__(self, *args, **kwargs):
""" Forwards the call to either `_to_many` or `_to_one` methods,
depending on relationship type. """

if self.relationship.deprecation_warning:
logger.warning(self.relationship.deprecation_warning)

if self.relationship.relationship_type == Relationship.Type.ToMany:
return self._to_many(*args, **kwargs)
else:
Expand All @@ -130,7 +134,6 @@ def _to_many(self, where=None, order_by=None):
iterable over destination DbObject instances.
"""
rel = self.relationship

if where is not None and not self.supports_filtering:
raise InvalidQueryError(
"Relationship %s.%s doesn't support filtering" %
Expand Down
Loading