Giter Club home page Giter Club logo

yolov8-triton's Introduction

Overview

This repository provides an ensemble model to combine a YoloV8 model exported from the Ultralytics repository with NMS post-processing. The NMS post-processing code contained in models/postprocess/1/model.py is adapted from the Ultralytics ONNX Example.

For more information about Triton's Ensemble Models, see their documentation on Architecture.md and some of their preprocessing examples.

Directory Structure

models/
    yolov8_onnx/
        1/
            model.onnx
        config.pbtxt
        
    postprocess/
        1/
            model.py
        config.pbtxt
        
    yolov8_ensemble/
        1/
            <Empty Directory>
        config.pbtxt
README.md
main.py

Quick Start

  1. Install Ultralytics and TritonClient
pip install ultralytics==8.0.51 tritonclient[all]==2.31.0
  1. Export a model to ONNX format:
yolo export model=yolov8n.pt format=onnx dynamic=True opset=16
  1. Rename the model file to model.onnx and place it under the /models/yolov8_onnx/1 directory (see directory structure above).

  2. (Optional): Update the Score and NMS threshold in models/postprocess/1/model.py

  3. (Optional): Update the models/yolov8_ensemble/config.pbtxt file if your input resolution has changed.

  4. Build the Docker Container for Triton Inference:

DOCKER_NAME="yolov8-triton"
docker build -t $DOCKER_NAME .
  1. Run Triton Inference Server:
DOCKER_NAME="yolov8-triton"
docker run --gpus all \
    -it --rm \
    --net=host \
    -v ./models:/models \
    $DOCKER_NAME
  1. Run the script with python main.py. The overlay image will be written to output.jpg.

yolov8-triton's People

Contributors

mattwoods avatar omarabid59 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

yolov8-triton's Issues

when I start the docker ,I get this error?please help me

I0523 10:54:25.345383 1 server.cc:264] Waiting for in-flight requests to complete.
I0523 10:54:25.345392 1 server.cc:280] Timeout 30: Found 0 model versions that have in-flight inferences
I0523 10:54:25.345416 1 server.cc:295] All models are stopped, unloading models
I0523 10:54:25.345419 1 server.cc:302] Timeout 30: Found 1 live models and 0 in-flight non-inference requests
I0523 10:54:25.345488 1 onnxruntime.cc:2640] TRITONBACKEND_ModelInstanceFinalize: delete instance state
I0523 10:54:25.348370 1 onnxruntime.cc:2586] TRITONBACKEND_ModelFinalize: delete model state
I0523 10:54:25.348400 1 model_lifecycle.cc:579] successfully unloaded 'yolov8_onnx' version 1
I0523 10:54:26.345508 1 server.cc:302] Timeout 29: Found 0 live models and 0 in-flight non-inference requests
error: creating server: Internal - failed to load all models

'yolov8_ensemble' is not found

Hi.
Trying to start up you project.
Had to correct Dockerfile by adding

EXPOSE 8000
EXPOSE 8001
EXPOSE 8002

After starting you server by running dockerfile, I'm trying to connect to it via starting main.py.
But I cannot connect to the started server.
Exception is tritonclient.utils.InferenceServerException: [StatusCode.NOT_FOUND] Request for unknown model: 'yolov8_ensemble' is not found.
image

The directory tree is
image
I've tried to create and not to create /1 folder in yolov8_ensemble

Can you, please, explain me how should it be started otherwise or what to correct to start?

@MattWoods
@omarabid59

Driver version of cuda

Hello, i'm new in this field
When i try to run this repo, i get a error like:
ERROR: This container was built for NVIDIA Driver Release 525.85 or later, but
version 470.199.02 was detected and compatibility mode is UNAVAILABLE.
So can i ask how to fix it, will i change version of tritonserver from dockerfile
FROM nvcr.io/nvidia/tritonserver:23.02-py3

Unable to find 'libtriton_tensorrt_plan.so' for model 'object_detection', searched: /models/object_detection/1, /models/object_detection, /opt/tritonserver/backends/tensorrt_plan

image

image
Unable to find 'libtriton_tensorrt_plan.so' for model 'object_detection', searched: /models/object_detection/1, /models/object_detection, /opt/tritonserver/backends/tensorrt_plan
I am getting the above error while running the triton server. I have used yolov8 conversion method to convert the custom trained model into tensorrt engine and I am nvidia triton image to run the server. I have kept the model inside the repository as model.engine.

Where should I keep the .so file. I have the .so file "libyolo_layer.so" in this name, where should I put this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.