All Projects → zhiqwang → Yolov5 Rt Stack

zhiqwang / Yolov5 Rt Stack

Licence: gpl-3.0
Yet another yolov5, with its runtime stack for libtorch, onnx, tvm and specialized accelerators. You like torchvision's retinanet? You like yolov5? You love yolort!

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Yolov5 Rt Stack

Rectlabel Support
RectLabel - An image annotation tool to label images for bounding box object detection and segmentation.
Stars: ✭ 338 (+215.89%)
Mutual labels:  yolo, detection
Tensorflow object tracking video
Object Tracking in Tensorflow ( Localization Detection Classification ) developed to partecipate to ImageNET VID competition
Stars: ✭ 491 (+358.88%)
Mutual labels:  yolo, detection
Gfocal
Generalized Focal Loss: Learning Qualified and Distributed Bounding Boxes for Dense Object Detection, NeurIPS2020
Stars: ✭ 376 (+251.4%)
Mutual labels:  inference, detection
Mivisionx
MIVisionX toolkit is a set of comprehensive computer vision and machine intelligence libraries, utilities, and applications bundled into a single toolkit. AMD MIVisionX also delivers a highly optimized open-source implementation of the Khronos OpenVX™ and OpenVX™ Extensions.
Stars: ✭ 100 (-6.54%)
Mutual labels:  inference, onnx
Yolo tensorflow
Tensorflow implementation of YOLO, including training and test phase.
Stars: ✭ 772 (+621.5%)
Mutual labels:  yolo, detection
Tensorflow 2.x Yolov3
YOLOv3 implementation in TensorFlow 2.3.1
Stars: ✭ 300 (+180.37%)
Mutual labels:  yolo, detection
Tfjs Yolo Tiny
In-Browser Object Detection using Tiny YOLO on Tensorflow.js
Stars: ✭ 465 (+334.58%)
Mutual labels:  yolo, detection
object-tracking
Multiple Object Tracking System in Keras + (Detection Network - YOLO)
Stars: ✭ 89 (-16.82%)
Mutual labels:  detection, yolo
Multi Model Server
Multi Model Server is a tool for serving neural net models for inference
Stars: ✭ 770 (+619.63%)
Mutual labels:  inference, onnx
Android Yolo
Real-time object detection on Android using the YOLO network with TensorFlow
Stars: ✭ 604 (+464.49%)
Mutual labels:  yolo, detection
serving-runtime
Exposes a serialized machine learning model through a HTTP API.
Stars: ✭ 15 (-85.98%)
Mutual labels:  inference, onnx
Maskyolo caffe
YOLO V2 & V3 , YOLO Combined with RCNN and MaskRCNN
Stars: ✭ 101 (-5.61%)
Mutual labels:  yolo, detection
person-detection
TensorRT person tracking RFBNet300
Stars: ✭ 30 (-71.96%)
Mutual labels:  detection, onnx
Php Opencv Examples
Tutorial for computer vision and machine learning in PHP 7/8 by opencv (installation + examples + documentation)
Stars: ✭ 333 (+211.21%)
Mutual labels:  onnx, detection
multiple-object-tracking
combine state of art deep neural network based detectors with most efficient trackers to solve motion based multiple objects tracking problems
Stars: ✭ 25 (-76.64%)
Mutual labels:  detection, yolo
Trainyourownyolo
Train a state-of-the-art yolov3 object detector from scratch!
Stars: ✭ 399 (+272.9%)
Mutual labels:  yolo, inference
optimum
🏎️ Accelerate training and inference of 🤗 Transformers with easy to use hardware optimization tools
Stars: ✭ 567 (+429.91%)
Mutual labels:  inference, onnx
YOLOX
YOLOX is a high-performance anchor-free YOLO, exceeding yolov3~v5 with MegEngine, ONNX, TensorRT, ncnn, and OpenVINO supported. Documentation: https://yolox.readthedocs.io/
Stars: ✭ 6,570 (+6040.19%)
Mutual labels:  yolo, onnx
Yolov5 ncnn
🍅 Deploy NCNN on mobile phones. Support Android and iOS. 移动端NCNN部署,支持Android与iOS。
Stars: ✭ 535 (+400%)
Mutual labels:  yolo, detection
Yolov3
YOLOv3 in PyTorch > ONNX > CoreML > TFLite
Stars: ✭ 8,159 (+7525.23%)
Mutual labels:  yolo, onnx

