Skip to content

Latest commit

 

History

History
33 lines (33 loc) · 1.88 KB

README.md

File metadata and controls

33 lines (33 loc) · 1.88 KB

This code is an implementation of a YOLOv7 detector along with a Realsense D435i camera, which is used for object detection in real-time. The main purpose is to detect objects and obtain data such as position, distance, and orientation.

Requirements

  • Python 3.7 or later
  • Pytorch 1.7.0 or later
  • OpenCV 4.1.2 or later
  • pyrealsense2 2.50.0 or later
  • scipy 1.4.1 or later
  • numpy 1.18.5 or later

Usage

To run the code, execute the detect function from the main.py file. The function has the following input arguments:

  • --weights : str : model.pt path(s)
  • --source : str : source (file/folder, 0 for webcam)
  • --img-size : int : inference size (pixels)
  • --conf-thres : float : object confidence threshold
  • --iou-thres : float : IOU threshold for NMS
  • --device : str : cuda device, i.e. 0 or 0,1,2,3 or cpu

Example usage:

    python main.py --weights yolov7s.pt --source 0 --img-size 640 --conf-thres 0.4 --iou-thres 0.5
  

To stop the detection, press the q key.

Results

The code will output a video stream that will display the detected objects along with the corresponding bounding boxes, labels, and orientation angles. Additionally, the data will be saved in a .mat file, containing the object coordinates, distance, and orientation data at time relative to code initialization.

Acknowledgements

This code was implemented using the YOLOv7 repository by Ultralytics LLC.

License

This project is licensed under the MIT License.