Git Product home page Git Product logo

yrhacks-car-camera's Introduction

yrhacks-car-camera

Make sure you download and place the yolov4.weights or yolov4-tiny.cfg file into this program's root directory!
Download yolov4.weights here
Download yolov4-tiny.weights here

Quick Explaination

This code is an implementation of a vehicle detection and speed measurement system using computer vision. Here is a brief summary of what the code does:

  • It imports necessary libraries like time, numpy, cv2, pytesseract, and math.
  • It sets up the confidence and NMS thresholds for object detection.
  • It initializes the model and network for object detection using YOLOv4-tiny.
  • It creates a window to display camera footage and resizes the window to fit the screen.
  • It initializes two dictionaries for car tracking and car speeds.
  • It starts an infinite loop that captures video from a specified source (in this case, a video file).
  • Within the loop, it reads each frame from the video, detects objects using the YOLOv4-tiny model, and displays the detected objects along with their class names and confidence scores on the video frame.
  • It also uses the license plate recognition library (licenseocr) to get the license plate number of each detected vehicle and display it along with the vehicle class name and confidence score.
  • It tracks each car by assigning a unique ID to each detected car and updating its position in each frame. It also calculates the speed of each car using its previous and current position and the time between frames.
  • Finally, it displays the speed of each tracked car on the video frame and updates the window with each frame until the user presses 'q' to quit the program.

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.