项目作者: ABX9801

项目描述 :
Object detection using YOLO model.
高级语言: Python
项目地址: git://github.com/ABX9801/Object-Detection.git
创建时间: 2020-07-11T08:32:48Z
项目社区:https://github.com/ABX9801/Object-Detection

开源协议:

下载


Object Detection

  • I recorded a video while playing GTA5 and tried to implement object detection on the video using YOLO-V2.

The raw video file recorded from gta5

Object Detection Demo

Requirements :

  • python 3.7
  • tensorflow
  • opencv
  • numpy

Download the darkflow Repo from here

  • the code written in the darkflow repo is in tensorflow version1.
  • we can also migrate our tensorflow1 code to tensorflow2 using:
    1. import tensorflow.compat.v1 as tf
    2. tf.disable_v2_behavior()

Build the Library

  • open an cmd window and type:
    1. - python setup.py build_ext --inplace
    or
    1. - pip install -e

Download weights file from here

Demo conversion

  • move the video file into the darkflow-master
  • from there, open a cmd window
  • use the command:
    1. python flow --model cfg/yolo.cfg --load bin/yolov2.weights --demo videofile.mp4 --gpu 1.0 --saveVideo
  • videofile.mp4 is the name of your video.
  • NOTE: if you do not have the GPU version of tensorflow, leave off the —gpu 1.0
  • —saveVideo indicates to save a name video file, which has the boxes around objects

I suggest the conversion via python using opencv

  • the code is written in main.py.
  • if using cpu version we can remove ‘gpu’: 1.0 from options

The processed video file

Object Detection Demo