# 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/fa/a3/bd3a8c141352cdce552bd2a3489c48710defbc628e2ee8bfa9930f49a9bf/pax_detector-0.1.7.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.7",
"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": "68d88fe2a76cc463467aa1b9af1f7fcaf6b80185eaef7e019fb470967e9627de",
"md5": "555812b5cd74486f12cdbbff35f094da",
"sha256": "6fd4ea6f075d71e74b009ee1cc33914753fc5445a9f719099c5b77a803c07c55"
},
"downloads": -1,
"filename": "pax_detector-0.1.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "555812b5cd74486f12cdbbff35f094da",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 14667,
"upload_time": "2025-09-02T03:04:55",
"upload_time_iso_8601": "2025-09-02T03:04:55.665471Z",
"url": "https://files.pythonhosted.org/packages/68/d8/8fe2a76cc463467aa1b9af1f7fcaf6b80185eaef7e019fb470967e9627de/pax_detector-0.1.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "faa3bd3a8c141352cdce552bd2a3489c48710defbc628e2ee8bfa9930f49a9bf",
"md5": "d820cd5e02146e895d94e71c47beaa7d",
"sha256": "290d1311b51826f0a15316ae228d78e27583a77a0c7ea6c57238d8ac73eab4d3"
},
"downloads": -1,
"filename": "pax_detector-0.1.7.tar.gz",
"has_sig": false,
"md5_digest": "d820cd5e02146e895d94e71c47beaa7d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 13816,
"upload_time": "2025-09-02T03:04:56",
"upload_time_iso_8601": "2025-09-02T03:04:56.915332Z",
"url": "https://files.pythonhosted.org/packages/fa/a3/bd3a8c141352cdce552bd2a3489c48710defbc628e2ee8bfa9930f49a9bf/pax_detector-0.1.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-02 03:04:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gabrielfnayres",
"github_project": "pax-case",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pax-detector"
}