{"id":24098466,"url":"https://github.com/matlab-deep-learning/object-detection-using-pretrained-yolo-v2","last_synced_at":"2025-05-07T19:24:56.065Z","repository":{"id":118345086,"uuid":"346324778","full_name":"matlab-deep-learning/Object-Detection-Using-Pretrained-YOLO-v2","owner":"matlab-deep-learning","description":"YOLO v2 prediction and training in MATLAB for Object Detection with darknet19 \u0026 tinyYOLOv2 base networks","archived":false,"fork":false,"pushed_at":"2024-02-01T12:18:28.000Z","size":64,"stargazers_count":18,"open_issues_count":0,"forks_count":20,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-14T21:51:24.861Z","etag":null,"topics":["computer-vision","deep-learning","image-processing","matlab","matlab-deep-learning","object-detection","pretrained-models","transfer-learning","yolo","yolov2"],"latest_commit_sha":null,"homepage":"https://www.mathworks.com/help/vision/ug/getting-started-with-yolo-v2.html","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matlab-deep-learning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-03-10T10:59:13.000Z","updated_at":"2024-11-20T07:00:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"acd0c10c-6ca2-4a93-a71b-7de96987c289","html_url":"https://github.com/matlab-deep-learning/Object-Detection-Using-Pretrained-YOLO-v2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2FObject-Detection-Using-Pretrained-YOLO-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2FObject-Detection-Using-Pretrained-YOLO-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2FObject-Detection-Using-Pretrained-YOLO-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2FObject-Detection-Using-Pretrained-YOLO-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matlab-deep-learning","download_url":"https://codeload.github.com/matlab-deep-learning/Object-Detection-Using-Pretrained-YOLO-v2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252942315,"owners_count":21829047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","deep-learning","image-processing","matlab","matlab-deep-learning","object-detection","pretrained-models","transfer-learning","yolo","yolov2"],"created_at":"2025-01-10T14:46:01.666Z","updated_at":"2025-05-07T19:24:56.042Z","avatar_url":"https://github.com/matlab-deep-learning.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pretrained YOLO v2 For Object Detection\n\nThis repository implements pretrained YOLO v2 [1] object detectors in MATLAB. [![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=matlab-deep-learning/Object-Detection-Using-Pretrained-YOLO-v2)\n\n**Creator**: MathWorks Development\n\n\n## Requirements  \n- MATLAB® R2020a or later\n- Deep Learning Toolbox™\n- Computer Vision Toolbox™\n- Computer Vision Toolbox™ Model for YOLO v2 Object Detection\n\nNote: Previous MATLAB® release users can use [this](https://github.com/matlab-deep-learning/Object-Detection-Using-Pretrained-YOLO-v2/tree/previous) branch to download the pretrained models.\n\n\n## Getting Started\n[Getting Started with YOLO v2](https://in.mathworks.com/help/vision/ug/getting-started-with-yolo-v2.html)\n\n\n### Detect Objects Using Pretrained YOLO v2\nUse to code below to perform detection on an example image using the pretrained model.\n\nNote: This functionality requires Deep Learning Toolbox™ and the Computer Vision Toolbox™ for YOLO v2 Object Detection. You can install the Computer Vision Toolbox for YOLO v2 Object Detection from Add-On Explorer. For more information about installing add-ons, see [Get and Manage Add-Ons](https://in.mathworks.com/help/matlab/matlab_env/get-add-ons.html).\n\n```\n% Load pretrained detector\nmodelName = 'tiny-yolov2-coco';\ndetector = yolov2ObjectDetector(name);\n\n% Read test image.\nimg = imread('sherlock.jpg');\n\n% Detect objects in the test image.\n[boxes, scores, labels] = detect(detector, img);\n\n% Visualize detection results.\nimg = insertObjectAnnotation(img, 'rectangle', bboxes, scores);\nfigure, imshow(img)\n```\n![alt text](images/results.jpg?raw=true)\n\n### Choosing a Pretrained YOLO v2 Object Detector\nYou can choose the ideal YOLO v2 object detector for your application based on the below table:\n\n| Model | mAP | Size (MB) | Classes | Speed in Frames Per Second (FPS) |\n| ------ | ------ |  ------ | ------ | ------ |\n| Darknet19-COCO | 28.7 | 181 | [coco class names](+helper/coco-classes.txt) | 17.8 |\n| Tiny-YOLO_v2-COCO | 10.5 | 40 | [coco class names](+helper/coco-classes.txt) | 32 |\n\n- Performance (in FPS) is measured on a TITAN-XP machine using:\n    - 608x608 image for Darknet19-COCO.\n    - 416x416 image for Tiny-YOLO_v2-COCO.\n- mAP for models trained on the COCO dataset is computed as average over IoU of .5:.95.\n\n### Train Custom YOLO v2 Detector Using Transfer Learning\nTo train a YOLO v2 object detection network on a labeled data set, use the [trainYOLOv2ObjectDetector](https://in.mathworks.com/help/vision/ref/trainyolov2objectdetector.html) function. You must specify the class names for the data set you use to train the network. Then, train an untrained or pretrained network by using the [trainYOLOv2ObjectDetector](https://in.mathworks.com/help/vision/ref/trainyolov2objectdetector.html) function. The training function returns the trained network as a [yolov2ObjectDetector](https://in.mathworks.com/help/vision/ref/yolov2objectdetector.html) object.\n\nFor more information about training a YOLO v2 object detector, see [Object Detection using YOLO v2 Deep Learning Example](https://www.mathworks.com/help/vision/ug/train-an-object-detector-using-you-only-look-once.html).\n\n## Code Generation\nCode generation enables you to generate code and deploy YOLO v2 on multiple embedded platforms. For more information about generating CUDA® code using the YOLO v2 object detector see [Code Generation for Object Detection by Using YOLO v2](https://www.mathworks.com/help//deeplearning/ug/code-generation-for-object-detection-using-yolo-v2.html)\n\n## YOLO v2 Algorithm Details\nYOLO v2 is a popular single stage object detectors that performs detection and classification using CNNs. The YOLO v2 network is composed of a backbone feature extraction network and a detection head for the localization of objects in an image. For more information about YOLO v2, see [Getting Started with YOLO v2](https://www.mathworks.com/help/vision/ug/getting-started-with-yolo-v2.html). \n\n![alt text](images/yolo_model.png?raw=true) \n\n## References\n[1] Redmon, Joseph, and Ali Farhadi. \"YOLO9000: better, faster, stronger.\" Proceedings of the IEEE conference on computer vision and pattern recognition. 2017.\n\n[2] Lin, T., et al. \"Microsoft COCO: Common objects in context. arXiv 2014.\" arXiv preprint arXiv:1405.0312 (2014).\n\n[3] The PASCAL Visual Object Classes Challenge: A Retrospective Everingham, M., Eslami, S. M. A., Van Gool, L., Williams, C. K. I., Winn, J. and Zisserman, A. International Journal of Computer Vision, 111(1), 98-136, 2015.\n\n\nCopyright 2021 - 2024 The MathWorks, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatlab-deep-learning%2Fobject-detection-using-pretrained-yolo-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatlab-deep-learning%2Fobject-detection-using-pretrained-yolo-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatlab-deep-learning%2Fobject-detection-using-pretrained-yolo-v2/lists"}