pax-detector


Namepax-detector JSON
Version 0.1.6 PyPI version JSON
download
home_pageNone
SummaryA vision pipeline for object and car make classification with CLI
upload_time2025-09-01 22:35:31
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT
keywords computer-vision object-detection cli yolo vit
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.

## 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 Roboflow Car Make Model Recognition 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**
  ```bash
  pip install pax-detector
  ```

## Local Setup and Installation

1.  **Clone the repository**:
    ```bash
    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.
    ```bash
    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**:

**Using a Configuration File**:

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

*Example `config.yml`:*
```yaml
image_path: '/Users/fnayres/Downloads/captura-de-tela-2022-12-08-as-13.36.55.webp'
images_dir: null
confidence: 0.5

pipeline:
  - name: object_detection
    class: classification.objects.object_classifier.ObjectClassfier
    params:
      model_version: yolov8l.pt

  - name: car_make_classification
    class: classification.makes.siglip_classifier.MakeClassifier
    depends_on: object_detection
    condition: "'car' in detection['class_name'] or 'truck' in detection['class_name']" # accept None condition
    
```

*Run with config*:
```bash
detector --config config.yml
# or
uv run detector --config config.yml
```

To process a single image:
```bash
detector --image_path /path/to/your/image.jpg
# or 
uv run detector --image_path /path/to/your/image.jpg
```

To process all images in a directory:
```bash
detector --images_dir /path/to/your/images/
# or
uv run detector --images_dir /path/to/your/images/
```

**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).

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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pax-detector",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "computer-vision, object-detection, cli, yolo, vit",
    "author": null,
    "author_email": "Gabriel Ayres <gabn2012@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/af/35/b99d227a3450f0801fb5cf47145cdd81fc5a1c22fa16a78f8e1c7fbc24ab/pax_detector-0.1.6.tar.gz",
    "platform": null,
    "description": "# Pax Case: Object and Car Make Classification\n\nThis project provides a vision pipeline for object and car make classification. It includes a command-line interface (CLI) for processing images.\n\n## Features\n\n- **Two-Stage Pipeline**:\n    - **Object Detection**: Uses a YOLOv8 model to detect objects (person, bicycle, car, truck).\n    - **Car Make Classification**: Uses a Google SigLIP model fine-tuned on the Roboflow Car Make Model Recognition dataset to classify the make of detected cars.\n- **CLI Tool** (`detector`):\n    - Process single images or directories of images from the command line.\n    - Supports configuration via a YAML file.\n    - Adjustable confidence threshold for object detection.\n- **Scalability and Extensibility**:\n    - 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.\n\n## Package usage\n1. **Install PyPi package**\n  ```bash\n  pip install pax-detector\n  ```\n\n## Local Setup and Installation\n\n1.  **Clone the repository**:\n    ```bash\n    git clone <repository-url>\n    cd pax-case\n    ```\n\n2.  **Install dependencies**:\n    It is recommended to use a virtual environment. This project uses `uv` https://docs.astral.sh/uv/getting-started/installation/ for package management.\n    ```bash\n    uv venv \n    source .venv/bin/activate\n\n    uv pip install -e . # To build package locally\n    uv sync # If want to install local dependencies \n    ```\n\n## Usage\n\n### Command-Line Interface (CLI)\n\nThe CLI tool (`detector`) is used for processing individual images.\n\n**Basic Usage**:\n\n**Using a Configuration File**:\n\nYou can also run the CLI using a `config.yml` file to specify parameters.\n\n*Example `config.yml`:*\n```yaml\nimage_path: '/Users/fnayres/Downloads/captura-de-tela-2022-12-08-as-13.36.55.webp'\nimages_dir: null\nconfidence: 0.5\n\npipeline:\n  - name: object_detection\n    class: classification.objects.object_classifier.ObjectClassfier\n    params:\n      model_version: yolov8l.pt\n\n  - name: car_make_classification\n    class: classification.makes.siglip_classifier.MakeClassifier\n    depends_on: object_detection\n    condition: \"'car' in detection['class_name'] or 'truck' in detection['class_name']\" # accept None condition\n    \n```\n\n*Run with config*:\n```bash\ndetector --config config.yml\n# or\nuv run detector --config config.yml\n```\n\nTo process a single image:\n```bash\ndetector --image_path /path/to/your/image.jpg\n# or \nuv run detector --image_path /path/to/your/image.jpg\n```\n\nTo process all images in a directory:\n```bash\ndetector --images_dir /path/to/your/images/\n# or\nuv run detector --images_dir /path/to/your/images/\n```\n\n**Arguments**:\n- `--image_path`: Path to a single input image.\n- `--images_dir`: Path to a directory of images.\n- `--config`: Path to a YAML configuration file.\n- `--confidence`: Confidence threshold for object detection (default: 0.5).\n\nThis will process the image and print the JSON output to the console.\n\n## Extensibility\n\nFor 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.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A vision pipeline for object and car make classification with CLI",
    "version": "0.1.6",
    "project_urls": {
        "Homepage": "https://github.com/gabrielfnayres/pax-case",
        "Repository": "https://github.com/gabrielfnayres/pax-case"
    },
    "split_keywords": [
        "computer-vision",
        " object-detection",
        " cli",
        " yolo",
        " vit"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "304e66b36c2ef3c9e10b36b1a93be3dec4a6fd2001b60ed5d3ae6d573319564f",
                "md5": "e11b5c94f9351d4094778f5898c93351",
                "sha256": "a47c19479d88043ab0331519c898d4d88b18cfd86bee26481253c04e7454022f"
            },
            "downloads": -1,
            "filename": "pax_detector-0.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e11b5c94f9351d4094778f5898c93351",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 14503,
            "upload_time": "2025-09-01T22:35:30",
            "upload_time_iso_8601": "2025-09-01T22:35:30.530549Z",
            "url": "https://files.pythonhosted.org/packages/30/4e/66b36c2ef3c9e10b36b1a93be3dec4a6fd2001b60ed5d3ae6d573319564f/pax_detector-0.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "af35b99d227a3450f0801fb5cf47145cdd81fc5a1c22fa16a78f8e1c7fbc24ab",
                "md5": "5b6862f8a03d09561ac2b4efe2cafc6a",
                "sha256": "5ec5dcba2ed6c57e0bc20c1254f3e8cdae922af2c67b2cb9ddef8ed1b9b1c8d9"
            },
            "downloads": -1,
            "filename": "pax_detector-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "5b6862f8a03d09561ac2b4efe2cafc6a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 13668,
            "upload_time": "2025-09-01T22:35:31",
            "upload_time_iso_8601": "2025-09-01T22:35:31.771855Z",
            "url": "https://files.pythonhosted.org/packages/af/35/b99d227a3450f0801fb5cf47145cdd81fc5a1c22fa16a78f8e1c7fbc24ab/pax_detector-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-01 22:35:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gabrielfnayres",
    "github_project": "pax-case",
    "github_not_found": true,
    "lcname": "pax-detector"
}
        
Elapsed time: 2.35115s