|
28 | 28 | }, |
29 | 29 | { |
30 | 30 | "cell_type": "code", |
31 | | - "execution_count": 1, |
| 31 | + "execution_count": null, |
32 | 32 | "id": "passing-question", |
33 | 33 | "metadata": { |
34 | 34 | "scrolled": true |
|
41 | 41 | }, |
42 | 42 | { |
43 | 43 | "cell_type": "code", |
44 | | - "execution_count": 3, |
| 44 | + "execution_count": null, |
45 | 45 | "id": "baking-recipient", |
46 | 46 | "metadata": { |
47 | 47 | "scrolled": true |
|
66 | 66 | }, |
67 | 67 | { |
68 | 68 | "cell_type": "code", |
69 | | - "execution_count": 4, |
| 69 | + "execution_count": null, |
70 | 70 | "id": "refined-welsh", |
71 | 71 | "metadata": { |
72 | 72 | "scrolled": true |
73 | 73 | }, |
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": [], |
83 | 75 | "source": [ |
84 | 76 | "# This will automatically create new feature schema\n", |
85 | 77 | "ontology_name = \"sdk-ontology\"\n", |
|
106 | 98 | }, |
107 | 99 | { |
108 | 100 | "cell_type": "code", |
109 | | - "execution_count": 5, |
| 101 | + "execution_count": null, |
110 | 102 | "id": "faced-genome", |
111 | 103 | "metadata": { |
112 | 104 | "scrolled": true |
113 | 105 | }, |
114 | | - "outputs": [ |
115 | | - { |
116 | | - "name": "stdout", |
117 | | - "output_type": "stream", |
118 | | - "text": [ |
119 | | - "ckvww5gjf02v60z5q4mcv5sf4\n" |
120 | | - ] |
121 | | - } |
122 | | - ], |
| 106 | + "outputs": [], |
123 | 107 | "source": [ |
124 | 108 | "# First create the feature schema\n", |
125 | 109 | "feature_schema_cat = client.create_feature_schema(feature_schema_cat_normalized)\n", |
|
141 | 125 | }, |
142 | 126 | { |
143 | 127 | "cell_type": "code", |
144 | | - "execution_count": 6, |
| 128 | + "execution_count": null, |
145 | 129 | "id": "pacific-combining", |
146 | 130 | "metadata": { |
147 | 131 | "scrolled": true |
|
173 | 157 | }, |
174 | 158 | { |
175 | 159 | "cell_type": "code", |
176 | | - "execution_count": 7, |
| 160 | + "execution_count": null, |
177 | 161 | "id": "d746a962", |
178 | 162 | "metadata": { |
179 | 163 | "scrolled": true |
180 | 164 | }, |
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": [], |
191 | 166 | "source": [ |
192 | 167 | "#### Fetch by ID\n", |
193 | 168 | "feature_schema = client.get_feature_schema(feature_schema_cat.uid)\n", |
|
198 | 173 | }, |
199 | 174 | { |
200 | 175 | "cell_type": "code", |
201 | | - "execution_count": 8, |
| 176 | + "execution_count": null, |
202 | 177 | "id": "05f8f22c", |
203 | 178 | "metadata": { |
204 | 179 | "scrolled": true |
205 | 180 | }, |
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": [], |
216 | 182 | "source": [ |
217 | 183 | "#### Search by name\n", |
218 | 184 | "feature_schema = next(client.get_feature_schemas(\"cat\"))\n", |
|
243 | 209 | }, |
244 | 210 | { |
245 | 211 | "cell_type": "code", |
246 | | - "execution_count": 9, |
| 212 | + "execution_count": null, |
247 | 213 | "id": "aaa47614", |
248 | 214 | "metadata": { |
249 | 215 | "scrolled": true |
250 | 216 | }, |
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": [], |
282 | 218 | "source": [ |
283 | 219 | "# Create normalized json with a bounding box and segmentation tool\n", |
284 | 220 | "ontology_builder = OntologyBuilder(tools=[\n", |
|
300 | 236 | }, |
301 | 237 | { |
302 | 238 | "cell_type": "code", |
303 | | - "execution_count": 10, |
| 239 | + "execution_count": null, |
304 | 240 | "id": "912a0445", |
305 | 241 | "metadata": { |
306 | 242 | "scrolled": true |
307 | 243 | }, |
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": [], |
339 | 245 | "source": [ |
340 | 246 | "# Create\n", |
341 | 247 | "ontology_builder = OntologyBuilder()\n", |
|
358 | 264 | }, |
359 | 265 | { |
360 | 266 | "cell_type": "code", |
361 | | - "execution_count": 11, |
| 267 | + "execution_count": null, |
362 | 268 | "id": "e212df2b", |
363 | 269 | "metadata": { |
364 | 270 | "scrolled": true |
365 | 271 | }, |
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": [], |
432 | 273 | "source": [ |
433 | 274 | " \n", |
434 | 275 | "ontology_builder = OntologyBuilder(\n", |
|
460 | 301 | }, |
461 | 302 | { |
462 | 303 | "cell_type": "code", |
463 | | - "execution_count": 12, |
| 304 | + "execution_count": null, |
464 | 305 | "id": "df8e624c", |
465 | 306 | "metadata": { |
466 | 307 | "scrolled": true |
|
486 | 327 | }, |
487 | 328 | { |
488 | 329 | "cell_type": "code", |
489 | | - "execution_count": 13, |
| 330 | + "execution_count": null, |
490 | 331 | "id": "9ada8aef", |
491 | 332 | "metadata": { |
492 | 333 | "scrolled": true |
|
0 commit comments