{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "ImageAI for Object Detection\n", "http://imageai.org/#features" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A simple, high level, easy-to-use open source Computer Vision library for Python.\n", "\n", "It was developed with a focus on enabling easy and fast experimentation. Being able to go from an idea to prototype with least amount of delay is key to doing good research.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
cvlib detect_common_objects pretrained on coco dataset.
\n", "Underneath it uses YOLOv3 model trained on COCO dataset capable of detecting 80 common objects in context." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import cv2\n", "import matplotlib.pyplot as plt\n", "import cvlib as cv\n", "from cvlib.object_detection import draw_bbox" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "im = cv2.imread(\"image.jpg\")\n", "\n", "bbox, label, conf = cv.detect_common_objects(im)\n", "\n", "output_image = draw_bbox(im, bbox, label, conf)\n", "\n", "plt.imshow(output_image)\n", "\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "im = cv2.imread(\"image02.jpg\")\n", "\n", "bbox, label, conf = cv.detect_common_objects(im)\n", "\n", "output_image = draw_bbox(im, bbox, label, conf)\n", "\n", "plt.imshow(output_image)\n", "\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 2 }