Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions examples/object_detection/python/object_detector.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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()"
]
},
{
Expand Down Expand Up @@ -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()"
]
},
{
Expand Down Expand Up @@ -285,3 +292,4 @@
"nbformat": 4,
"nbformat_minor": 0
}