├── data ├── inputTeam.jpg ├── results.jpg └── yolox_arch.png ├── SECURITY.md ├── .circleci └── config.yml ├── LICENSE └── README.md /data/inputTeam.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matlab-deep-learning/Pretrained-YOLOX-Network-For-Object-Detection/HEAD/data/inputTeam.jpg -------------------------------------------------------------------------------- /data/results.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matlab-deep-learning/Pretrained-YOLOX-Network-For-Object-Detection/HEAD/data/results.jpg -------------------------------------------------------------------------------- /data/yolox_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matlab-deep-learning/Pretrained-YOLOX-Network-For-Object-Detection/HEAD/data/yolox_arch.png -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting Security Vulnerabilities 2 | 3 | If you believe you have discovered a security vulnerability, please report it to 4 | [security@mathworks.com](mailto:security@mathworks.com). Please see 5 | [MathWorks Vulnerability Disclosure Policy for Security Researchers](https://www.mathworks.com/company/aboutus/policies_statements/vulnerability-disclosure-policy.html) 6 | for additional information. 7 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | orbs: 3 | matlab: mathworks/matlab@0.7.1 4 | 5 | jobs: 6 | build: 7 | machine: 8 | image: ubuntu-2004:202111-02 9 | steps: 10 | - checkout 11 | - matlab/install: 12 | release: R2022a 13 | - matlab/run-tests: 14 | test-results-junit: artifacts/test_results/matlab/results.xml 15 | # Have to add test/tools to the path for certain tests. 16 | source-folder: .;test/tools;src 17 | - store_test_results: 18 | path: artifacts/test_results 19 | - store_artifacts: 20 | path: artifacts/ 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022, The MathWorks, Inc. 2 | All rights reserved. 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 5 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 6 | 3. In all cases, the software is, and all modifications and derivatives of the software shall be, licensed to you solely for use in conjunction with MathWorks products and service offerings. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pretrained YOLOX Network For Object Detection 2 | 3 | This repository provides multiple pretrained YOLOX [1] object detection networks for MATLAB®, trained on the COCO 2017[2] dataset. These object detectors can detect 80 different object categories including [person, car, traffic light, etc](/src/%2Bhelper/getCOCOClasess.m). [![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/Pretrained-YOLOX-Network-For-Object-Detection) 4 | 5 | **Creator**: MathWorks Development 6 | 7 | 8 | ## Requirements 9 | - MATLAB® R2023b or later 10 | - Deep Learning Toolbox™ 11 | - Computer Vision Toolbox™ 12 | - Computer Vision Toolbox™ Automated Visual Inspection Library 13 | 14 | Note: Previous MATLAB® release users can use [this](https://github.com/matlab-deep-learning/Pretrained-YOLOX-Network-For-Object-Detection/tree/previous) branch to download the pretrained models. 15 | 16 | 17 | ## Getting Started 18 | [Getting Started with YOLOX for Object Detection](https://in.mathworks.com/help/vision/ug/getting-started-with-yolox-object-detection.html) 19 | 20 | 21 | ### Detect Objects Using Pretrained YoloX 22 | Use to code below to perform detection on an example image using the pretrained model. 23 | 24 | Note: This functionality requires Deep Learning Toolbox™ and the Computer Vision Toolbox™ Automated Visual Inspection Library. You can install the Computer Vision Toolbox Automated Visual Inspection Library 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). 25 | 26 | ```matlab 27 | % Read test image. 28 | img = imread(fullfile("data", "inputTeam.jpg")); 29 | 30 | % Create a yoloxobjectdetector object to configure a pretrained YOLOX network with a CSP-DarkNet-53 backbone as the feature extractor. 31 | detector = yoloxObjectDetector("small-coco"); 32 | 33 | % Perform detection using pretrained model. 34 | [bboxes,scores,labels] = detect(detector,I); 35 | 36 | % Visualize results. 37 | annotations = string(labels) + ": " + (round(100*scores)) + "%"; 38 | img = insertObjectAnnotation(img, "rectangle", bboxes, annotations); 39 | figure, imshow(img); 40 | ``` 41 | ![Results](/data/results.jpg) 42 | 43 | ### Train YOLOX Network and Perform Transfer Learning 44 | To train a YOLOX object detection network on a labeled data set, use the [trainYOLOXObjectDetector](https://in.mathworks.com/help/vision/ref/trainyoloxobjectdetector.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 [trainYOLOXObjectDetector](https://in.mathworks.com/help/vision/ref/trainyoloxobjectdetector.html) function. The training function returns the trained network as a [yoloxObjectDetector](https://in.mathworks.com/help/vision/ref/yoloxobjectdetector.html) object. 45 | 46 | To learn how to configure and train a YOLOX object detector for transfer learning to detect small objects, see the [Detect Defects on Printed Circuit Boards Using YOLOX Network](https://in.mathworks.com/help/vision/ug/detect-pcb-defects-using-yolox-deep-learning.html) example. 47 | 48 | 49 | ## Network Details 50 | YOLOX is one of the best performing object detectors and is considered as an improvement to the existing YOLO variants such as YOLO v4, and YOLO v5. 51 | ![YOLOX architecture](/data/yolox_arch.png) 52 | 53 | 54 | ## References 55 | [1] Ge, Zheng, Songtao Liu, Feng Wang, Zeming Li, and Jian Sun. "Yolox: Exceeding yolo series in 2021." arXiv preprint arXiv:2107.08430 (2021). 56 | 57 | [2] Lin, T., et al. "Microsoft COCO: Common objects in context. arXiv 2014." arXiv preprint arXiv:1405.0312 (2014). 58 | 59 | 60 | Copyright 2022 - 2024 The MathWorks, Inc. 61 | --------------------------------------------------------------------------------