Coder Social home page Coder Social logo

yangzilong1986 / real-time-vehicle-dection-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kalebu/real-time-vehicle-dection-python

0.0 0.0 0.0 2.76 MB

A python project that does real-time vehicle detection using a trained car-cascade Model

Home Page: https://kalebujordan.dev/real-time-vehicle-detection-using-python/

Python 100.00%

real-time-vehicle-dection-python's Introduction

Hi guys, This repository consist of a source code of script to detect cars in a video/camera frame and then draw rectangaluar boxes around them.

The ML algorithms used for detecting cars and bounding boxes coordinates is a pretrained cascade model Haarcascade car.

Become a patron

Where is the full article ?

The full article for this project is originally published on my blog with an article with title Real-time vehicle detection in python

Getting started

Firstly we have to clone the project repository or download the zip of project and then extract it.

git clone https://github.com/Kalebu/Real-time-Vehicle-Dection-Python
cd Real-time-Vehicle-Dection-Python
Real-time-Vehicle-Dection-Python ->

Dependencies

Now once we have the project repo in our local directory, now lets install the dependecies required to run our script

pip install opencv-python

Sample video

The sample video we used in this project is cars.mp4 which will come as you download or clone the repository, to load a different video with different filename, you might wanna change the source code a bit.

def Simulator():
    CarVideo = cv2.VideoCapture('cars.mp4') # change cars.mp4 to name of your vidoe
    while CarVideo.isOpened():
        ret, frame = CarVideo.read()
        controlkey = cv2.waitKey(1)
        if ret:        
            cars_frame = detect_cars(frame)
            cv2.imshow('frame', cars_frame)
        else:
            break
        if controlkey == ord('q'):
            break

    CarVideo.release()
    cv2.destroyAllWindows()

running our script

Now you can launch your scripts;

python app.py 

If you use the provided sample video, your script is going to look as shown in the picture below;

drawing

Issues ?

Are you facing any issue while trying to run the script, well then raise an issue and I will do my best fixing it as soon as I can

Credits

All the credits to kalebu

real-time-vehicle-dection-python's People

Contributors

kalebu avatar kalebujordan 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.