🔦 yolort - YOLOv5 Runtime Stack

CI testing PyPI version codecov Slack

What it is. Yet another implementation of Ultralytics's yolov5, and with modules refactoring to make it available in deployment backends such as libtorch, onnxruntime, tvm and so on.

About the code. Follow the design principle of detr:

object detection should not be more difficult than classification, and should not require complex libraries for training and inference.

yolort is very simple to implement and experiment with. You like the implementation of torchvision's faster-rcnn, retinanet or detr? You like yolov5? You love yolort!

YOLO inference demo

🆕 What's New

  • Support exporting to TorchScript model. Oct. 8, 2020.
  • Support inferring with LibTorch cpp interface. Oct. 10, 2020.
  • Add TorchScript cpp inference example. Nov. 4, 2020.
  • Refactor YOLO modules and support dynmaic batching inference. Nov. 16, 2020.
  • Support exporting to ONNX, and inferring with ONNXRuntime interface. Nov. 17, 2020.
  • Add graph visualization tools. Nov. 21, 2020.
  • Add TVM compile and inference notebooks. Feb. 5, 2021.

🛠️ Usage

There are no extra compiled components in yolort and package dependencies are minimal, so the code is very simple to use.

Installation and Inference Examples

  • Above all, follow the official instructions to install PyTorch 1.7.0+ and torchvision 0.8.1+

  • Installation via Pip

    Simple installation from PyPI

    pip install -U yolort
    

    Or from Source

    # clone yolort repository locally
    git clone https://github.com/zhiqwang/yolov5-rt-stack.git
    cd yolov5-rt-stack
    # install in editable mode
    pip install -e .
    
  • Install pycocotools (for evaluation on COCO):

    pip install -U 'git+https://github.com/ppwwyyxx/cocoapi.git#subdirectory=PythonAPI'
    
  • To read a source of image(s) and detect its objects 🔥

    from yolort.models import yolov5s
    
    # Load model
    model = yolov5s(pretrained=True, score_thresh=0.45)
    model.eval()
    
    # Perform inference on an image file
    predictions = model.predict('bus.jpg')
    # Perform inference on a list of image files
    predictions = model.predict(['bus.jpg', 'zidane.jpg'])
    

Loading via torch.hub

The models are also available via torch hub, to load yolov5s with pretrained weights simply do:

model = torch.hub.load('zhiqwang/yolov5-rt-stack', 'yolov5s', pretrained=True)

Updating checkpoint from ultralytics/yolov5

The module state of yolort has some differences comparing to ultralytics/yolov5. We can load ultralytics's trained model checkpoint with minor changes, and we have converted ultralytics's release v3.1 and v4.0. For example, if you want to convert a yolov5s (release 4.0) model, you can just run the following script:

from yolort.utils import update_module_state_from_ultralytics

# Update module state from ultralytics
model = update_module_state_from_ultralytics(arch='yolov5s', version='v4.0')
# Save updated module
torch.save(model.state_dict(), 'yolov5s_updated.pt')

Inference on LibTorch backend 🚀

We provide a notebook to demonstrate how the model is transformed into torchscript. And we provide an C++ example of how to infer with the transformed torchscript model. For details see the GitHub actions.

🎨 Model Graph Visualization

Now, yolort can draw the model graph directly, checkout our visualize-jit-models notebook to see how to use and visualize the model graph.

YOLO model visualize

🎓 Acknowledgement

  • The implementation of yolov5 borrow the code from ultralytics.
  • This repo borrows the architecture design and part of the code from torchvision.

🤗 Contributing

We appreciate all contributions. If you are planning to contribute back bug-fixes, please do so without any further discussion. If you plan to contribute new features, utility functions or extensions, please first open an issue and discuss the feature with us. BTW, leave a 🌟 if you liked it, this means a lot to us :)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].