Skip to content

Commit 9e195b0

Browse files
authored
Merge pull request #310 from Labelbox/develop
3.7.0
2 parents 0e3042a + 8aec2aa commit 9e195b0

File tree

9 files changed

+281
-163
lines changed

9 files changed

+281
-163
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
# Changelog
2+
# Version 3.7.0 (2021-11-10)
3+
## Added
4+
* Search for data row ids from external ids without specifying a dataset
5+
* `client.get_data_row_ids_for_external_ids()`
6+
* Support for numeric metadata type
7+
8+
## Updated
9+
* The following `DataRowMetadataOntology` fields were renamed:
10+
* `all_fields` -> `fields`
11+
* `all_fields_id_index` -> `fields_by_id`
12+
* `reserved_id_index` -> `reserved_by_id`
13+
* `reserved_name_index` -> `reserved_by_name`
14+
* `custom_id_index` -> `custom_by_id`
15+
* `custom_name_index` -> `custom_by_name`
16+
17+
218
# Version 3.6.1 (2021-07-10)
319
* Fix import error that appears when exporting labels
420

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.0.0-rc0'
24+
release = '3.7.0'
2525

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

examples/basics/data_row_metadata.ipynb

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,14 @@
8787
" DataRowMetadata,\n",
8888
" DataRowMetadataField,\n",
8989
" DeleteDataRowMetadata,\n",
90-
" DataRowMetadataKind\n",
9190
")\n",
9291
"from sklearn.random_projection import GaussianRandomProjection\n",
92+
"import tensorflow as tf\n",
9393
"import seaborn as sns\n",
94-
"from datetime import datetime\n",
95-
"from pprint import pprint\n",
9694
"import tensorflow_hub as hub\n",
95+
"from datetime import datetime\n",
9796
"from tqdm.notebook import tqdm\n",
9897
"import requests\n",
99-
"import tensorflow as tf\n",
10098
"from pprint import pprint"
10199
]
102100
},
@@ -154,7 +152,7 @@
154152
"outputs": [],
155153
"source": [
156154
"# dictionary access with id\n",
157-
"pprint(mdo.all_fields_id_index, indent=2)"
155+
"pprint(mdo.fields_by_id, indent=2)"
158156
]
159157
},
160158
{
@@ -167,19 +165,8 @@
167165
"outputs": [],
168166
"source": [
169167
"# access by name\n",
170-
"split_field = mdo.reserved_name_index[\"split\"]"
171-
]
172-
},
173-
{
174-
"cell_type": "code",
175-
"execution_count": null,
176-
"id": "uOS2QlHmqAIs",
177-
"metadata": {
178-
"id": "uOS2QlHmqAIs"
179-
},
180-
"outputs": [],
181-
"source": [
182-
"split_field.options"
168+
"split_field = mdo.reserved_by_name[\"split\"]\n",
169+
"train_field = mdo.reserved_by_name[\"split\"][\"train\"]"
183170
]
184171
},
185172
{
@@ -191,7 +178,7 @@
191178
},
192179
"outputs": [],
193180
"source": [
194-
"tag_field = mdo.reserved_name_index[\"tag\"]"
181+
"tag_field = mdo.reserved_by_name[\"tag\"]"
195182
]
196183
},
197184
{
@@ -286,7 +273,7 @@
286273
"outputs": [],
287274
"source": [
288275
"field = DataRowMetadataField(\n",
289-
" schema_id=mdo.reserved_name_index[\"captureDateTime\"].id, # specify the schema id\n",
276+
" schema_id=mdo.reserved_by_name[\"captureDateTime\"].id, # specify the schema id\n",
290277
" value=datetime.now(), # typed inputs\n",
291278
")\n",
292279
"# Completed object ready for upload\n",
@@ -356,11 +343,11 @@
356343
" # assign datarows a split\n",
357344
" rnd = random.random()\n",
358345
" if rnd < test:\n",
359-
" split = \"cko8scbz70005h2dkastwhgqt\"\n",
346+
" split = mdo.reserved_by_name[\"split\"][\"test\"]\n",
360347
" elif rnd < valid:\n",
361-
" split = \"cko8sc2yr0004h2dk69aj5x63\"\n",
348+
" split = mdo.reserved_by_name[\"split\"][\"valid\"]\n",
362349
" else:\n",
363-
" split = \"cko8sbscr0003h2dk04w86hof\"\n",
350+
" split = mdo.reserved_by_name[\"split\"][\"train\"]\n",
364351
" \n",
365352
" embeddings.append(list(model(processor(response.content), training=False)[0].numpy()))\n",
366353
" dt = datetime.utcnow() \n",
@@ -371,15 +358,15 @@
371358
" data_row_id=datarow.uid,\n",
372359
" fields=[\n",
373360
" DataRowMetadataField(\n",
374-
" schema_id=mdo.reserved_name_index[\"captureDateTime\"].id,\n",
361+
" schema_id=mdo.reserved_by_name[\"captureDateTime\"].uid,\n",
375362
" value=dt,\n",
376363
" ),\n",
377364
" DataRowMetadataField(\n",
378-
" schema_id=mdo.reserved_name_index[\"split\"].id,\n",
379-
" value=split\n",
365+
" schema_id=split.parent,\n",
366+
" value=split.uid\n",
380367
" ),\n",
381368
" DataRowMetadataField(\n",
382-
" schema_id=mdo.reserved_name_index[\"tag\"].id,\n",
369+
" schema_id=mdo.reserved_by_name[\"tag\"].uid,\n",
383370
" value=message\n",
384371
" ),\n",
385372
" ]\n",
@@ -438,7 +425,7 @@
438425
"for md, embd in zip(uploads, projected):\n",
439426
" md.fields.append(\n",
440427
" DataRowMetadataField(\n",
441-
" schema_id=mdo.reserved_name_index[\"embedding\"].id,\n",
428+
" schema_id=mdo.reserved_by_name[\"embedding\"].uid,\n",
442429
" value=embd.tolist(), # convert from numpy to list\n",
443430
" ),\n",
444431
" )"
@@ -568,7 +555,6 @@
568555
"fields = []\n",
569556
"# iterate through the fields you want to delete\n",
570557
"for field in md.fields:\n",
571-
" schema = mdo.all_fields_id_index[field.schema_id]\n",
572558
" fields.append(field.schema_id)\n",
573559
"\n",
574560
"deletes = DeleteDataRowMetadata(\n",

examples/basics/data_rows.ipynb

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "premier-olympus",
65
"metadata": {},
76
"source": [
87
"# Data rows"
98
]
109
},
1110
{
1211
"cell_type": "markdown",
13-
"id": "affecting-former",
1412
"metadata": {},
1513
"source": [
1614
"* Data rows are the items that are actually being labeled. We currently support the following:\n",
@@ -25,7 +23,6 @@
2523
{
2624
"cell_type": "code",
2725
"execution_count": null,
28-
"id": "posted-nation",
2926
"metadata": {},
3027
"outputs": [],
3128
"source": [
@@ -35,7 +32,6 @@
3532
{
3633
"cell_type": "code",
3734
"execution_count": 1,
38-
"id": "beautiful-ready",
3935
"metadata": {},
4036
"outputs": [],
4137
"source": [
@@ -48,7 +44,6 @@
4844
{
4945
"cell_type": "code",
5046
"execution_count": 2,
51-
"id": "vertical-stockholm",
5247
"metadata": {},
5348
"outputs": [],
5449
"source": [
@@ -70,7 +65,6 @@
7065
},
7166
{
7267
"cell_type": "markdown",
73-
"id": "legendary-harvard",
7468
"metadata": {},
7569
"source": [
7670
"* Set the following cell with your data to run this notebook"
@@ -79,7 +73,6 @@
7973
{
8074
"cell_type": "code",
8175
"execution_count": 3,
82-
"id": "rural-fellow",
8376
"metadata": {},
8477
"outputs": [],
8578
"source": [
@@ -93,7 +86,6 @@
9386
{
9487
"cell_type": "code",
9588
"execution_count": 4,
96-
"id": "proof-detective",
9789
"metadata": {},
9890
"outputs": [],
9991
"source": [
@@ -103,7 +95,6 @@
10395
{
10496
"cell_type": "code",
10597
"execution_count": 5,
106-
"id": "selective-reconstruction",
10798
"metadata": {},
10899
"outputs": [],
109100
"source": [
@@ -115,7 +106,6 @@
115106
},
116107
{
117108
"cell_type": "markdown",
118-
"id": "registered-cause",
119109
"metadata": {},
120110
"source": [
121111
"### Read"
@@ -124,7 +114,6 @@
124114
{
125115
"cell_type": "code",
126116
"execution_count": 6,
127-
"id": "extra-paris",
128117
"metadata": {},
129118
"outputs": [],
130119
"source": [
@@ -135,7 +124,6 @@
135124
{
136125
"cell_type": "code",
137126
"execution_count": 7,
138-
"id": "packed-going",
139127
"metadata": {},
140128
"outputs": [
141129
{
@@ -158,7 +146,6 @@
158146
{
159147
"cell_type": "code",
160148
"execution_count": 8,
161-
"id": "above-vocabulary",
162149
"metadata": {},
163150
"outputs": [
164151
{
@@ -177,7 +164,6 @@
177164
},
178165
{
179166
"cell_type": "markdown",
180-
"id": "successful-patch",
181167
"metadata": {},
182168
"source": [
183169
"### Create\n",
@@ -187,7 +173,6 @@
187173
{
188174
"cell_type": "code",
189175
"execution_count": 9,
190-
"id": "medical-portuguese",
191176
"metadata": {},
192177
"outputs": [
193178
{
@@ -213,7 +198,6 @@
213198
},
214199
{
215200
"cell_type": "markdown",
216-
"id": "helpful-lingerie",
217201
"metadata": {},
218202
"source": [
219203
"* Bulk create data rows (This is much faster than creating individual data rows)"
@@ -222,7 +206,6 @@
222206
{
223207
"cell_type": "code",
224208
"execution_count": 10,
225-
"id": "round-perfume",
226209
"metadata": {},
227210
"outputs": [],
228211
"source": [
@@ -236,7 +219,6 @@
236219
{
237220
"cell_type": "code",
238221
"execution_count": 11,
239-
"id": "breeding-brother",
240222
"metadata": {},
241223
"outputs": [],
242224
"source": [
@@ -251,7 +233,6 @@
251233
{
252234
"cell_type": "code",
253235
"execution_count": 12,
254-
"id": "thrown-designation",
255236
"metadata": {},
256237
"outputs": [],
257238
"source": [
@@ -264,7 +245,6 @@
264245
{
265246
"cell_type": "code",
266247
"execution_count": 13,
267-
"id": "japanese-jefferson",
268248
"metadata": {},
269249
"outputs": [],
270250
"source": [
@@ -280,7 +260,6 @@
280260
{
281261
"cell_type": "code",
282262
"execution_count": 14,
283-
"id": "accessible-effort",
284263
"metadata": {},
285264
"outputs": [
286265
{
@@ -303,7 +282,6 @@
303282
},
304283
{
305284
"cell_type": "markdown",
306-
"id": "interested-proxy",
307285
"metadata": {},
308286
"source": [
309287
"### Update"
@@ -312,7 +290,6 @@
312290
{
313291
"cell_type": "code",
314292
"execution_count": 15,
315-
"id": "floral-elimination",
316293
"metadata": {},
317294
"outputs": [
318295
{
@@ -333,7 +310,6 @@
333310
{
334311
"cell_type": "code",
335312
"execution_count": 16,
336-
"id": "collect-cosmetic",
337313
"metadata": {},
338314
"outputs": [
339315
{
@@ -352,13 +328,12 @@
352328
"# Attachments are visible for all projects connected to the data_row \n",
353329
"data_row.create_attachment(attachment_type=\"TEXT\", attachment_value=\"LABELERS WILL SEE THIS \")\n",
354330
"# See more information here:\n",
355-
"# https://docs.labelbox.com/data-model/en/index-en#attachments\n",
331+
"# https://docs.labelbox.com/reference/type-image\n",
356332
"# Note that attachment_value must always be a string (url to a video/image or a text value to display)"
357333
]
358334
},
359335
{
360336
"cell_type": "markdown",
361-
"id": "explicit-morrison",
362337
"metadata": {},
363338
"source": [
364339
"### Delete"
@@ -367,7 +342,6 @@
367342
{
368343
"cell_type": "code",
369344
"execution_count": 17,
370-
"id": "dental-banana",
371345
"metadata": {},
372346
"outputs": [],
373347
"source": [
@@ -378,7 +352,6 @@
378352
{
379353
"cell_type": "code",
380354
"execution_count": 18,
381-
"id": "binary-organic",
382355
"metadata": {},
383356
"outputs": [],
384357
"source": [
@@ -389,7 +362,7 @@
389362
],
390363
"metadata": {
391364
"kernelspec": {
392-
"display_name": "Python 3 (ipykernel)",
365+
"display_name": "Python 3",
393366
"language": "python",
394367
"name": "python3"
395368
},
@@ -403,7 +376,7 @@
403376
"name": "python",
404377
"nbconvert_exporter": "python",
405378
"pygments_lexer": "ipython3",
406-
"version": "3.8.2"
379+
"version": "3.8.5"
407380
}
408381
},
409382
"nbformat": 4,

labelbox/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "labelbox"
2-
__version__ = "3.6.1"
2+
__version__ = "3.7.0"
33

44
from labelbox.schema.project import Project
55
from labelbox.client import Client

0 commit comments

Comments
 (0)