{
  "source_file": "0930",
  "source_platform": "技术平台",
  "author": "Adrian Rosebrock / PyImageSearch",
  "title_listed": "Object detection with deep learning and OpenCV",
  "keywords": "目标检测,深度学习,OpenCV",
  "domain": "图像处理",
  "content_type": "教程",
  "is_paid_flag": "否",
  "url": "https://pyimagesearch.com/2017/09/11/object-detection-with-deep-learning-and-opencv/",
  "publish_date": "2017-09",
  "corpus_stage": "预训练/SFT",
  "notes": "深度学习目标检测入门",
  "id": "a0a0a1e75153",
  "collected_at": "2026-10-02T17:21:56",
  "title": "Object detection with deep learning and OpenCV - PyImageSearch",
  "body_markdown": "Click here to download the source code to this post\nLast updated on July 7, 2021.\nA couple weeks ago we learned how to\nclassify images using deep learning\nand OpenCV 3.3’s deep neural network (\ndnn\n) module.\nWhile this original blog post demonstrated how we can\ncategorize\nan image into one of ImageNet’s 1,000 separate class labels it\ncould not\ntell us\nwhere\nan object resides in image.\nIn order to obtain the bounding box\n(x, y)\n-coordinates for an object in a image we need to instead apply\nobject detection\n.\nObject detection can not only tell us\nwhat\nis in an image but also\nwhere\nthe object is as well.\nObject detection algorithms need diverse and high-quality data to perform optimally. A rich dataset library helps train more accurate and adaptable models, ready for real-world detection tasks.\nRoboflow\nhas free tools for each stage of the computer vision pipeline that will streamline your workflows and supercharge your productivity.\nSign up or Log in to your\nRoboflow account\nto access state of the art dataset libaries and revolutionize your computer vision pipeline.\nYou can start by choosing your own datasets or using our\nPyimageSearch’s assorted library of useful datasets\n.\nBring data in any of 40+ formats to\nRoboflow\n, train using any state-of-the-art model architectures, deploy across multiple platforms (API, NVIDIA, browser, iOS, etc), and connect to applications or 3rd party tools.\nWith a few images, you can train a working computer vision model in an afternoon. For example, bring data into\nRoboflow\nfrom anywhere via API, label images with the cloud-hosted image annotation tool, kickoff a hosted model training with one-click, and deploy the model via a hosted API endpoint. This process can be executed in a code-centric way, in the cloud-based UI, or any mix of the two.\nOver 250,000 developers and machine learning engineers from companies such as Cardinal Health, Walmart, USG, Rivian, Intel, and Medtronic build computer vision pipelines with Roboflow. Get started today, no credit card required.\nIn the remainder of today’s blog post we’ll discuss how to apply object detection using deep learning and OpenCV.\nUpdate July 2021:\nAdded a section on alternative deep learning-based object detectors, including articles on how to train R-CNNs from scratch, and more details on bounding box regression.\nLooking for the source code to this post?\nJump Right To The Downloads Section\nObject detection with deep learning and OpenCV\nIn the first part of today’s post on object detection using deep learning we’ll discuss\nSingle Shot Detectors\nand\nMobileNets\n.\nWhen combined together these methods can be used for super fast, real-time object detection on resource constrained devices (including the Raspberry Pi, smartphones, etc.)\nFrom there we’ll discover how to use OpenCV’s\ndnn\nmodule to load a pre-trained object detection network.\nThis will enable us to pass input images through the network and obtain the output bounding box\n(x, y)-\ncoordinates of each object in the image.\nFinally we’ll look at the results of applying the MobileNet Single Shot Detector to example input images.\nIn a future blog post we’ll extend our script to work with real-time video streams as well.\nSingle Shot Detectors for object detection\nFigure 1:\nExamples of object detection using Single Shot Detectors (SSD) from Liu et al.\nWhen it comes to deep learning-based object detection there are three primary object detection methods that you’ll likely encounter:\nFaster R-CNNs\n(Ren et al., 2015)\nYou Only Look Once (YOLO)\n(Redmon et al., 2015)\nSingle Shot Detectors (SSDs)\n(Liu et al., 2015)\nFaster R-CNNs are likely the most “heard of” method for object detection using deep learning; however, the technique can be difficult to understand (especially for beginners in deep learning), hard to implement, and challenging to train.\nFurthermore, even with the “faster” implementation R-CNNs (where the “R” stands for “Region Proposal”) the algorithm can be quite slow, on the order of 7 FPS.\nIf we are looking for pure speed then we tend to use YOLO as this algorithm is much faster, capable of processing 40-90 FPS on a Titan X GPU. The super fast variant of YOLO can even get up to 155 FPS.\nThe problem with YOLO is that it leaves much accuracy to be desired.\nSSDs, originally developed by Google, are a balance between the two. The algorithm is more straightforward (and I would argue better explained in the original seminal paper) than Faster R-CNNs.\nWe can also enjoy a much faster FPS throughput than\nRen et al\n. at 22-46 FPS depending on which variant of the network we use. SSDs also tend to be more accurate than YOLO. To learn more about SSDs, please refer to\nLiu et al\n.\nMobileNets: Efficient (deep) neural networks\nFigure 2:\n(Left)\nStandard convolutional layer with batch normalization and ReLU.\n(Right)\nDepthwise separable convolution with depthwise and pointwise layers followed by batch normalization and ReLU (figure and caption from Liu et al.).\nWhen building object detection networks we normally use an existing network architecture, such as VGG or ResNet, and then use it inside the object detection pipeline. The problem is that these network architectures can be very large in the order of 200-500MB.\nNetwork architectures such as these are unsuitable for resource constrained devices due to their sheer size and resulting number of computations.\nInstead, we can use\nMobileNets\n(Howard et al., 2017), another paper by Google researchers. We call these networks “MobileNets” because they are designed for resource constrained devices such as your smartphone. MobileNets differ from traditional CNNs through the usage of\ndepthwise separable convolution\n(\nFigure 2\nabove).\nThe general idea behind depthwise separable convolution is to split convolution into two stages:\nA\n3×3\ndepthwise convolution.\nFollowed by a\n1×1\npointwise convolution.\nThis allows us to actually reduce the number of parameters in our network.\nThe problem is that we sacrifice accuracy — MobileNets are normally not as accurate as their larger big brothers…\n…but they are much more resource efficient.\nFor more details on MobileNets please see\nHoward et al\n.\nCombining MobileNets and Single Shot Detectors for fast, efficient deep-learning based object detection\nIf we combine both the MobileNet architecture and the Single Shot Detector (SSD) framework, we arrive at a fast, efficient deep learning-based method to object detection.\nThe model we’ll be using in this blog post is a Caffe version of the\noriginal TensorFlow implementation\nby Howard et al. and was trained by chuanqi305 (\nsee GitHub\n).\nThe MobileNet SSD was first trained on the\nCOCO dataset\n(Common Objects in Context) and was then fine-tuned on PASCAL VOC reaching 72.7% mAP (mean average precision).\nWe can therefore detect 20 objects in images (+1 for the background class), including\nairplanes, bicycles, birds, boats, bottles, buses, cars, cats, chairs, cows, dining tables, dogs, horses, motorbikes, people, potted plants, sheep, sofas, trains,\nand\ntv monitors\n.\nDeep learning-based object detection with OpenCV\nIn this section we will use the MobileNet SSD + deep neural network (\ndnn\n) module in OpenCV to build our object detector.\nI would suggest using the\n“Downloads”\ncode at the bottom of this blog post to download the source code + trained network + example images so you can test them on your machine.\nLet’s go ahead and get started building our deep learning object detector using OpenCV.\nOpen up a new file, name it\ndeep_learning_object_detection.py\n, and insert the following code:\n# import the necessary packages\nimport numpy as np\nimport argparse\nimport cv2\n\n# construct the argument parse and parse the arguments\nap = argparse.ArgumentParser()\nap.add_argument(\"-i\", \"--image\", required=True,\n\thelp=\"path to input image\")\nap.add_argument(\"-p\", \"--prototxt\", required=True,\n\thelp=\"path to Caffe 'deploy' prototxt file\")\nap.add_argument(\"-m\", \"--model\", required=True,\n\thelp=\"path to Caffe pre-trained model\")\nap.add_argument(\"-c\", \"--confidence\", type=float, default=0.2,\n\thelp=\"minimum probability to filter weak detections\")\nargs = vars(ap.parse_args())\nOn\nLines 2-4\nwe import packages required for this script — the\ndnn\nmodule is included in\ncv2\n, again, making hte assumption that you’re using\nOpenCV 3.3\n.\nThen, we parse our command line arguments (\nLines 7-16\n):\n--image\n: The path to the input image.\n--prototxt\n: The path to the Caffe prototxt file.\n--model\n: The path to the pre-trained model.\n--confidence\n: The minimum probability threshold to filter weak detections. The default is 20%.\nAgain, example files for the first three arguments are included in the\n“Downloads”\nsection of this blog post. I urge you to start there while also supplying some query images of your own.\nNext, let’s initialize class labels and bounding box colors:\n# initialize the list of class labels MobileNet SSD was trained to\n# detect, then generate a set of bounding box colors for each class\nCLASSES = [\"background\", \"aeroplane\", \"bicycle\", \"bird\", \"boat\",\n\t\"bottle\", \"bus\", \"car\", \"cat\", \"chair\", \"cow\", \"diningtable\",\n\t\"dog\", \"horse\", \"motorbike\", \"person\", \"pottedplant\", \"sheep\",\n\t\"sofa\", \"train\", \"tvmonitor\"]\nCOLORS = np.random.uniform(0, 255, size=(len(CLASSES), 3))\nLines 20-23\nbuild a list called\nCLASSES\ncontaining our labels. This is followed by a list,\nCOLORS\nwhich contains corresponding random colors for bounding boxes (\nLine 24\n).\nNow we need to load our model:\n# load our serialized model from disk\nprint(\"[INFO] loading model...\")\nnet = cv2.dnn.readNetFromCaffe(args[\"prototxt\"], args[\"model\"])\nThe above lines are self-explanatory, we simply print a message and load our\nmodel\n(\nLines 27 and 28\n).\nNext, we will load our query image and prepare our\nblob\n, which we will feed-forward through the network:\n# load the input image and construct an input blob for the image\n# by resizing to a fixed 300x300 pixels and then normalizing it\n# (note: normalization is done via the authors of the MobileNet SSD\n# implementation)\nimage = cv2.imread(args[\"image\"])\n(h, w) = image.shape[:2]\nblob = cv2.dnn.blobFromImage(cv2.resize(image, (300, 300)), 0.007843,\n\t(300, 300), 127.5)\nTaking note of the comment in this block, we load our\nimage\n(\nLine 34\n), extract the height and width (\nLine 35\n), and calculate a\n300 by 300\npixel\nblob\nfrom our image (\nLine 36\n).\nNow we’re ready to do the heavy lifting — we’ll pass this blob through the neural network:\n# pass the blob through the network and obtain the detections and\n# predictions\nprint(\"[INFO] computing object detections...\")\nnet.setInput(blob)\ndetections = net.forward()\nOn\nLines 41 and 42\nwe set the input to the network and compute the forward pass for the input, storing the result as\ndetections\n. Computing the forward pass and associated detections could take awhile depending on your model and input size, but for this example it will be relatively quick on most CPUs.\nLet’s loop through our\ndetections\nand determine\nwhat\nand\nwhere\nthe objects are in the image:\n# loop over the detections\nfor i in np.arange(0, detections.shape[2]):\n\t# extract the confidence (i.e., probability) associated with the\n\t# prediction\n\tconfidence = detections[0, 0, i, 2]\n\n\t# filter out weak detections by ensuring the `confidence` is\n\t# greater than the minimum confidence\n\tif confidence > args[\"confidence\"]:\n\t\t# extract the index of the class label from the `detections`,\n\t\t# then compute the (x, y)-coordinates of the bounding box for\n\t\t# the object\n\t\tidx = int(detections[0, 0, i, 1])\n\t\tbox = detections[0, 0, i, 3:7] * np.array([w, h, w, h])\n\t\t(startX, startY, endX, endY) = box.astype(\"int\")\n\n\t\t# display the prediction\n\t\tlabel = \"{}: {:.2f}%\".format(CLASSES[idx], confidence * 100)\n\t\tprint(\"[INFO] {}\".format(label))\n\t\tcv2.rectangle(image, (startX, startY), (endX, endY),\n\t\t\tCOLORS[idx], 2)\n\t\ty = startY - 15 if startY - 15 > 15 else startY + 15\n\t\tcv2.putText(image, label, (startX, y),\n\t\t\tcv2.FONT_HERSHEY_SIMPLEX, 0.5, COLORS[idx], 2)\nWe start by looping over our detections, keeping in mind that multiple objects can be detected in a single image. We also apply a check to the confidence (i.e., probability) associated with each detection. If the confidence is high enough (i.e. above the threshold), then we’ll display the prediction in the terminal as well as draw the prediction on the image with text and a colored bounding box. Let’s break it down line-by-line:\nLooping through our\ndetections\n, first we extract the\nconfidence\nvalue (\nLine 48\n).\nIf the\nconfidence\nis above our minimum threshold (\nLine 52\n), we extract the class label index (\nLine 56\n) and compute the bounding box around the detected object (\nLine 57\n).\nThen, we extract the\n(x, y)\n-coordinates of the box (\nLine 58\n) which we will will use shortly for drawing a rectangle and displaying text.\nNext, we build a text\nlabel\ncontaining the\nCLASS\nname and the\nconfidence\n(\nLine 61\n).\nUsing the label, we print it to the terminal (\nLine 62\n), followed by drawing a colored rectangle around the object using our previously extracted\n(x, y)\n-coordinates (\nLines 63 and 64\n).\nIn general, we want the label to be displayed above the rectangle, but if there isn’t room, we’ll display it just below the top of the rectangle (\nLine 65\n).\nFinally, we overlay the colored text onto the\nimage\nusing the\ny\n-value that we just calculated (\nLines 66 and 67\n).\nThe only remaining step is to display the result:\n# show the output image\ncv2.imshow(\"Output\", image)\ncv2.waitKey(0)\nWe display the resulting output image to the screen until a key is pressed (\nLines 70 and 71\n).\nOpenCV and deep learning object detection results\nTo download the code + pre-trained network + example images, be sure to use the\n“Downloads”\nsection at the bottom of this blog post.\nFrom there, unzip the archive and execute the following command:\n$ python deep_learning_object_detection.py \\\n\t--prototxt MobileNetSSD_deploy.prototxt.txt \\\n\t--model MobileNetSSD_deploy.caffemodel --image images/example_01.jpg \n[INFO] loading model...\n[INFO] computing object detections...\n[INFO] loading model...\n[INFO] computing object detections...\n[INFO] car: 99.78%\n[INFO] car: 99.25%\nFigure 3:\nTwo Toyotas on the highway recognized with near-100% confidence using OpenCV, deep learning, and object detection.\nOur first result shows cars recognized and detected with near-100% confidence.\nIn this example we detect an airplane using deep learning-based object detection:\n$ python deep_learning_object_detection.py \\\n\t--prototxt MobileNetSSD_deploy.prototxt.txt \\\n\t--model MobileNetSSD_deploy.caffemodel --image images/example_02.jpg \n[INFO] loading model...\n[INFO] computing object detections...\n[INFO] loading model...\n[INFO] computing object detections...\n[INFO] aeroplane: 98.42%\nFigure 4:\nAn airplane successfully detected with high confidence via Python, OpenCV, and deep learning.\nThe ability for deep learning to detect and localize obscured objects is demonstrated in the following image, where we see a horse (and it’s rider) jumping a fence flanked by two potted plants:\n$ python deep_learning_object_detection.py \\\n\t--prototxt MobileNetSSD_deploy.prototxt.txt \\\n\t--model MobileNetSSD_deploy.caffemodel --image images/example_03.jpg\n[INFO] loading model...\n[INFO] computing object detections...\n[INFO] horse: 96.67%\n[INFO] person: 92.58%\n[INFO] pottedplant: 96.87%\n[INFO] pottedplant: 34.42%\nFigure 5:\nA person riding a horse and two potted plants are successfully identified despite a lot of objects in the image via deep learning-based object detection.\nIn this example we can see a beer bottle is detected with an impressive 100% confidence:\n$ python deep_learning_object_detection.py --prototxt MobileNetSSD_deploy.prototxt.txt \\\n\t--model MobileNetSSD_deploy.caffemodel --image images/example_04.jpg \n[INFO] loading model...\n[INFO] computing object detections...\n[INFO] bottle: 100.00%\nFigure 6:\nDeep learning + OpenCV are able to correctly detect a beer bottle in an input image.\nFollowed by another horse image which also contains a dog, car, and person:\n$ python deep_learning_object_detection.py \\\n\t--prototxt MobileNetSSD_deploy.prototxt.txt \\\n\t--model MobileNetSSD_deploy.caffemodel --image images/example_05.jpg \n[INFO] loading model...\n[INFO] computing object detections...\n[INFO] car: 99.87%\n[INFO] dog: 94.88%\n[INFO] horse: 99.97%\n[INFO] person: 99.88%\nFigure 7:\nSeveral objects in this image including a car, dog, horse, and person are all recognized.\nFinally, a picture of me and Jemma, the family beagle:\n$ python deep_learning_object_detection.py \\\n\t--prototxt MobileNetSSD_deploy.prototxt.txt \\\n\t--model MobileNetSSD_deploy.caffemodel --image images/example_06.jpg \n[INFO] loading model...\n[INFO] computing object detections...\n[INFO] dog: 95.88%\n[INFO] person: 99.95%\nFigure 8:\nMe and the family beagle are corrected as a\n“person”\nand a\n“dog”\nvia deep learning, object detection, and OpenCV. The TV monitor is not recognized.\nUnfortunately the TV monitor isn’t recognized in this image which is likely due to (1) me blocking it and (2) poor contrast around the TV. That being said, we have demonstrated excellent object detection results using OpenCV’s\ndnn\nmodule.\nAlternative deep learning object detectors\nIn this post, we used OpenCV and the Single Shot Detector (SSD) model for deep learning-based object detection.\nHowever, there\nare\ndeep learning object detectors that we can apply, including:\nYOLO object detection with OpenCV\nYOLO and Tiny-YOLO object detection on the Raspberry Pi and Movidius NCS\nFaster R-CNN and OpenCV\nMask R-CNN and OpenCV\n(technically an “instance segmentation” model)\nRetinaNet object detector\nAdditionally, if you are interested in learning how to train your own custom deep learning object detectors, including obtaining a deeper understanding of the R-CNN family of object detectors, be sure to read this four-part series:\nTurning any CNN image classifier into an object detector with Keras, TensorFlow, and OpenCV\nOpenCV Selective Search for Object Detection\nRegion proposal object detection with OpenCV, Keras, and TensorFlow\nR-CNN object detection with Keras, TensorFlow, and Deep Learning\nFrom there, I recommend studying the concept of\nbounding box regression\nin more detail:\nObject detection: Bounding box regression with Keras, TensorFlow, and Deep Learning\nMulti-class object detection and bounding box regression with Keras, TensorFlow, and Deep Learning\nWhat's next? We recommend\nPyImageSearch University\n.\nCourse information:\n120+ total classes • 115+ hours of on-demand code walkthrough videos • Last updated: October 2026\n★★★★★\n4.84 (128 Ratings) • 16,000+ Students Enrolled\nI strongly believe that if you had the right teacher you could\nmaster\ncomputer vision and deep learning.\nDo you think learning computer vision and deep learning has to be time-consuming, overwhelming, and complicated? Or has to involve complex mathematics and equations? Or requires a degree in computer science?\nThat’s\nnot\nthe case.\nAll you need to master computer vision and deep learning is for someone to explain things to you in\nsimple, intuitive\nterms.\nAnd that’s exactly what I do\n. My mission is to change education and how complex Artificial Intelligence topics are taught.\nIf you're serious about learning computer vision, your next stop should be PyImageSearch University, the most comprehensive computer vision, deep learning, and OpenCV course online today. Here you’ll learn how to\nsuccessfully\nand\nconfidently\napply computer vision to your work, research, and projects. Join me in computer vision mastery.\nInside PyImageSearch University you'll find:\n✓\n120+ courses\non essential computer vision, deep learning, and OpenCV topics\n✓\n94+ Certificates\nof Completion\n✓\n115+ hours\nof on-demand video\n✓\nBrand new courses released\nregularly\n, ensuring you can keep up with state-of-the-art techniques\n✓\nPre-configured Jupyter Notebooks in Google Colab\n✓ Run all code examples in your web browser — works on Windows, macOS, and Linux (no dev environment configuration required!)\n✓ Access to\ncentralized code repos for\nall\n540+ tutorials\non PyImageSearch\n✓\nEasy one-click downloads\nfor code, datasets, pre-trained models, etc.\n✓\nAccess\non mobile, laptop, desktop, etc.\nClick here to join PyImageSearch University\nSummary\nIn today’s blog post we learned how to perform object detection using deep learning and OpenCV.\nSpecifically, we used both\nMobileNets + Single Shot Detectors\nalong with OpenCV 3.3’s brand new (totally overhauled)\ndnn\nmodule to detect objects in images.\nAs a computer vision and deep learning community we owe a lot to the contributions of Aleksandr Rybnikov, the main contributor to the\ndnn\nmodule for making deep learning so accessible from within the OpenCV library. You can find Aleksandr’s original OpenCV example script\nhere\n— I have modified it for the purposes of this blog post.\nIn a future blog post I’ll be demonstrating how we can modify today’s tutorial to work with real-time video streams, thus enabling us to perform deep learning-based object detection to videos. We’ll be sure to leverage efficient frame I/O to increase the FPS throughout our pipeline as well.\nTo be notified when future blog posts (such as the real-time object detection tutorial) are published here on PyImageSearch,\nsimply enter your email address in the form below\n.\nDownload the Source Code and FREE 17-page Resource Guide\nEnter your email address below to get a .zip of the code and a\nFREE 17-page Resource Guide on Computer Vision, OpenCV, and Deep Learning.\nInside you'll find my hand-picked tutorials, books, courses, and libraries to help you master CV and DL!\nDownload the code!\nWebsite",
  "metadata": {
    "title": "Object detection with deep learning and OpenCV - PyImageSearch",
    "description": "Learn how to apply object detection using deep learning, Python, and OpenCV with pre-trained Convolutional Neural Networks.",
    "keywords": null,
    "author": "Adrian Rosebrock",
    "og:locale": "en_US",
    "og:type": "article",
    "og:title": "Object detection with deep learning and OpenCV - PyImageSearch",
    "og:description": "Learn how to apply object detection using deep learning, Python, and OpenCV with pre-trained Convolutional Neural Networks.",
    "og:url": "https://pyimagesearch.com/2017/09/11/object-detection-with-deep-learning-and-opencv/",
    "og:site_name": "PyImageSearch",
    "og:image": "https://pyimagesearch.com/wp-content/uploads/2017/09/example06_result.jpg",
    "og:image:width": "600",
    "og:image:height": "552",
    "og:image:type": "image/jpeg",
    "twitter:label1": "Written by",
    "twitter:data1": "Adrian Rosebrock",
    "twitter:label2": "Est. reading time",
    "twitter:data2": "15 minutes",
    "article:published_time": "2017-09-11T14:00:29+00:00",
    "article:modified_time": "2023-05-12T12:37:20+00:00"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [
    {
      "file": "attachments/a0a0a1e75153/code/body-000.txt",
      "chars": 575,
      "language": "text"
    },
    {
      "file": "attachments/a0a0a1e75153/code/body-001.txt",
      "chars": 417,
      "language": "text"
    },
    {
      "file": "attachments/a0a0a1e75153/code/body-002.txt",
      "chars": 135,
      "language": "text"
    },
    {
      "file": "attachments/a0a0a1e75153/code/body-003.txt",
      "chars": 364,
      "language": "text"
    },
    {
      "file": "attachments/a0a0a1e75153/code/body-004.txt",
      "chars": 173,
      "language": "text"
    },
    {
      "file": "attachments/a0a0a1e75153/code/body-005.txt",
      "chars": 961,
      "language": "text"
    },
    {
      "file": "attachments/a0a0a1e75153/code/body-006.txt",
      "chars": 67,
      "language": "text"
    },
    {
      "file": "attachments/a0a0a1e75153/code/body-007.txt",
      "chars": 325,
      "language": "text"
    },
    {
      "file": "attachments/a0a0a1e75153/code/body-008.txt",
      "chars": 312,
      "language": "text"
    },
    {
      "file": "attachments/a0a0a1e75153/code/body-009.txt",
      "chars": 321,
      "language": "text"
    },
    {
      "file": "attachments/a0a0a1e75153/code/body-010.txt",
      "chars": 245,
      "language": "text"
    },
    {
      "file": "attachments/a0a0a1e75153/code/body-011.txt",
      "chars": 306,
      "language": "text"
    },
    {
      "file": "attachments/a0a0a1e75153/code/body-012.txt",
      "chars": 266,
      "language": "text"
    }
  ],
  "images": [
    {
      "status": "ok",
      "url": "https://fast.wistia.com/embed/medias/aiqsb45dl1/swatch",
      "bytes": 1949,
      "reused": false,
      "local_path": "attachments/a0a0a1e75153/images/body-4a239177db74c121bad3.img",
      "src": "https://fast.wistia.com/embed/medias/aiqsb45dl1/swatch",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/example06_result.jpg?lossy=2&strip=1&webp=1",
      "bytes": 52274,
      "reused": false,
      "local_path": "attachments/a0a0a1e75153/images/body-5043b9dd92c436c8df8e.jpg",
      "src": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/example06_result.jpg?lossy=2&strip=1&webp=1",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2020/01/source-code-icon.png?lossy=2&strip=1&webp=1",
      "bytes": 884,
      "reused": false,
      "local_path": "attachments/a0a0a1e75153/images/body-0f8ec41d2103feb4399d.png",
      "src": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2020/01/source-code-icon.png?lossy=2&strip=1&webp=1",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/single_shot_detector_example.jpg?lossy=2&strip=1&webp=1",
      "bytes": 47253,
      "reused": false,
      "local_path": "attachments/a0a0a1e75153/images/body-c42500bea65bc363f3bc.jpg",
      "src": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/single_shot_detector_example.jpg?lossy=2&strip=1&webp=1",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/mobilenet_depthwise.png?lossy=2&strip=1&webp=1",
      "bytes": 5494,
      "reused": false,
      "local_path": "attachments/a0a0a1e75153/images/body-e7c614d90d320c12f138.png",
      "src": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/mobilenet_depthwise.png?lossy=2&strip=1&webp=1",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/example01_result.jpg?lossy=2&strip=1&webp=1",
      "bytes": 27956,
      "reused": false,
      "local_path": "attachments/a0a0a1e75153/images/body-aa2bc16911439e409276.jpg",
      "src": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/example01_result.jpg?lossy=2&strip=1&webp=1",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/example02_result-300x218.jpg?lossy=2&strip=1&webp=1",
      "bytes": 6089,
      "reused": false,
      "local_path": "attachments/a0a0a1e75153/images/body-328cb0af165e5849b776.jpg",
      "src": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/example02_result-300x218.jpg?lossy=2&strip=1&webp=1",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/example03_result.jpg?lossy=2&strip=1&webp=1",
      "bytes": 70150,
      "reused": false,
      "local_path": "attachments/a0a0a1e75153/images/body-ebba834998df231d1079.jpg",
      "src": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/example03_result.jpg?lossy=2&strip=1&webp=1",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/example04_result-212x300.jpg?lossy=2&strip=1&webp=1",
      "bytes": 14161,
      "reused": false,
      "local_path": "attachments/a0a0a1e75153/images/body-3f602a312c404670481d.jpg",
      "src": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/example04_result-212x300.jpg?lossy=2&strip=1&webp=1",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/example05_result.jpg?lossy=2&strip=1&webp=1",
      "bytes": 72166,
      "reused": false,
      "local_path": "attachments/a0a0a1e75153/images/body-09ca59da5a5aad6400ed.jpg",
      "src": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/example05_result.jpg?lossy=2&strip=1&webp=1",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/example06_result-1.jpg?lossy=2&strip=1&webp=1",
      "bytes": 52274,
      "reused": false,
      "local_path": "attachments/a0a0a1e75153/images/body-3e5d6d2374bd99caf8f7.jpg",
      "src": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2017/09/example06_result-1.jpg?lossy=2&strip=1&webp=1",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://fast.wistia.com/embed/medias/kno0cmko2z/swatch",
      "bytes": 3143,
      "reused": false,
      "local_path": "attachments/a0a0a1e75153/images/body-8ec9834d54100244f57f.img",
      "src": "https://fast.wistia.com/embed/medias/kno0cmko2z/swatch",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2020/01/cta-source-guide-1.png?lossy=2&strip=1&webp=1",
      "bytes": 28126,
      "reused": false,
      "local_path": "attachments/a0a0a1e75153/images/body-8cd5816cf73385d96fcd.png",
      "src": "https://b2633864.assetcdn.net/2633864/wp-content/uploads/2020/01/cta-source-guide-1.png?lossy=2&strip=1&webp=1",
      "alt": "",
      "downloaded": true
    }
  ],
  "audio": [],
  "videos": [],
  "links": [
    {
      "href": "https://pyimagesearch.com/2017/08/21/deep-learning-with-opencv/",
      "label": "classify images using deep learning",
      "type": "a"
    },
    {
      "href": "https://roboflow.com/?ref=pyimagesearch",
      "label": "Roboflow",
      "type": "a"
    },
    {
      "href": "https://universe.roboflow.com/pyimagesearch?ref=pyimagesearch",
      "label": "PyimageSearch’s assorted library of useful datasets",
      "type": "a"
    },
    {
      "href": "https://arxiv.org/abs/1506.01497",
      "label": "Faster R-CNNs",
      "type": "a"
    },
    {
      "href": "https://arxiv.org/abs/1506.02640",
      "label": "You Only Look Once (YOLO)",
      "type": "a"
    },
    {
      "href": "https://arxiv.org/abs/1512.02325",
      "label": "Single Shot Detectors (SSDs)",
      "type": "a"
    },
    {
      "href": "https://arxiv.org/abs/1704.04861",
      "label": "MobileNets",
      "type": "a"
    },
    {
      "href": "https://github.com/Zehaos/MobileNet",
      "label": "original TensorFlow implementation",
      "type": "a"
    },
    {
      "href": "https://github.com/chuanqi305/MobileNet-SSD",
      "label": "see GitHub",
      "type": "a"
    },
    {
      "href": "http://cocodataset.org/",
      "label": "COCO dataset",
      "type": "a"
    },
    {
      "href": "https://pyimagesearch.com/2018/11/12/yolo-object-detection-with-opencv/",
      "label": "YOLO object detection with OpenCV",
      "type": "a"
    },
    {
      "href": "https://pyimagesearch.com/2020/01/27/yolo-and-tiny-yolo-object-detection-on-the-raspberry-pi-and-movidius-ncs/",
      "label": "YOLO and Tiny-YOLO object detection on the Raspberry Pi and Movidius NCS",
      "type": "a"
    },
    {
      "href": "https://learnopencv.com/faster-r-cnn-object-detection-with-pytorch/",
      "label": "Faster R-CNN and OpenCV",
      "type": "a"
    },
    {
      "href": "https://pyimagesearch.com/2018/11/19/mask-r-cnn-with-opencv/",
      "label": "Mask R-CNN and OpenCV",
      "type": "a"
    },
    {
      "href": "https://github.com/fizyr/keras-retinanet",
      "label": "RetinaNet object detector",
      "type": "a"
    },
    {
      "href": "https://pyimagesearch.com/2020/06/22/turning-any-cnn-image-classifier-into-an-object-detector-with-keras-tensorflow-and-opencv/",
      "label": "Turning any CNN image classifier into an object detector with Keras, TensorFlow, and OpenCV",
      "type": "a"
    },
    {
      "href": "https://pyimagesearch.com/2020/06/29/opencv-selective-search-for-object-detection/",
      "label": "OpenCV Selective Search for Object Detection",
      "type": "a"
    },
    {
      "href": "https://pyimagesearch.com/2020/07/06/region-proposal-object-detection-with-opencv-keras-and-tensorflow/",
      "label": "Region proposal object detection with OpenCV, Keras, and TensorFlow",
      "type": "a"
    },
    {
      "href": "https://pyimagesearch.com/2020/07/13/r-cnn-object-detection-with-keras-tensorflow-and-deep-learning/",
      "label": "R-CNN object detection with Keras, TensorFlow, and Deep Learning",
      "type": "a"
    },
    {
      "href": "https://pyimagesearch.com/2020/10/05/object-detection-bounding-box-regression-with-keras-tensorflow-and-deep-learning/",
      "label": "Object detection: Bounding box regression with Keras, TensorFlow, and Deep Learning",
      "type": "a"
    },
    {
      "href": "https://pyimagesearch.com/2020/10/12/multi-class-object-detection-and-bounding-box-regression-with-keras-tensorflow-and-deep-learning/",
      "label": "Multi-class object detection and bounding box regression with Keras, TensorFlow, and Deep Learning",
      "type": "a"
    },
    {
      "href": "https://pyimagesearch.com/pyimagesearch-university/?utm_source=blogPost&utm_medium=bottomBanner&utm_campaign=What%27s%20next%3F%20I%20recommend",
      "label": "PyImageSearch University",
      "type": "a"
    },
    {
      "href": "https://github.com/opencv/opencv/blob/master/samples/dnn/mobilenet_ssd_python.py",
      "label": "here",
      "type": "a"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-14T10:54:10Z",
  "source_url": "https://pyimagesearch.com/2017/09/11/object-detection-with-deep-learning-and-opencv/",
  "papers": [
    {
      "status": "ok",
      "url": "https://arxiv.org/pdf/1506.01497",
      "bytes": 6913803,
      "reused": true,
      "local_path": "papers/repair/713fc776568d336b3d68.pdf"
    },
    {
      "status": "ok",
      "url": "https://arxiv.org/pdf/1506.02640",
      "bytes": 5296750,
      "reused": true,
      "local_path": "papers/repair/27e378fce20ee7c0b279.pdf"
    },
    {
      "status": "ok",
      "url": "https://arxiv.org/pdf/1512.02325",
      "bytes": 2494225,
      "reused": false,
      "local_path": "papers/repair/b5f5e9ca4f7f92190f2f.pdf"
    },
    {
      "status": "ok",
      "url": "https://arxiv.org/pdf/1704.04861",
      "bytes": 941241,
      "reused": true,
      "local_path": "papers/repair/1ad0e87aa84eb38999ad.pdf"
    }
  ],
  "actual_video_files": [
    {
      "local_path": "attachments/a0a0a1e75153/videos/aiqsb45dl1.mp4",
      "bytes": 214953225,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "398.233000",
      "status": "ok"
    }
  ],
  "body_chars": 21605,
  "expected_body_images": 13,
  "discovery_status": "ok",
  "delivery_status": "ok",
  "missing_reason": "",
  "raw_html": "attachments/a0a0a1e75153/pages/source.html",
  "local_html": "attachments/a0a0a1e75153/pages/article.html",
  "body_base_path": "attachments/a0a0a1e75153/pages/",
  "body_markdown_path": "attachments/a0a0a1e75153/pages/article.md"
}