/vehicle-ai

Identify any vehicle using AI. Built with Node.js, Express.js, EJS, and the Google Gemini API.

Primary LanguageJavaScriptMIT LicenseMIT

Vehicle AI

Vehicle AI Node.js Express @google/generative-ai License

Table of Contents

Introduction

Vehicle AI is a web app that uses Generative AI to identify any vehicle. Utilizing Google's Gemini model, it can detect a vehicle's make, model, color, and year from an image.

Features

  • Image upload through file selection or drag-and-drop.
  • AI-based identification of vehicle make, model, color, and year.
  • Display of car manufacturer logo (when available).
  • User-friendly interface with animations.
  • Responsive design.

Installation

To get started with Vehicle AI, follow these steps:

  1. Clone the repository:

    git clone https://github.com/detalhe/vehicle-ai.git
    cd vehicle-ai
  2. Install dependencies:

    npm install
  3. Set up environment variables: Create a .env file in the root directory and add your Google Gemini API key:

    GOOGLE_API_KEY=your_google_api_key
    

    To get an API key, visit ai.google.dev and follow the instructions to create a project and generate a key.

  4. Run the application:

    npm start
  5. Deploy on Vercel (Optional): Ensure you have the vercel.json configuration file in place and deploy using Vercel CLI:

    vercel

Usage

  1. Open your browser and navigate to http://localhost:3000.
  2. Upload an image of a vehicle.
  3. Wait for the AI to analyze the image and display the vehicle information.

Project Structure

vehicle-ai/
├── node_modules/
├── public/
│   ├── css/
│   │   └── index.css
│   ├── img/
│   │   ├── favicon.ico
│   │   ├── default.jpg
│   │   └── preview.jpg
│   └── js/
│       └── script.js
├── views/
│   └── index.ejs
├── .env
├── index.js
├── package.json
├── package-lock.json
└── vercel.json
  • public/: Contains static assets such as CSS, images, and JavaScript files.
  • views/: Contains EJS templates for rendering HTML.
  • index.js: Main server file.
  • vercel.json: Configuration for deploying on Vercel.

Dependencies

The project relies on the following npm packages:

  • @google/generative-ai: ^0.12.0
  • axios: ^1.7.2
  • dotenv: ^16.4.5
  • ejs: ^3.1.10
  • express: ^4.19.2
  • multer: ^1.4.5-lts.1
  • uuid: ^9.0.1

Contributing

Contributions are welcome! :)

Acknowledgments

License

This project is licensed under the MIT License. See the LICENSE file for details.