Skip to main content

A vision pipeline for object and car make classification with CLI

Project description

Pax Case: Object and Car Make Classification

This project provides a vision pipeline for object and car make classification. It includes a command-line interface (CLI) for processing images and a Gradio-based web interface for interactive demonstrations.

Problem Statement

The goal is to build a tool that can:

  1. Object Classification: Identify whether an image contains a car, truck, bicycle, or person.
  2. Car Make Classification: If the image contains a car, identify its make (e.g., Volkswagen, Chevrolet).

The solution must be scalable to handle up to 10 million images daily and be flexible enough to accommodate future classification tasks.

Features

  • Two-Stage Pipeline:
    • Object Detection: Uses a YOLOv8 model to detect objects (person, bicycle, car, truck).
    • Car Make Classification: Uses a Google SigLIP model fine-tuned on the Stanford Cars dataset to classify the make of detected cars.
  • CLI Tool (detector):
    • Process single images or directories of images from the command line.
    • Supports configuration via a YAML file.
    • Adjustable confidence threshold for object detection.
  • Scalability and Extensibility:
    • The architecture is designed to be scalable and extensible. See SCALING_STRATEGY.md for a detailed plan on scaling to 10M images/day and adding new classification types.

Package usage

  1. Install PyPi package
pip install pax-detector

Local Setup and Installation

  1. Clone the repository:

    git clone <repository-url>
    cd pax-case
    
  2. Install dependencies: It is recommended to use a virtual environment. This project uses uv https://docs.astral.sh/uv/getting-started/installation/ for package management.

    uv venv 
    source .venv/bin/activate
    
    uv pip install -e . # To build package locally
    uv sync # If want to install local dependencies 
    

Usage

Command-Line Interface (CLI)

The CLI tool (detector) is used for processing individual images.

Basic Usage:

To process a single image:

detector --image_path /path/to/your/image.jpg

To process all images in a directory:

detector --images_dir /path/to/your/images/

Using a Configuration File:

You can also run the CLI using a config.yml file to specify parameters.

Example config.yml:

image_path: '/path/to/your/image.jpg'
confidence: 0.6

Run with config:

detector --config config.yml

Arguments:

  • --image_path: Path to a single input image.
  • --images_dir: Path to a directory of images.
  • --config: Path to a YAML configuration file.
  • --confidence: Confidence threshold for object detection (default: 0.5).

Example:

detector --image_path datasets/car-camera/images/00001.jpg --confidence 0.4

This will process the image and print the JSON output to the console.

Extensibility

For details on how to add more classification types (e.g., helmet color, t-shirt color), please refer to the SCALING_STRATEGY.md document, which outlines the proposed architecture for extending the pipeline.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pax_detector-0.1.4.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pax_detector-0.1.4-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file pax_detector-0.1.4.tar.gz.

File metadata

  • Download URL: pax_detector-0.1.4.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for pax_detector-0.1.4.tar.gz
Algorithm Hash digest
SHA256 ecce61f9eb1e8edc44131ac6c3648a67734700c45c3eb2286e99cbfad3b0eada
MD5 b5a09d2cfb5211b52fa1a919853207ff
BLAKE2b-256 ab71718b3f80d2c0246e188e950b4f7484141796638fba5cb0f69e3b4450bfee

See more details on using hashes here.

File details

Details for the file pax_detector-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: pax_detector-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for pax_detector-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 88232b28e92b9bd16fc8cf8b4cd0f77c882871701cb7520749532441190e036a
MD5 16497f52456df4e00bfbc5b785e8861c
BLAKE2b-256 6149a96567e7100997146ec150002df6a9e7113d8cd6a3063c9dd45b9c03fdec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page