Skip to content

juergen874/Cardistance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

AI Car Distance Radar

This project is a result of my current exploration into Artificial Intelligence (AI) and Vibe Coding. It's an experimental web application that demonstrates real-time object detection and distance estimation directly in the browser.

Project Overview

The AI Car Distance Radar uses a webcam feed to detect vehicles (cars, trucks, buses) and estimates their distance from the camera. This is a "vibe coding" experiment—focusing on rapid prototyping and exploring the intersection of modern web technologies and machine learning.

Features

  • Real-time Detection: Identifies vehicles instantly using the webcam.
  • Distance Estimation: Calculates the approximate distance to detected vehicles based on their relative size in the frame.
  • Privacy Focused: All processing happens locally on your device. No video data is sent to a server.
  • Responsive Interface: A clean, dark-themed UI designed for clarity.

Technology Stack

  • HTML5 & CSS3: For the structure and styling.
  • JavaScript (ES6+): For the application logic.
  • TensorFlow.js: The core machine learning framework for the browser.
  • COCO-SSD Model: A pre-trained Object Detection model that can identify 80 different classes of objects (optimized here for vehicles).

How It Works

  1. Model Loading: The application downloads the COCO-SSD model upon startup.
  2. Webcam Access: It requests permission to use your camera (ideally an environment/rear-facing camera if on mobile).
  3. Inference: Every frame from the video feed is passed through the neural network.
  4. Distance Calculation: Using a predefined focal length and the known average height of a car, the app estimates the distance: Distance = (Real Height * Focal Length) / Pixel Height

How to Try It

You can view the live demo here: https://pkwentf.netlify.app/

Local Setup

  1. Clone the repository:
    git clone https://github.com/juergen874/Cardistance.git
  2. Open index.html in any modern web browser.
  3. Allow camera access when prompted.

Note: For the best experience and security, the application requires an HTTPS connection when served over a network.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages