All Projects → BMW-InnovationLab → Bmw Yolov4 Inference Api Gpu

BMW-InnovationLab / Bmw Yolov4 Inference Api Gpu

Licence: bsd-3-clause
This is a repository for an nocode object detection inference API using the Yolov3 and Yolov4 Darknet framework.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Bmw Yolov4 Inference Api Gpu

Bmw Yolov4 Inference Api Cpu
This is a repository for an nocode object detection inference API using the Yolov4 and Yolov3 Opencv.
Stars: ✭ 180 (-24.05%)
Mutual labels:  api, rest-api, yolov3, inference, bounding-boxes
Bmw Tensorflow Inference Api Cpu
This is a repository for an object detection inference API using the Tensorflow framework.
Stars: ✭ 158 (-33.33%)
Mutual labels:  api, rest-api, deeplearning, inference, bounding-boxes
Bmw Yolov4 Training Automation
This repository allows you to get started with training a state-of-the-art Deep Learning model with little to no configuration needed! You provide your labeled dataset or label your dataset using our BMW-LabelTool-Lite and you can start the training right away and monitor it in many different ways like TensorBoard or a custom REST API and GUI. NoCode training with YOLOv4 and YOLOV3 has never been so easy.
Stars: ✭ 533 (+124.89%)
Mutual labels:  rest-api, deeplearning, yolo, yolov3
Bmw Tensorflow Inference Api Gpu
This is a repository for an object detection inference API using the Tensorflow framework.
Stars: ✭ 277 (+16.88%)
Mutual labels:  api, rest-api, gpu, inference
Trainyourownyolo
Train a state-of-the-art yolov3 object detector from scratch!
Stars: ✭ 399 (+68.35%)
Mutual labels:  gpu, yolo, yolov3, inference
Server
Serve your Rubix ML models in production with scalable stand-alone model inference servers.
Stars: ✭ 30 (-87.34%)
Mutual labels:  api, rest-api, inference
Alturos.ImageAnnotation
A collaborative tool for labeling image data for yolo
Stars: ✭ 47 (-80.17%)
Mutual labels:  yolo, bounding-boxes, yolov3
Bmw Labeltool Lite
This repository provides you with a easy to use labeling tool for State-of-the-art Deep Learning training purposes.
Stars: ✭ 145 (-38.82%)
Mutual labels:  yolo, yolov3, inference
Object Detection Api
Yolov3 Object Detection implemented as APIs, using TensorFlow and Flask
Stars: ✭ 177 (-25.32%)
Mutual labels:  yolo, yolov3, inference
Dialetus Service
API to Informal dictionary for the idiomatic expressions that each Brazilian region It has
Stars: ✭ 202 (-14.77%)
Mutual labels:  api, rest-api
Pine
🌲 Aimbot powered by real-time object detection with neural networks, GPU accelerated with Nvidia. Optimized for use with CS:GO.
Stars: ✭ 202 (-14.77%)
Mutual labels:  yolo, yolov3
Rest Api
Learn how to build your own REST API with Python, Django, and the Django Rest Framework.
Stars: ✭ 232 (-2.11%)
Mutual labels:  api, rest-api
Jikan Rest
The REST API for Jikan
Stars: ✭ 200 (-15.61%)
Mutual labels:  api, rest-api
Co Cart
🛒 CoCart is a flexible, open-source solution to enabling the shopping cart via the REST API for WooCommerce.
Stars: ✭ 198 (-16.46%)
Mutual labels:  api, rest-api
Swiftdailyapi
A Swift API framework for ZhiHu's Daily News.
Stars: ✭ 204 (-13.92%)
Mutual labels:  api, rest-api
Deepdetect
Deep Learning API and Server in C++14 support for Caffe, Caffe2, PyTorch,TensorRT, Dlib, NCNN, Tensorflow, XGBoost and TSNE
Stars: ✭ 2,306 (+873%)
Mutual labels:  rest-api, gpu
Drago
A flexible configuration manager for Wireguard networks
Stars: ✭ 204 (-13.92%)
Mutual labels:  api, rest-api
Caffe Yolov3 Windows
A windows caffe implementation of YOLO detection network
Stars: ✭ 210 (-11.39%)
Mutual labels:  yolo, yolov3
Api
API that uncovers the technologies used on websites and generates thumbnail from screenshot of website
Stars: ✭ 189 (-20.25%)
Mutual labels:  api, rest-api
Openapi Directory
🌐 Wikipedia for Web APIs. Directory of REST API definitions in OpenAPI 2.0/3.x format
Stars: ✭ 2,635 (+1011.81%)
Mutual labels:  api, rest-api

YOLOv4-v3 Darknet GPU Inference API

This is a repository for an object detection inference API using the Yolov4 Darknet framework.

This Repository has also cross compatibility for Yolov3 darknet models.

This Repository has also support for state of the art Yolov4 models

This repo is based on AlexeyAB darknet repository.

The inference REST API works on GPU. It's supported only on Linux Operating systems.

Models trained using our training automation Yolov4 and Yolov3 repository can be deployed in this API. Several object detection models can be loaded and used at the same time.

To choose Yolov4 instead of Yolov3 training just change the inference engine name in the config.json inside your model folder.

This repo can be deployed using either docker or docker swarm.

Please use docker swarm only if you need to:

  • Provide redundancy in terms of API containers: In case a container went down, the incoming requests will be redirected to another running instance.

  • Coordinate between the containers: Swarm will orchestrate between the APIs and choose one of them to listen to the incoming request.

  • Scale up the Inference service in order to get a faster prediction especially if there's traffic on the service.

If none of the aforementioned requirements are needed, simply use docker.

predict image

Prerequisites

  • Ubuntu 18.04
  • NVIDIA Drivers (410.x or higher)
  • Docker CE latest stable release
  • NVIDIA Docker 2

Check for prerequisites

To check if you have docker-ce installed:

docker --version

To check if you have nvidia-docker installed:

nvidia-docker --version

To check your nvidia drivers version, open your terminal and type the command nvidia-smi

img

Install prerequisites

Use the following command to install docker on Ubuntu:

chmod +x install_prerequisites.sh && source install_prerequisites.sh

Install NVIDIA Drivers (410.x or higher) and NVIDIA Docker for GPU by following the official docs

Build The Docker Image

In order to build the project run the following command from the project's root directory:

sudo docker build -t yolov4_inference_api_gpu -f ./docker/dockerfile .

Behind a proxy

sudo docker build --build-arg http_proxy='' --build-arg https_proxy='' -t yolov4_inference_api_gpu -f ./docker/dockerfile .

Run The Docker Container

As mentioned before, this container can be deployed using either docker or docker swarm.

If you wish to deploy this API using docker, please issue the following run command.

If you wish to deploy this API using docker swarm, please refer to following link docker swarm documentation. After deploying the API with docker swarm, please consider returning to this documentation for further information about the API endpoints as well as the model structure sections.

To run the API, go the to the API's directory and run the following:

Using Linux based docker:

sudo NV_GPU=0 nvidia-docker run -itv $(pwd)/models:/models -v $(pwd)/models_hash:/models_hash -p <docker_host_port>:1234 yolov4_inference_api_gpu

The <docker_host_port> can be any unique port of your choice.

The API file will be run automatically, and the service will listen to http requests on the chosen port.

NV_GPU defines on which GPU you want the API to run. If you want the API to run on multiple GPUs just enter multiple numbers seperated by a comma: (NV_GPU=0,1 for example)

API Endpoints

To see all available endpoints, open your favorite browser and navigate to:

http://<machine_IP>:<docker_host_port>/docs

The 'predict_batch' endpoint is not shown on swagger. The list of files input is not yet supported.

P.S: If you are using custom endpoints like /load, /detect, and /get_labels, you should always use the /load endpoint first and then use /detect or /get_labels

Endpoints summary

/load (GET)

Loads all available models and returns every model with it's hashed value. Loaded models are stored and aren't loaded again

load model

/detect (POST)

Performs inference on specified model, image, and returns bounding-boxes

detect image

/get_labels (POST)

Returns all of the specified model labels with their hashed values

get model labels

/models/{model_name}/predict_image (POST)

Performs inference on specified model, image, draws bounding boxes on the image, and returns the actual image as response

predict image

/models (GET)

Lists all available models

/models/{model_name}/load (GET)

Loads the specified model. Loaded models are stored and aren't loaded again

/models/{model_name}/predict (POST)

Performs inference on specified model, image, and returns bounding boxes.

/models/{model_name}/labels (GET)

Returns all of the specified model labels

/models/{model_name}/config (GET)

Returns the specified model's configuration

/models/{model_name}/predict_batch (POST)

Performs inference on specified model and a list of images, and returns bounding boxes

P.S: Custom endpoints like /load, /detect, and /get_labels should be used in a chronological order. First you have to call /load, and then call /detect or /get_labels

Model structure

The folder "models" contains subfolders of all the models to be loaded. Inside each subfolder there should be a:

~/BMW-YOLOv4-Inference-API-GPU/models/<name-of-the-model>/config.json
~/BMW-YOLOv4-Inference-API-GPU/models/<name-of-the-model>/obj.data
~/BMW-YOLOv4-Inference-API-GPU/models/<name-of-the-model>/obj.names
~/BMW-YOLOv4-Inference-API-GPU/models/<name-of-the-model>/yolo-obj.cfg
~/BMW-YOLOv4-Inference-API-GPU/models/<name-of-the-model>/yolo-obj.weights
  • Cfg file (yolo-obj.cfg): contains the configuration of the model

  • data file (obj.data): contains number of classes and names file path

    classes=<number_of_classes>
    names=/models/<model_name>/obj.names
    
  • Weights file (yolo-obj.weights)

  • Names file (obj.names) : contains the names of the classes

  • Config.json (This is a json file containing information about the model)

      {
        "inference_engine_name": "yolov4_darknet_detection",
        "detection_threshold": 0.6,
        "nms_threshold": 0.45,
        "hier_threshold": 0.5,
        "framework": "yolo",
        "type": "detection",
        "network": "network_name"
      }
    

    P.S

    • You can choose "yolov4_darknet_detection" for Yolo v4 model or "yolov3_darknet_detection" for Yolo v3 model
    • You can change detection_threshold, nms_threshold, and hier_threshold values while running the API
    • The API will return bounding boxes with a detection higher than the detection_threshold value. A high detection_threshold can show you only accurate predictions

Benchmarking

Ubuntu
Network\Hardware Intel Xeon CPU 2.3 GHz Intel Core i9-7900 3.3 GHZ Tesla V100
COCO Dataset 0.259 seconds/image 0.281 seconds/image 0.0691 seconds/image

Acknowledgment

inmind.ai

robotron.de

Antoine Charbel, inmind.ai , Beirut, Lebanon

Charbel El Achkar, Beirut, Lebanon

Hadi Koubeissy, Beirut, Lebanon

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].