Skip to content

Commit 3a78bdc

Browse files
authored
Merge pull request #821 from Labelbox/develop
3.34.0
2 parents bf841f8 + ad20f4d commit 3a78bdc

23 files changed

+2600
-96
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
# Version 3.34.0 (2022-12-22)
4+
### Added
5+
* Added `get_by_name()` method to MetadataOntology object to access both custom and reserved metadata by name.
6+
* Added support for adding metadata by name when creating datarows using `DataRowMetadataOntology.bulk_upsert()`.
7+
* Added support for adding metadata by name when creating datarows using `Dataset.create_data_rows()`, `Dataset.create_data_rows_sync()`, and `Dataset.create_data_row()`.
8+
* Example notebooks for auto metrics in models
9+
10+
11+
### Changed
12+
* `Dataset.create_data_rows()` max limit of DataRows increased to 150,000
13+
* Improved error handling for invalid annotation import content
14+
* String metadata can now be 1024 characters long (from 500)
15+
16+
## Fixed
17+
* Broken urls in detectron notebook
18+
319
# Version 3.33.1 (2022-12-14)
420
### Fixed
521
* Fixed where batch creation limit was still limiting # of data rows. SDK should now support creating batches with up to 100k data rows

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
copyright = '2021, Labelbox'
2222
author = 'Labelbox'
2323

24-
release = '3.33.1'
24+
release = '3.34.0'
2525

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

