Giter Site home page Giter Site logo

nuts-bolts's Introduction

1. Training

Follow the link below to see how the model was trained using Colab.

Open In Colab

2. Detection

How to use in Colab:

1. Clone the required repositories, install required packages and download pretrained weights:

!git clone https://github.com/ultralytics/yolov5
!wget https://github.com/Stroma-Vision/machine-learning-challenge/releases/download/v0.1/challenge.zip
!unzip challenge.zip
!rm challenge.zip

%cd yolov5
!pip install -r requirements.txt
!pip install -r requirements.txt coremltools onnx onnx-simplifier onnxruntime openvino-dev tensorflow-cpu nvidia-tensorrt
!pip install onnxruntime-gpu
!wget https://github.com/sarpalgan/nuts-bolts/releases/download/v1.0.0/best.pt

%cd data
!wget https://github.com/sarpalgan/nuts-bolts/releases/download/v1.0.0/custom.yaml

%cd ..

2. Run the following code to export best.py PyTorch model to ONNX and TensorRT formats:

!python export.py --device 0 --weights best.pt --include engine --data data/data.yaml

3. Make detection with one of the following code:

# Detect with PyTorch
!python detect.py --name pt --weights best.pt \
                  --source /content/challenge/images/test/test.mp4 \
                  --data data/custom.yaml --conf-thres 0.85

# Detect with ONNX
!python detect.py --name onnx --weights best.onnx \
                  --source /content/challenge/images/test/test.mp4 \
                  --data data/custom.yaml --conf-thres 0.85      

#Detect with TensorRT
!python detect.py --name engine --weights best.engine \
                  --source /content/challenge/images/test/test.mp4 \
                  --data data/custom.yaml --conf-thres 0.85 --device 0   

4. Results will be saved into ./yolov5/runs/detect/model.extension

model.extension

  • pt (PyTorch)
  • onnx (ONNX)
  • engine (TensorRT)

nuts-bolts's People

Contributors

sarpalgan avatar

Watchers

 avatar

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.