Giter VIP home page Giter VIP logo

ouster-yolov5's Introduction

YOLOv5_Ouster-example

Our goal is to identify persons with an OS0-128 lidar sensor and trigger an alarm when the relative distance between the two people is less than 1.8 meters. Detailed instructions can be found in the blog post Object Detection and Tracking using Deep Learning and Ouster Python SDK

Install

  1. Clone repo and install required packages in a Python>=3.7.0 environment, including PyTorch>=1.7.
git clone https://github.com/fisher-jianyu-shi/yolov5_Ouster-lidar-example 
cd yolov5_Ouster-lidar-example 
pip install -r requirements.txt  
  1. Install the Ouster Python SDK (more details here)
python3 -m pip install --upgrade pip
  1. Download the sample lidar data, and save both the PCAP and JSON files in the source directory

Inference with detect.py

detect.py (from original YOLOv5 repo) runs inference on a variety of sources (images, videos, video streams, webcam, etc.) and saves results to runs/detect
For example, to detect people in an image using the pre-trained YOLOv5s model with a 40% confidence threshold, we simply have to run the following command in a terminal in the source directory:

python detect.py --class 0 --weights Yolov5s.pt --conf-thres=0.4 --source example_pic.jpeg --view-img 

This will automatically save the results in the directory runs/detect/exp as an annotated image with a label and the confidence levels of the prediction.

Inference with detect_pcap.py

To run inference on lidar data (pcap file) using custom-trained weights, simply run:

python detect_pcap.py --class 0 --weights best.pt --conf-thres=0.4 --source Ouster-YOLOv5-sample.pcap --metadata-path Ouster-YOLOv5-sample.json  --view-img

To calculate the relative distance between two people:

python detect_PCAP.py --class 0 --weights best.pt --conf-thres=0.4 --source Ouster-YOLOv5-sample.pcap --metadata-path Ouster-YOLOv5-sample.json  --view-img --social-distance

ouster-yolov5's People

Contributors

teacher-tony12138 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.