examples/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ Learn more about annotation types in the [docs](https://docs.labelbox.com/docs/a
7474
| Webhooks | [Github](project_configuration/webhooks.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/project_configuration/webhooks.ipynb) | [Docs](https://docs.labelbox.com/docs/webhooks) |
7575

7676

77+
## [Prediction Upload to a Model Run](prediction_upload)
78+
79+
80+
| Notebook | Github | Google Colab | Learn more |
81+
| --------------------------- | --------------------------------- | ------------ | ---------- |
82+
| Image Prediction upload | [Github](prediction_upload/image_predictions.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/prediction_upload/image_predictions.ipynb) | [Docs](https://docs.labelbox.com/docs/upload-model_predictions) |
83+
| Text Prediction upload | [Github](prediction_upload/text_predictions.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/prediction_upload/text_predictions.ipynb) | [Docs](https://docs.labelbox.com/docs/upload-model_predictions) |
84+
85+
------
86+
7787

7888
## [Model Diagnostics](model_diagnostics)
7989
| Notebook | Github | Google Colab | Learn more |

examples/annotation_import/conversational.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
"outputs": [],
206206
"source": [
207207
"# Create Labelbox project\n",
208-
"mal_project = client.create_project(name=\"conversational_mal_project\", media_type=MediaType.Document)\n",
208+
"mal_project = client.create_project(name=\"conversational_mal_project\", media_type=MediaType.Conversational)\n",
209209
"\n",
210210
"# Create one Labelbox dataset\n",
211211
"dataset = client.create_dataset(name=\"conversational_annotation_import_demo_dataset\")\n",
@@ -220,7 +220,8 @@
220220
"editor = next(client.get_labeling_frontends(where=LabelingFrontend.name == \"Editor\")) # Unless using a custom editor, do not modify this\n",
221221
"\n",
222222
"mal_project.setup(editor, ontology_builder.asdict()) # Connect your ontology and editor to your MAL project\n",
223-
"mal_project.datasets.connect(dataset) # Connect your dataset to your MAL project"
223+
"\n",
224+
"mal_project.create_batch('initial-batch', [data_row]) # Create a batch to start labelling"
224225
]
225226
},
226227
{

examples/basics/data_row_metadata.ipynb

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"source": [
4040
"# Data Row Metadata\n",
4141
"\n",
42-
"Metadata is useful to be better understand data on the platform to help with labeling review, model diagnostics, and data selection. This **should not be confused with attachments**. Attachments provide additional context for labelers but is not searchable within Catalog."
42+
"Metadata is useful to better understand data on the platform to help with labeling review, model diagnostics, and data selection. This **should not be confused with attachments**. Attachments provide additional context for labelers but is not searchable within Catalog."
4343
]
4444
},
4545
{
@@ -261,21 +261,20 @@
261261
"source": [
262262
"# Construct a metadata field of string kind\n",
263263
"tag_metadata_field = DataRowMetadataField(\n",
264-
" schema_id=mdo.reserved_by_name[\"tag\"].uid, # specify the schema id\n",
264+
" name=\"tag\", # specify the schema name\n",
265265
" value=\"tag_string\", # typed inputs\n",
266266
")\n",
267267
"\n",
268268
"# Construct an metadata field of datetime kind\n",
269269
"capture_datetime_field = DataRowMetadataField(\n",
270-
" schema_id=mdo.reserved_by_name[\"captureDateTime\"].uid, # specify the schema id\n",
270+
" name=\"captureDateTime\", # specify the schema id\n",
271271
" value=datetime.utcnow(), # typed inputs\n",
272272
")\n",
273273
"\n",
274274
"# Construct a metadata field of Enums options\n",
275-
"train_schema = mdo.reserved_by_name[\"split\"][\"train\"]\n",
276275
"split_metadta_field = DataRowMetadataField(\n",
277-
" schema_id=train_schema.parent, # specify the schema id\n",
278-
" value=train_schema.uid, # typed inputs\n",
276+
" name=\"split\", # specify the schema id\n",
277+
" value=\"train\", # typed inputs\n",
279278
")"
280279
]
281280
},
@@ -300,20 +299,20 @@
300299
"source": [
301300
"# Construct a dictionary of string metadata\n",
302301
"tag_metadata_field_dict = {\n",
303-
" \"schema_id\": mdo.reserved_by_name[\"tag\"].uid,\n",
302+
" \"name\": \"tag\",\n",
304303
" \"value\": \"tag_string\",\n",
305304
"}\n",
306305
"\n",
307306
"# Construct a dictionary of datetime metadata\n",
308307
"capture_datetime_field_dict = {\n",
309-
" \"schema_id\": mdo.reserved_by_name[\"captureDateTime\"].uid,\n",
308+
" \"name\": \"captureDateTime\",\n",
310309
" \"value\": datetime.utcnow(),\n",
311310
"}\n",
312311
"\n",
313312
"# Construct a dictionary of Enums options metadata\n",
314313
"split_metadta_field_dict = {\n",
315-
" \"schema_id\": mdo.reserved_by_name[\"split\"][\"train\"].parent,\n",
316-
" \"value\": mdo.reserved_by_name[\"split\"][\"train\"].uid,\n",
314+
" \"name\": \"split\",\n",
315+
" \"value\": \"train\",\n",
317316
"}"
318317
]
319318
},
@@ -491,7 +490,7 @@
491490
"outputs": [],
492491
"source": [
493492
"# Select a dataset to use, or you can just use the 1-image dataset created above. \n",
494-
"dataset_id = \"cl3ntfr7j7cmh07bmeqz3gfjt\"\n",
493+
"dataset_id = dataset.uid\n",
495494
"dataset = client.get_dataset(dataset_id)"
496495
]
497496
},
@@ -541,11 +540,11 @@
541540
" # assign datarows a split\n",
542541
" rnd = random.random()\n",
543542
" if rnd < test:\n",
544-
" split = mdo.reserved_by_name[\"split\"][\"test\"]\n",
543+
" split = \"test\"\n",
545544
" elif rnd < valid:\n",
546-
" split = mdo.reserved_by_name[\"split\"][\"valid\"]\n",
545+
" split = \"valid\"\n",
547546
" else:\n",
548-
" split = mdo.reserved_by_name[\"split\"][\"train\"]\n",
547+
" split = \"train\"\n",
549548
"\n",
550549
" embeddings.append(\n",
551550
" list(model(processor(response.content), training=False)[0].numpy()))\n",
@@ -557,12 +556,11 @@
557556
" data_row_id=datarow.uid,\n",
558557
" fields=[\n",
559558
" DataRowMetadataField(\n",
560-
" schema_id=mdo.reserved_by_name[\"captureDateTime\"].uid,\n",
559+
" name=\"captureDateTime\",\n",
561560
" value=dt,\n",
562561
" ),\n",
563-
" DataRowMetadataField(schema_id=split.parent, value=split.uid),\n",
564-
" DataRowMetadataField(schema_id=mdo.reserved_by_name[\"tag\"].uid,\n",
565-
" value=message),\n",
562+
" DataRowMetadataField(name=\"split\", value=split),\n",
563+
" DataRowMetadataField(name=\"tag\", value=message),\n",
566564
" ]))"
567565
]
568566
},
@@ -620,7 +618,7 @@
620618
"for md, embd in zip(uploads, projected):\n",
621619
" md.fields.append(\n",
622620
" DataRowMetadataField(\n",
623-
" schema_id=mdo.reserved_by_name[\"embedding\"].uid,\n",
621+
" name=\"embedding\",\n",
624622
" value=embd.tolist(), # convert from numpy to list\n",
625623
" ),)"
626624
]
@@ -801,4 +799,4 @@
801799
},
802800
"nbformat": 4,
803801
"nbformat_minor": 5
804-
}
802+
}

examples/integrations/detectron2/coco_object.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
" torchvision \\\n",
9898
" git+https://github.com/cocodataset/panopticapi.git \\\n",
9999
" 'git+https://github.com/facebookresearch/detectron2.git' \n",
100-
"!pip install -q \"git+https://github.com/Labelbox/labelbox-python@ms/coco#egg=labelbox[data]\""
100+
"!pip install -q \"labelbox[data]\""
101101
]
102102
},
103103
{
@@ -156,7 +156,7 @@
156156
")\n",
157157
"\n",
158158
"with open('./coco_utils.py', 'w' ) as file:\n",
159-
" helper = requests.get(\"https://raw.githubusercontent.com/Labelbox/labelbox-python/ms/coco/examples/integrations/detectron2/coco_utils.py\").text\n",
159+
" helper = requests.get(\"https://raw.githubusercontent.com/Labelbox/labelbox-python/develop/examples/integrations/detectron2/coco_utils.py\").text\n",
160160
" file.write(helper)\n",
161161
"from coco_utils import visualize_coco_examples, visualize_object_inferences, partition_coco \n"
162162
]

0 commit comments

Comments
 (0)