diff --git a/examples/object_detection/python/object_detector.ipynb b/examples/object_detection/python/object_detector.ipynb index 2b1f61dcf..f200ca945 100644 --- a/examples/object_detection/python/object_detector.ipynb +++ b/examples/object_detection/python/object_detector.ipynb @@ -168,10 +168,14 @@ "IMAGE_FILE = 'image.jpg'\n", "\n", "import cv2\n", - "from google.colab.patches import cv2_imshow\n", + "from matplotlib import pyplot as plt\n", "\n", "img = cv2.imread(IMAGE_FILE)\n", - "cv2_imshow(img)" + "img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)\n", + "\n", + "plt.imshow(img_rgb)\n", + "plt.axis('off')\n", + "plt.show()" ] }, { @@ -247,7 +251,10 @@ "image_copy = np.copy(image.numpy_view())\n", "annotated_image = visualize(image_copy, detection_result)\n", "rgb_annotated_image = cv2.cvtColor(annotated_image, cv2.COLOR_BGR2RGB)\n", - "cv2_imshow(rgb_annotated_image)" + "\n", + "plt.imshow(rgb_annotated_image)\n", + "plt.axis('off')\n", + "plt.show()" ] }, { @@ -285,3 +292,4 @@ "nbformat": 4, "nbformat_minor": 0 } +