Skip to content

Commit bc9f27e

Browse files
author
Matt Sokoloff
committed
Clear notebook
1 parent 20e9bf6 commit bc9f27e

File tree

1 file changed

+19
-178
lines changed

1 file changed

+19
-178
lines changed

examples/basics/ontologies.ipynb

Lines changed: 19 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
{
3030
"cell_type": "code",
31-
"execution_count": 1,
31+
"execution_count": null,
3232
"id": "passing-question",
3333
"metadata": {
3434
"scrolled": true
@@ -41,7 +41,7 @@
4141
},
4242
{
4343
"cell_type": "code",
44-
"execution_count": 3,
44+
"execution_count": null,
4545
"id": "baking-recipient",
4646
"metadata": {
4747
"scrolled": true
@@ -66,20 +66,12 @@
6666
},
6767
{
6868
"cell_type": "code",
69-
"execution_count": 4,
69+
"execution_count": null,
7070
"id": "refined-welsh",
7171
"metadata": {
7272
"scrolled": true
7373
},
74-
"outputs": [
75-
{
76-
"name": "stdout",
77-
"output_type": "stream",
78-
"text": [
79-
"<Ontology {'classification_schema_count': 0, 'created_at': datetime.datetime(2021, 11, 12, 21, 27, 32, 432000, tzinfo=datetime.timezone.utc), 'description': None, 'name': 'sdk-ontology', 'normalized': {'tools': [{'schemaNodeId': 'ckvww5f1302jl0z3o7cce0lmr', 'featureSchemaId': 'ckvww5f1302jk0z3o0f57fek3', 'required': False, 'name': 'cat', 'tool': 'polygon', 'color': 'black', 'classifications': []}], 'classifications': []}, 'object_schema_count': 1, 'uid': 'ckvww5f0q02jj0z3o7f7q3vk4', 'updated_at': datetime.datetime(2021, 11, 12, 21, 27, 32, 432000, tzinfo=datetime.timezone.utc)}>\n"
80-
]
81-
}
82-
],
74+
"outputs": [],
8375
"source": [
8476
"# This will automatically create new feature schema\n",
8577
"ontology_name = \"sdk-ontology\"\n",
@@ -106,20 +98,12 @@
10698
},
10799
{
108100
"cell_type": "code",
109-
"execution_count": 5,
101+
"execution_count": null,
110102
"id": "faced-genome",
111103
"metadata": {
112104
"scrolled": true
113105
},
114-
"outputs": [
115-
{
116-
"name": "stdout",
117-
"output_type": "stream",
118-
"text": [
119-
"ckvww5gjf02v60z5q4mcv5sf4\n"
120-
]
121-
}
122-
],
106+
"outputs": [],
123107
"source": [
124108
"# First create the feature schema\n",
125109
"feature_schema_cat = client.create_feature_schema(feature_schema_cat_normalized)\n",
@@ -141,7 +125,7 @@
141125
},
142126
{
143127
"cell_type": "code",
144-
"execution_count": 6,
128+
"execution_count": null,
145129
"id": "pacific-combining",
146130
"metadata": {
147131
"scrolled": true
@@ -173,21 +157,12 @@
173157
},
174158
{
175159
"cell_type": "code",
176-
"execution_count": 7,
160+
"execution_count": null,
177161
"id": "d746a962",
178162
"metadata": {
179163
"scrolled": true
180164
},
181-
"outputs": [
182-
{
183-
"name": "stdout",
184-
"output_type": "stream",
185-
"text": [
186-
"<FeatureSchema {'name': 'cat', 'normalized': {'schemaNodeId': 'ckvww5gjf02v70z5qd7650en8', 'featureSchemaId': 'ckvww5gjf02v60z5q4mcv5sf4', 'required': 0, 'name': 'cat', 'tool': 'polygon', 'color': 'black', 'classifications': []}, 'uid': 'ckvww5gjf02v60z5q4mcv5sf4'}>\n",
187-
"<Ontology {'classification_schema_count': 0, 'created_at': datetime.datetime(2021, 11, 12, 21, 27, 36, 767000, tzinfo=datetime.timezone.utc), 'description': None, 'name': 'sdk-ontology', 'normalized': {'tools': [{'schemaNodeId': 'ckvww5gjf02v70z5qd7650en8', 'featureSchemaId': 'ckvww5gjf02v60z5q4mcv5sf4', 'required': False, 'name': 'cat', 'tool': 'polygon', 'color': 'black', 'classifications': []}, {'schemaNodeId': 'ckvww5hke02f70z5cdwzwccvw', 'featureSchemaId': 'ckvww5hke02f60z5c8yb1cb0t', 'required': False, 'name': 'dog', 'tool': 'polygon', 'color': 'black', 'classifications': []}], 'classifications': []}, 'object_schema_count': 0, 'uid': 'ckvww5id802ki0z3o166v6sz9', 'updated_at': datetime.datetime(2021, 11, 12, 21, 27, 36, 767000, tzinfo=datetime.timezone.utc)}>\n"
188-
]
189-
}
190-
],
165+
"outputs": [],
191166
"source": [
192167
"#### Fetch by ID\n",
193168
"feature_schema = client.get_feature_schema(feature_schema_cat.uid)\n",
@@ -198,21 +173,12 @@
198173
},
199174
{
200175
"cell_type": "code",
201-
"execution_count": 8,
176+
"execution_count": null,
202177
"id": "05f8f22c",
203178
"metadata": {
204179
"scrolled": true
205180
},
206-
"outputs": [
207-
{
208-
"name": "stdout",
209-
"output_type": "stream",
210-
"text": [
211-
"<FeatureSchema {'name': 'cat', 'normalized': {'schemaNodeId': 'ckvww5gjf02v70z5qd7650en8', 'featureSchemaId': 'ckvww5gjf02v60z5q4mcv5sf4', 'required': 0, 'name': 'cat', 'tool': 'polygon', 'color': 'black', 'classifications': []}, 'uid': 'ckvww5gjf02v60z5q4mcv5sf4'}>\n",
212-
"<Ontology {'classification_schema_count': 0, 'created_at': datetime.datetime(2021, 11, 12, 21, 27, 36, 767000, tzinfo=datetime.timezone.utc), 'description': None, 'name': 'sdk-ontology', 'normalized': {'tools': [{'schemaNodeId': 'ckvww5gjf02v70z5qd7650en8', 'featureSchemaId': 'ckvww5gjf02v60z5q4mcv5sf4', 'required': False, 'name': 'cat', 'tool': 'polygon', 'color': 'black', 'classifications': []}, {'schemaNodeId': 'ckvww5hke02f70z5cdwzwccvw', 'featureSchemaId': 'ckvww5hke02f60z5c8yb1cb0t', 'required': False, 'name': 'dog', 'tool': 'polygon', 'color': 'black', 'classifications': []}], 'classifications': []}, 'object_schema_count': 0, 'uid': 'ckvww5id802ki0z3o166v6sz9', 'updated_at': datetime.datetime(2021, 11, 12, 21, 27, 36, 767000, tzinfo=datetime.timezone.utc)}>\n"
213-
]
214-
}
215-
],
181+
"outputs": [],
216182
"source": [
217183
"#### Search by name\n",
218184
"feature_schema = next(client.get_feature_schemas(\"cat\"))\n",
@@ -243,42 +209,12 @@
243209
},
244210
{
245211
"cell_type": "code",
246-
"execution_count": 9,
212+
"execution_count": null,
247213
"id": "aaa47614",
248214
"metadata": {
249215
"scrolled": true
250216
},
251-
"outputs": [
252-
{
253-
"name": "stdout",
254-
"output_type": "stream",
255-
"text": [
256-
"{\n",
257-
" \"tools\": [\n",
258-
" {\n",
259-
" \"schemaNodeId\": \"ckvww5ka002g90z5c4d1m1qtr\",\n",
260-
" \"featureSchemaId\": \"ckvww5ka002g80z5c7skh9w9i\",\n",
261-
" \"required\": false,\n",
262-
" \"name\": \"dog\",\n",
263-
" \"tool\": \"rectangle\",\n",
264-
" \"color\": \"#ff0000\",\n",
265-
" \"classifications\": []\n",
266-
" },\n",
267-
" {\n",
268-
" \"schemaNodeId\": \"ckvww5ka002gb0z5cbw1rb4rf\",\n",
269-
" \"featureSchemaId\": \"ckvww5ka002ga0z5ccpj953nf\",\n",
270-
" \"required\": false,\n",
271-
" \"name\": \"cat\",\n",
272-
" \"tool\": \"superpixel\",\n",
273-
" \"color\": \"#00ffff\",\n",
274-
" \"classifications\": []\n",
275-
" }\n",
276-
" ],\n",
277-
" \"classifications\": []\n",
278-
"}\n"
279-
]
280-
}
281-
],
217+
"outputs": [],
282218
"source": [
283219
"# Create normalized json with a bounding box and segmentation tool\n",
284220
"ontology_builder = OntologyBuilder(tools=[\n",
@@ -300,42 +236,12 @@
300236
},
301237
{
302238
"cell_type": "code",
303-
"execution_count": 10,
239+
"execution_count": null,
304240
"id": "912a0445",
305241
"metadata": {
306242
"scrolled": true
307243
},
308-
"outputs": [
309-
{
310-
"name": "stdout",
311-
"output_type": "stream",
312-
"text": [
313-
"{\n",
314-
" \"tools\": [\n",
315-
" {\n",
316-
" \"schemaNodeId\": \"ckvww5kl102lc0z3ogyps5e91\",\n",
317-
" \"featureSchemaId\": \"ckvww5kl102lb0z3o6oce4878\",\n",
318-
" \"required\": false,\n",
319-
" \"name\": \"dog\",\n",
320-
" \"tool\": \"rectangle\",\n",
321-
" \"color\": \"#ff0000\",\n",
322-
" \"classifications\": []\n",
323-
" },\n",
324-
" {\n",
325-
" \"schemaNodeId\": \"ckvww5kl202le0z3oeq6b8kzv\",\n",
326-
" \"featureSchemaId\": \"ckvww5kl202ld0z3o6i7c33r8\",\n",
327-
" \"required\": false,\n",
328-
" \"name\": \"cat\",\n",
329-
" \"tool\": \"superpixel\",\n",
330-
" \"color\": \"#00ffff\",\n",
331-
" \"classifications\": []\n",
332-
" }\n",
333-
" ],\n",
334-
" \"classifications\": []\n",
335-
"}\n"
336-
]
337-
}
338-
],
244+
"outputs": [],
339245
"source": [
340246
"# Create\n",
341247
"ontology_builder = OntologyBuilder()\n",
@@ -358,77 +264,12 @@
358264
},
359265
{
360266
"cell_type": "code",
361-
"execution_count": 11,
267+
"execution_count": null,
362268
"id": "e212df2b",
363269
"metadata": {
364270
"scrolled": true
365271
},
366-
"outputs": [
367-
{
368-
"name": "stdout",
369-
"output_type": "stream",
370-
"text": [
371-
"{\n",
372-
" \"tools\": [\n",
373-
" {\n",
374-
" \"tool\": \"rectangle\",\n",
375-
" \"name\": \"dog\",\n",
376-
" \"required\": false,\n",
377-
" \"color\": \"#ff0000\",\n",
378-
" \"classifications\": [],\n",
379-
" \"schemaNodeId\": null,\n",
380-
" \"featureSchemaId\": null\n",
381-
" },\n",
382-
" {\n",
383-
" \"tool\": \"superpixel\",\n",
384-
" \"name\": \"cat\",\n",
385-
" \"required\": false,\n",
386-
" \"color\": \"#00ffff\",\n",
387-
" \"classifications\": [\n",
388-
" {\n",
389-
" \"type\": \"text\",\n",
390-
" \"instructions\": \"name\",\n",
391-
" \"name\": \"name\",\n",
392-
" \"required\": false,\n",
393-
" \"options\": [],\n",
394-
" \"schemaNodeId\": null,\n",
395-
" \"featureSchemaId\": null\n",
396-
" }\n",
397-
" ],\n",
398-
" \"schemaNodeId\": null,\n",
399-
" \"featureSchemaId\": null\n",
400-
" }\n",
401-
" ],\n",
402-
" \"classifications\": [\n",
403-
" {\n",
404-
" \"type\": \"radio\",\n",
405-
" \"instructions\": \"image_quality\",\n",
406-
" \"name\": \"image_quality\",\n",
407-
" \"required\": false,\n",
408-
" \"options\": [\n",
409-
" {\n",
410-
" \"schemaNodeId\": null,\n",
411-
" \"featureSchemaId\": null,\n",
412-
" \"label\": \"clear\",\n",
413-
" \"value\": \"clear\",\n",
414-
" \"options\": []\n",
415-
" },\n",
416-
" {\n",
417-
" \"schemaNodeId\": null,\n",
418-
" \"featureSchemaId\": null,\n",
419-
" \"label\": \"blurry\",\n",
420-
" \"value\": \"blurry\",\n",
421-
" \"options\": []\n",
422-
" }\n",
423-
" ],\n",
424-
" \"schemaNodeId\": null,\n",
425-
" \"featureSchemaId\": null\n",
426-
" }\n",
427-
" ]\n",
428-
"}\n"
429-
]
430-
}
431-
],
272+
"outputs": [],
432273
"source": [
433274
" \n",
434275
"ontology_builder = OntologyBuilder(\n",
@@ -460,7 +301,7 @@
460301
},
461302
{
462303
"cell_type": "code",
463-
"execution_count": 12,
304+
"execution_count": null,
464305
"id": "df8e624c",
465306
"metadata": {
466307
"scrolled": true
@@ -486,7 +327,7 @@
486327
},
487328
{
488329
"cell_type": "code",
489-
"execution_count": 13,
330+
"execution_count": null,
490331
"id": "9ada8aef",
491332
"metadata": {
492333
"scrolled": true

0 commit comments

Comments
 (0)