Skip to content

Commit ddf526f

Browse files
Merge pull request #949 from Labelbox/ovalle15-patch-15
Style updates - cleaned up outputs
2 parents f43ffcb + b99babd commit ddf526f

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

examples/basics/custom_embeddings.ipynb

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,26 @@
5050
},
5151
{
5252
"cell_type": "code",
53-
"execution_count": null,
53+
"execution_count": 1,
5454
"metadata": {
55-
"id": "wRIdzkYf7T18"
55+
"id": "wRIdzkYf7T18",
56+
"colab": {
57+
"base_uri": "https://localhost:8080/"
58+
},
59+
"outputId": "13ee42f0-4206-493f-f402-ac7c84916e5e"
5660
},
57-
"outputs": [],
61+
"outputs": [
62+
{
63+
"output_type": "stream",
64+
"name": "stdout",
65+
"text": [
66+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m189.2/189.2 KB\u001b[0m \u001b[31m3.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
67+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.8/7.8 MB\u001b[0m \u001b[31m52.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
68+
"\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
69+
" Building wheel for pygeotile (setup.py) ... \u001b[?25l\u001b[?25hdone\n"
70+
]
71+
}
72+
],
5873
"source": [
5974
"# labelbox\n",
6075
"!pip3 install -q labelbox[data]\n",
@@ -75,13 +90,13 @@
7590
},
7691
{
7792
"cell_type": "code",
78-
"execution_count": null,
93+
"execution_count": 2,
7994
"metadata": {
8095
"colab": {
8196
"base_uri": "https://localhost:8080/"
8297
},
8398
"id": "9k82ueIu8Dy1",
84-
"outputId": "cc728790-fc62-4d8d-a3e7-94739ffec809"
99+
"outputId": "5323157e-872b-4bf2-a65c-0fa9662cdbe8"
85100
},
86101
"outputs": [
87102
{
@@ -90,7 +105,9 @@
90105
"text": [
91106
" Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n",
92107
" Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n",
93-
" Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n"
108+
" Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n",
109+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.8/62.8 KB\u001b[0m \u001b[31m2.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
110+
"\u001b[?25h Building wheel for advlib (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n"
94111
]
95112
}
96113
],
@@ -136,13 +153,14 @@
136153
},
137154
{
138155
"cell_type": "code",
139-
"execution_count": null,
156+
"execution_count": 32,
140157
"metadata": {
141158
"id": "tOIyo5pC7PTz"
142159
},
143160
"outputs": [],
144161
"source": [
145162
"# get images from a Labelbox dataset\n",
163+
"# Our systems start to process data after 1000 embeddings of each type, for this demo make sure your dataset is over 1000 data rows",
146164
"dataset = client.get_dataset(\"<ADD YOUR DATASET ID>\")\n",
147165
"drs = list(dataset.export_data_rows(timeout_seconds=9999))\n",
148166
"data_row_ids = [dr.uid for dr in drs]"
@@ -161,7 +179,7 @@
161179
},
162180
{
163181
"cell_type": "code",
164-
"execution_count": null,
182+
"execution_count": 33,
165183
"metadata": {
166184
"id": "iJFGf0w7swnW"
167185
},
@@ -193,37 +211,20 @@
193211
},
194212
{
195213
"cell_type": "code",
196-
"execution_count": null,
214+
"execution_count": 35,
197215
"metadata": {
198216
"id": "u0ZgybLK67n0",
199217
"colab": {
200218
"base_uri": "https://localhost:8080/"
201219
},
202-
"outputId": "d644f81a-014e-4de9-913a-74211972e9b2"
220+
"outputId": "7e1991a0-8e0a-4e63-e8d8-dfdcf095a625"
203221
},
204222
"outputs": [
205223
{
206224
"output_type": "stream",
207225
"name": "stdout",
208226
"text": [
209-
"Nb of custom embedding vectors in sanity_check_payload: 1000\n",
210-
"sanity_check_payload: "
211-
]
212-
},
213-
{
214-
"output_type": "stream",
215-
"name": "stderr",
216-
"text": [
217-
"IOPub data rate exceeded.\n",
218-
"The notebook server will temporarily stop sending output\n",
219-
"to the client in order to avoid crashing it.\n",
220-
"To change this limit, set the config variable\n",
221-
"`--NotebookApp.iopub_data_rate_limit`.\n",
222-
"\n",
223-
"Current values:\n",
224-
"NotebookApp.iopub_data_rate_limit=1000000.0 (bytes/sec)\n",
225-
"NotebookApp.rate_limit_window=3.0 (secs)\n",
226-
"\n"
227+
"Nb of custom embedding vectors in sanity_check_payload: 1000\n"
227228
]
228229
}
229230
],
@@ -251,13 +252,13 @@
251252
},
252253
{
253254
"cell_type": "code",
254-
"execution_count": null,
255+
"execution_count": 46,
255256
"metadata": {
256257
"colab": {
257258
"base_uri": "https://localhost:8080/"
258259
},
259260
"id": "YQeCS_U98BD2",
260-
"outputId": "178dc3be-6e89-4df8-ec3d-2fa6dacc0be0"
261+
"outputId": "cdeb0bc7-9ea1-4864-88ff-122f6dab8af4"
261262
},
262263
"outputs": [
263264
{
@@ -266,9 +267,8 @@
266267
"text": [
267268
"00000000-0000-0000-0000-000000000000 - Image Embedding (CLIP ViT-B/32) - dims: 512 \n",
268269
"00000000-0000-0000-0000-000000000001 - Text embedding (All-MPNet-base-v2) - dims: 768 \n",
269-
"521eadfe-f8e9-4135-9ead-fef8e9713546 - my_custom_embedding_2048_dimensions - dims: 2048 \n",
270-
"a03948c1-151a-4a1a-b948-c1151a6a1a1d - ResNet50_2048_dimensions - dims: 2048 \n",
271-
"baf8856a-e5f7-4781-b885-6ae5f7b78192 - my_custom_embedding - dims: 8 \n"
270+
"45cafc7a-5314-462a-8afc-7a5314062a3b - my_custom_embedding_2048_dimensions - dims: 2048 \n",
271+
"7d3a6118-589d-4b6c-ba61-18589dbb6ccf - ResNet50_2048_dimensions - dims: 2048 \n"
272272
]
273273
}
274274
],
@@ -279,34 +279,34 @@
279279
},
280280
{
281281
"cell_type": "code",
282-
"execution_count": null,
282+
"execution_count": 47,
283283
"metadata": {
284284
"colab": {
285285
"base_uri": "https://localhost:8080/"
286286
},
287287
"id": "spyHzkLP67dI",
288-
"outputId": "21b6fda1-7a38-4bd5-d244-dfc90b8a5090"
288+
"outputId": "8a046562-5eb1-4fb1-8f23-6958f8b58e1f"
289289
},
290290
"outputs": [
291291
{
292292
"output_type": "stream",
293293
"name": "stdout",
294294
"text": [
295-
"Embedding type created id=521eadfe-f8e9-4135-9ead-fef8e9713546\n"
295+
"Embedding type created id=da5d4b0f-e440-4e2e-9d4b-0fe4400e2e8d\n"
296296
]
297297
}
298298
],
299299
"source": [
300300
"# # Create a new custom embedding\n",
301-
"!advtool embeddings create my_custom_embedding_2048_dimensions 2048\n",
301+
"!advtool embeddings create my_custom_embedding_2048_dimensions_v2 2048\n",
302302
"# will return the ID of the newly created embedding, e.g. 0ddc5d5c-0963-41ad-9c5d-5c0963a1ad98"
303303
]
304304
},
305305
{
306306
"cell_type": "code",
307307
"source": [
308308
"# # Delete a custom embedding\n",
309-
"# !advtool embeddings delete 521eadfe-f8e9-4135-9ead-fef8e9713546"
309+
"# !advtool embeddings delete 2e122b85-7def-44fb-922b-857defe4fb8a"
310310
],
311311
"metadata": {
312312
"id": "MafxKyncxyvR"
@@ -325,13 +325,13 @@
325325
},
326326
{
327327
"cell_type": "code",
328-
"execution_count": null,
328+
"execution_count": 49,
329329
"metadata": {
330330
"colab": {
331331
"base_uri": "https://localhost:8080/"
332332
},
333333
"id": "twDd5XNM67Zo",
334-
"outputId": "a7715fe7-3fc3-43d0-8316-bbc45a7dee60"
334+
"outputId": "cb4573de-5417-449b-b560-9f99cfe6eda4"
335335
},
336336
"outputs": [
337337
{
@@ -345,43 +345,43 @@
345345
}
346346
],
347347
"source": [
348-
"# Upload the payload to Labelbox\n",
349-
"!advtool embeddings import 521eadfe-f8e9-4135-9ead-fef8e9713546 ./payload.ndjson"
348+
"# Upload the payload to Labelbox \n",
349+
"!advtool embeddings import da5d4b0f-e440-4e2e-9d4b-0fe4400e2e8d ./payload.ndjson"
350350
]
351351
},
352352
{
353353
"cell_type": "code",
354-
"execution_count": null,
354+
"execution_count": 63,
355355
"metadata": {
356356
"colab": {
357357
"base_uri": "https://localhost:8080/"
358358
},
359359
"id": "wC0eeEPM9aAM",
360-
"outputId": "5889b2f8-1a07-4748-b3bf-efab545f1417"
360+
"outputId": "55932ddf-2dde-48c1-fd90-29532b8cfdf2"
361361
},
362362
"outputs": [
363363
{
364364
"output_type": "stream",
365365
"name": "stdout",
366366
"text": [
367-
"0\n"
367+
"1000\n"
368368
]
369369
}
370370
],
371371
"source": [
372-
"# count how many data rows have a specific custom embedding\n",
373-
"!advtool embeddings count 521eadfe-f8e9-4135-9ead-fef8e9713546"
372+
"# count how many data rows have a specific custom embedding (This can take a couple of minutes)\n",
373+
"!advtool embeddings count da5d4b0f-e440-4e2e-9d4b-0fe4400e2e8d"
374374
]
375375
},
376376
{
377377
"cell_type": "code",
378-
"execution_count": null,
378+
"execution_count": 64,
379379
"metadata": {
380380
"colab": {
381381
"base_uri": "https://localhost:8080/"
382382
},
383383
"id": "5AKDMJfO9Z51",
384-
"outputId": "b3b6e7ca-1e99-4563-d8fe-038375008b69"
384+
"outputId": "207f251f-0350-451e-ffcb-661cafb0529f"
385385
},
386386
"outputs": [
387387
{

0 commit comments

Comments
 (0)