Skip to content

Jeremy-vdw/Yolov5-tf2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yolov5-tf2

Yolov5 Tensorflow 2 detection implementation (no training). This project uses a Tensorflow saved_model format for Yolov5 object detection. For training and exporting please check the Yolov5 repository.

demo

Features

  • Detecting objects in an image folder, an image, a video or webcam.
  • Able to use custom trained saved_model's (only size 640 models)
  • Drawing bounding boxes in images.
  • Usage of non max suppression.
  • Automatically write images with bounding boxes (no videos yet).

Usage

Clone and install requirements

$ git clone https://github.com/Jeremy-vdw/Yolov5-tf2.git
$ cd Yolov5-tf2
$ pip install -r requirements.txt

Run example

$ python detect.py --source './data/images/' --prob 0.4

Parameters

  • --saved_model path to saved_model.yolov5s as default
  • --labels path to labels (.names) file. data/coco.names as default
  • --source path to input image/video or image_folder. 0 for webcam as default.
  • --prob minimum probability to eliminate weak predictions. 0.7 as default
  • --thres setting threshold for filtering weak bounding boxes with NMS. 0.3 as default
  • --visualize to show bounding boxes. True as default.