Skip to content

Commit 71d3643

Browse files
authored
Merge pull request #227 from Labelbox/ms/notebook-fix
update notebooks
2 parents 5672a4c + a3319a3 commit 71d3643

File tree

6 files changed

+37
-37
lines changed

6 files changed

+37
-37
lines changed

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
| Annotation Type Basics | [Github](annotation_types/basics.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/annotation_types/basics.ipynb) |
5858
| Converters | [Github](annotation_types/converters.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/annotation_types/converters.ipynb) |
5959
| Label Containers | [Github](annotation_types/label_containers.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/annotation_types/label_containers.ipynb) |
60-
60+
| MAL Using Annotation Types | [Github](annotation_types/mal_using_annotation_types.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/annotation_types/mal_using_annotation_types.ipynb) |
6161

6262
## [Model Diagnostics](model_diagnostics)
6363
| Notebook | Github | Google Colab |

examples/annotation_types/basics.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,7 @@
594594
"id": "rocky-seeker",
595595
"metadata": {},
596596
"source": [
597-
"* The Mask class support either RGB or Grayscale masks\n",
598-
"* Grayscale masks must have a single color."
597+
"* The Mask class support either RGB masks only"
599598
]
600599
},
601600
{

examples/annotation_types/converters.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,16 +552,16 @@
552552
},
553553
{
554554
"cell_type": "markdown",
555-
"id": "limited-biography",
555+
"id": "bottom-leave",
556556
"metadata": {},
557557
"source": [
558-
"* See how this is used in the MAL notebooks"
558+
"* See how this is used with mal in the `mal_using_annotation_types.ipynb` notebook"
559559
]
560560
},
561561
{
562562
"cell_type": "code",
563563
"execution_count": null,
564-
"id": "welcome-designer",
564+
"id": "placed-danger",
565565
"metadata": {},
566566
"outputs": [],
567567
"source": []

examples/annotation_types/mal_with_annotation_types.ipynb renamed to examples/annotation_types/mal_using_annotation_types.ipynb

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"id": "stupid-court",
66
"metadata": {},
77
"source": [
8-
"# MAL With Annotation Types\n",
8+
"# MAL Using Annotation Types\n",
99
"* Image MAL with subclasses.\n",
10-
"* This is the same task as the image mal tutorial but we are going to add a subclass for whether or not the person in the image is holding a bag."
10+
"* This is the same task as the image mal tutorial but we are going to use annnotation types"
1111
]
1212
},
1313
{
@@ -46,8 +46,24 @@
4646
"source": [
4747
"#Used this as a reference for the model\n",
4848
"#https://colab.research.google.com/github/tensorflow/tpu/blob/master/models/official/mask_rcnn/mask_rcnn_demo.ipynb#scrollTo=6lCL-ZcwaJbA\n",
49-
"from labelbox.schema.ontology import OntologyBuilder, Tool, Classification, Option\n",
50-
"from labelbox import Client, LabelingFrontend\n",
49+
"import numpy as np\n",
50+
"from PIL import Image\n",
51+
"import requests\n",
52+
"import ndjson\n",
53+
"import uuid\n",
54+
"from io import BytesIO\n",
55+
"import os\n",
56+
"from getpass import getpass\n",
57+
"\n",
58+
"from labelbox import (\n",
59+
" Client, \n",
60+
" LabelingFrontend, \n",
61+
" OntologyBuilder, \n",
62+
" Tool, \n",
63+
" Classification, \n",
64+
" Option\n",
65+
")\n",
66+
"\n",
5167
"from labelbox.data.annotation_types import (\n",
5268
" LabelList,\n",
5369
" RasterData,\n",
@@ -61,16 +77,7 @@
6177
" Label\n",
6278
")\n",
6379
"from labelbox.data.serialization import NDJsonConverter\n",
64-
"from image_model import predict, class_mappings, load_model\n",
65-
"from typing import Dict, Any, Tuple, List\n",
66-
"import numpy as np\n",
67-
"from PIL import Image\n",
68-
"import requests\n",
69-
"import ndjson\n",
70-
"import uuid\n",
71-
"from io import BytesIO\n",
72-
"import os\n",
73-
"from getpass import getpass"
80+
"from image_model import predict, class_mappings, load_model"
7481
]
7582
},
7683
{
@@ -323,6 +330,14 @@
323330
"metadata": {},
324331
"outputs": [],
325332
"source": []
333+
},
334+
{
335+
"cell_type": "code",
336+
"execution_count": null,
337+
"id": "prospective-grave",
338+
"metadata": {},
339+
"outputs": [],
340+
"source": []
326341
}
327342
],
328343
"metadata": {

examples/model_diagnostics/model_diagnostics_demo.ipynb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -237,19 +237,11 @@
237237
"source": [
238238
"# --- setup dataset ---\n",
239239
"# load mapillary sample\n",
240-
"sample_csv_url = \"https://raw.githubusercontent.com/Labelbox/labelbox-python/develop/examples/model_assisted_labeling/mapillary_sample.csv\"\n",
240+
"sample_csv_url = \"https://raw.githubusercontent.com/Labelbox/labelbox-python/develop/examples/assets/mapillary_sample.csv\"\n",
241241
"with requests.get(sample_csv_url, stream=True) as r:\n",
242242
" image_data = [row.split(',') for row in (line.decode('utf-8') for line in r.iter_lines())]"
243243
]
244244
},
245-
{
246-
"cell_type": "markdown",
247-
"id": "structural-mandate",
248-
"metadata": {},
249-
"source": [
250-
"* Set up this prediction look to construct Annotation Types"
251-
]
252-
},
253245
{
254246
"cell_type": "code",
255247
"execution_count": null,

examples/model_diagnostics/model_diagnostics_guide.ipynb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,7 @@
101101
"outputs": [],
102102
"source": [
103103
"# Run these if running in a colab notebook\n",
104-
"COLAB = \"google.colab\" in str(get_ipython())\n",
105-
"if COLAB:\n",
106-
" !git clone https://github.com/Labelbox/labelbox-python.git\n",
107-
" !cd labelbox-python\n",
108-
" !mv labelbox-python/examples/model_assisted_labeling/*.py ."
104+
"COLAB = \"google.colab\" in str(get_ipython())"
109105
]
110106
},
111107
{
@@ -241,9 +237,7 @@
241237
},
242238
"source": [
243239
"## Create Predictions\n",
244-
"\n",
245-
"* The prediction format is the same \n",
246-
"* Loop over data_rows, make predictions, and create ndjson"
240+
"* Loop over data_rows, make predictions, and annotation types"
247241
]
248242
},
249243
{

0 commit comments

Comments
 (0)