|
80 | 80 | },
|
81 | 81 | {
|
82 | 82 | "cell_type": "code",
|
83 |
| - "execution_count": 2, |
| 83 | + "execution_count": null, |
84 | 84 | "id": "wooden-worship",
|
85 | 85 | "metadata": {
|
86 | 86 | "id": "wooden-worship"
|
|
108 | 108 | },
|
109 | 109 | {
|
110 | 110 | "cell_type": "code",
|
111 |
| - "execution_count": 1, |
| 111 | + "execution_count": null, |
112 | 112 | "id": "committed-richards",
|
113 | 113 | "metadata": {
|
114 | 114 | "id": "committed-richards"
|
115 | 115 | },
|
116 |
| - "outputs": [ |
117 |
| - { |
118 |
| - "name": "stderr", |
119 |
| - "output_type": "stream", |
120 |
| - "text": [ |
121 |
| - "2021-09-13 09:27:18.654668: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set\n", |
122 |
| - "2021-09-13 09:27:18.655024: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA\n", |
123 |
| - "To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n" |
124 |
| - ] |
125 |
| - } |
126 |
| - ], |
| 116 | + "outputs": [], |
127 | 117 | "source": [
|
128 | 118 | "import sys\n",
|
129 | 119 | "sys.path.append('../model_assisted_labeling')\n",
|
|
176 | 166 | },
|
177 | 167 | {
|
178 | 168 | "cell_type": "code",
|
179 |
| - "execution_count": 3, |
| 169 | + "execution_count": null, |
180 | 170 | "id": "economic-chase",
|
181 | 171 | "metadata": {
|
182 | 172 | "id": "economic-chase"
|
|
191 | 181 | },
|
192 | 182 | {
|
193 | 183 | "cell_type": "code",
|
194 |
| - "execution_count": 4, |
| 184 | + "execution_count": null, |
195 | 185 | "id": "affecting-myanmar",
|
196 | 186 | "metadata": {
|
197 | 187 | "id": "affecting-myanmar"
|
198 | 188 | },
|
199 |
| - "outputs": [ |
200 |
| - { |
201 |
| - "name": "stdout", |
202 |
| - "output_type": "stream", |
203 |
| - "text": [ |
204 |
| - "WARNING:tensorflow:From ../model_assisted_labeling/image_model.py:17: load (from tensorflow.python.saved_model.loader_impl) is deprecated and will be removed in a future version.\n", |
205 |
| - "Instructions for updating:\n", |
206 |
| - "This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.loader.load or tf.compat.v1.saved_model.load. There will be a new function for importing SavedModels in Tensorflow 2.0.\n", |
207 |
| - "INFO:tensorflow:Restoring parameters from gs://cloud-tpu-checkpoints/mask-rcnn/1555659850/variables/variables\n" |
208 |
| - ] |
209 |
| - }, |
210 |
| - { |
211 |
| - "name": "stderr", |
212 |
| - "output_type": "stream", |
213 |
| - "text": [ |
214 |
| - "2021-09-13 09:27:38.928229: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:196] None of the MLIR optimization passes are enabled (registered 0 passes)\n" |
215 |
| - ] |
216 |
| - } |
217 |
| - ], |
| 189 | + "outputs": [], |
218 | 190 | "source": [
|
219 | 191 | "client = Client(api_key=API_KEY)\n",
|
220 | 192 | "load_model() # initialize Tensorflow Model"
|
221 | 193 | ]
|
222 | 194 | },
|
223 | 195 | {
|
224 | 196 | "cell_type": "code",
|
225 |
| - "execution_count": 5, |
| 197 | + "execution_count": null, |
226 | 198 | "id": "modern-program",
|
227 | 199 | "metadata": {
|
228 | 200 | "id": "modern-program"
|
|
260 | 232 | },
|
261 | 233 | {
|
262 | 234 | "cell_type": "code",
|
263 |
| - "execution_count": 6, |
| 235 | + "execution_count": null, |
264 | 236 | "id": "blank-flower",
|
265 | 237 | "metadata": {},
|
266 | 238 | "outputs": [],
|
|
274 | 246 | },
|
275 | 247 | {
|
276 | 248 | "cell_type": "code",
|
277 |
| - "execution_count": 7, |
| 249 | + "execution_count": null, |
278 | 250 | "id": "asian-savings",
|
279 | 251 | "metadata": {
|
280 | 252 | "id": "asian-savings"
|
281 | 253 | },
|
282 |
| - "outputs": [ |
283 |
| - { |
284 |
| - "data": { |
285 |
| - "application/vnd.jupyter.widget-view+json": { |
286 |
| - "model_id": "8178b64dc1864f4f833a29b904b7b5e1", |
287 |
| - "version_major": 2, |
288 |
| - "version_minor": 0 |
289 |
| - }, |
290 |
| - "text/plain": [ |
291 |
| - " 0%| | 0/10 [00:00<?, ?it/s]" |
292 |
| - ] |
293 |
| - }, |
294 |
| - "metadata": {}, |
295 |
| - "output_type": "display_data" |
296 |
| - } |
297 |
| - ], |
| 254 | + "outputs": [], |
298 | 255 | "source": [
|
299 | 256 | "predictions = LabelList()\n",
|
300 | 257 | "for (image_url, external_id) in notebook.tqdm(image_data[:10]):\n",
|
|
332 | 289 | },
|
333 | 290 | {
|
334 | 291 | "cell_type": "code",
|
335 |
| - "execution_count": 8, |
| 292 | + "execution_count": null, |
336 | 293 | "id": "received-nigeria",
|
337 | 294 | "metadata": {},
|
338 | 295 | "outputs": [],
|
|
349 | 306 | },
|
350 | 307 | {
|
351 | 308 | "cell_type": "code",
|
352 |
| - "execution_count": 9, |
| 309 | + "execution_count": null, |
353 | 310 | "id": "stopped-phrase",
|
354 | 311 | "metadata": {},
|
355 |
| - "outputs": [ |
356 |
| - { |
357 |
| - "name": "stdout", |
358 |
| - "output_type": "stream", |
359 |
| - "text": [ |
360 |
| - "Setting up: Diagnostics Demo\n", |
361 |
| - "Dataset Created: cktiom65aclzm0y896zeua5ne\n" |
362 |
| - ] |
363 |
| - } |
364 |
| - ], |
| 312 | + "outputs": [], |
365 | 313 | "source": [
|
366 | 314 | "print(f\"Setting up: {PROJECT_NAME}\")\n",
|
367 | 315 | "\n",
|
|
388 | 336 | },
|
389 | 337 | {
|
390 | 338 | "cell_type": "code",
|
391 |
| - "execution_count": 10, |
| 339 | + "execution_count": null, |
392 | 340 | "id": "unavailable-egyptian",
|
393 | 341 | "metadata": {},
|
394 |
| - "outputs": [ |
395 |
| - { |
396 |
| - "name": "stderr", |
397 |
| - "output_type": "stream", |
398 |
| - "text": [ |
399 |
| - "10it [00:00, 63358.07it/s]\n", |
400 |
| - "10it [00:00, 76818.75it/s]\n", |
401 |
| - "10it [00:00, 60963.72it/s]\n" |
402 |
| - ] |
403 |
| - }, |
404 |
| - { |
405 |
| - "data": { |
406 |
| - "text/plain": [ |
407 |
| - "<labelbox.data.annotation_types.collection.LabelList at 0x17c27fdc0>" |
408 |
| - ] |
409 |
| - }, |
410 |
| - "execution_count": 10, |
411 |
| - "metadata": {}, |
412 |
| - "output_type": "execute_result" |
413 |
| - } |
414 |
| - ], |
| 342 | + "outputs": [], |
415 | 343 | "source": [
|
416 | 344 | "signer = lambda _bytes: client.upload_data(content=_bytes, sign=True)\n",
|
417 | 345 | "predictions.add_url_to_masks(signer) \\\n",
|
|
436 | 364 | },
|
437 | 365 | {
|
438 | 366 | "cell_type": "code",
|
439 |
| - "execution_count": 11, |
| 367 | + "execution_count": null, |
440 | 368 | "id": "subject-painting",
|
441 | 369 | "metadata": {
|
442 | 370 | "id": "subject-painting"
|
443 | 371 | },
|
444 |
| - "outputs": [ |
445 |
| - { |
446 |
| - "name": "stdout", |
447 |
| - "output_type": "stream", |
448 |
| - "text": [ |
449 |
| - "AnnotationImportState.FINISHED \n", |
450 |
| - "\n" |
451 |
| - ] |
452 |
| - } |
453 |
| - ], |
| 372 | + "outputs": [], |
454 | 373 | "source": [
|
455 | 374 | "RUN_MAL = True\n",
|
456 | 375 | "if RUN_MAL:\n",
|
|
464 | 383 | },
|
465 | 384 | {
|
466 | 385 | "cell_type": "code",
|
467 |
| - "execution_count": 12, |
| 386 | + "execution_count": null, |
468 | 387 | "id": "MV4U1W4H_eMq",
|
469 | 388 | "metadata": {
|
470 | 389 | "id": "MV4U1W4H_eMq"
|
471 | 390 | },
|
472 |
| - "outputs": [ |
473 |
| - { |
474 |
| - "name": "stdout", |
475 |
| - "output_type": "stream", |
476 |
| - "text": [ |
477 |
| - "https://app.labelbox.com/go-label/cktiom4y2czqg0y9u9qqfdvhk\n" |
478 |
| - ] |
479 |
| - } |
480 |
| - ], |
| 391 | + "outputs": [], |
481 | 392 | "source": [
|
482 | 393 | "print(f\"https://app.labelbox.com/go-label/{project.uid}\")"
|
483 | 394 | ]
|
|
496 | 407 | },
|
497 | 408 | {
|
498 | 409 | "cell_type": "code",
|
499 |
| - "execution_count": 13, |
| 410 | + "execution_count": null, |
500 | 411 | "id": "excited-seminar",
|
501 | 412 | "metadata": {
|
502 | 413 | "id": "excited-seminar"
|
|
519 | 430 | },
|
520 | 431 | {
|
521 | 432 | "cell_type": "code",
|
522 |
| - "execution_count": 14, |
| 433 | + "execution_count": null, |
523 | 434 | "id": "mental-minnesota",
|
524 | 435 | "metadata": {
|
525 | 436 | "id": "mental-minnesota"
|
|
542 | 453 | },
|
543 | 454 | {
|
544 | 455 | "cell_type": "code",
|
545 |
| - "execution_count": 15, |
| 456 | + "execution_count": null, |
546 | 457 | "id": "static-coordinate",
|
547 | 458 | "metadata": {
|
548 | 459 | "id": "static-coordinate"
|
549 | 460 | },
|
550 |
| - "outputs": [ |
551 |
| - { |
552 |
| - "data": { |
553 |
| - "text/plain": [ |
554 |
| - "True" |
555 |
| - ] |
556 |
| - }, |
557 |
| - "execution_count": 15, |
558 |
| - "metadata": {}, |
559 |
| - "output_type": "execute_result" |
560 |
| - } |
561 |
| - ], |
| 461 | + "outputs": [], |
562 | 462 | "source": [
|
563 | 463 | "lb_model_run.upsert_labels([label.uid for label in labels])"
|
564 | 464 | ]
|
|
575 | 475 | },
|
576 | 476 | {
|
577 | 477 | "cell_type": "code",
|
578 |
| - "execution_count": 16, |
| 478 | + "execution_count": null, |
579 | 479 | "id": "committed-fairy",
|
580 | 480 | "metadata": {
|
581 | 481 | "id": "committed-fairy"
|
|
600 | 500 | },
|
601 | 501 | {
|
602 | 502 | "cell_type": "code",
|
603 |
| - "execution_count": 17, |
| 503 | + "execution_count": null, |
604 | 504 | "id": "anonymous-addition",
|
605 | 505 | "metadata": {
|
606 | 506 | "id": "anonymous-addition"
|
607 | 507 | },
|
608 |
| - "outputs": [ |
609 |
| - { |
610 |
| - "name": "stdout", |
611 |
| - "output_type": "stream", |
612 |
| - "text": [ |
613 |
| - "AnnotationImportState.FINISHED\n" |
614 |
| - ] |
615 |
| - } |
616 |
| - ], |
| 508 | + "outputs": [], |
617 | 509 | "source": [
|
618 | 510 | "upload_task = lb_model_run.add_predictions(f'diagnostics-import-{uuid.uuid4()}', NDJsonConverter.serialize(predictions))\n",
|
619 | 511 | "upload_task.wait_until_done()\n",
|
|
632 | 524 | },
|
633 | 525 | {
|
634 | 526 | "cell_type": "code",
|
635 |
| - "execution_count": 18, |
| 527 | + "execution_count": null, |
636 | 528 | "id": "zrll9K6Q9tGK",
|
637 | 529 | "metadata": {
|
638 | 530 | "id": "zrll9K6Q9tGK"
|
639 | 531 | },
|
640 |
| - "outputs": [ |
641 |
| - { |
642 |
| - "name": "stdout", |
643 |
| - "output_type": "stream", |
644 |
| - "text": [ |
645 |
| - "https://app.labelbox.com/models/9c4cba6e-efb4-03f1-302e-d5718c4eca20/9c4cba6f-8ea1-0202-ec4e-528291bf932e/AllDatarowsSlice/25da00a5-e451-4dbd-824d-a0425ce94ffa?view=carousel\n", |
646 |
| - "https://app.labelbox.com/models/9c4cba6e-efb4-03f1-302e-d5718c4eca20/9c4cba6f-8ea1-0202-ec4e-528291bf932e/AllDatarowsSlice/3d20b8e6-5584-45fd-b0a4-021b3a16f25b?view=carousel\n", |
647 |
| - "https://app.labelbox.com/models/9c4cba6e-efb4-03f1-302e-d5718c4eca20/9c4cba6f-8ea1-0202-ec4e-528291bf932e/AllDatarowsSlice/45e6dab8-c55e-4761-b47f-5a1dd4204f4d?view=carousel\n", |
648 |
| - "https://app.labelbox.com/models/9c4cba6e-efb4-03f1-302e-d5718c4eca20/9c4cba6f-8ea1-0202-ec4e-528291bf932e/AllDatarowsSlice/746b2c7c-25e5-449e-8cce-50e4fcbb9ddd?view=carousel\n", |
649 |
| - "https://app.labelbox.com/models/9c4cba6e-efb4-03f1-302e-d5718c4eca20/9c4cba6f-8ea1-0202-ec4e-528291bf932e/AllDatarowsSlice/7c2bd1f4-7f31-48b4-bc0a-b99ed7533646?view=carousel\n" |
650 |
| - ] |
651 |
| - } |
652 |
| - ], |
| 532 | + "outputs": [], |
653 | 533 | "source": [
|
654 | 534 | "for idx, annotation_group in enumerate(lb_model_run.annotation_groups()):\n",
|
655 | 535 | " if idx == 5:\n",
|
|
0 commit comments