Skip to main content

Computer vision toolbox for road infrastructure analysis

Project description

CV Toolbox

A comprehensive computer vision toolbox for road infrastructure analysis.

Installation

From PyPI (Recommended)

# Install the latest version
pip install ltoolbox

# Install a specific version
pip install ltoolbox==1.0.1

# Install with optional dependencies
pip install ltoolbox[dev]  # Development tools
pip install ltoolbox[docs]  # Documentation tools
pip install ltoolbox[dev,docs]  # All optional dependencies

From Source

# Clone the repository
git clone https://github.com/logiroad/cv-toolbox.git
cd cv-toolbox

# Install in development mode
pip install -e ".[dev]"

System Requirements

  • Python 3.12 or higher
  • pip (Python package installer)

For OpenCV support, you may need system libraries:

# Ubuntu/Debian
sudo apt-get update && sudo apt-get install -y \
    libglib2.0-0 libsm6 libxext6 libxrender-dev libgomp1

# macOS
brew install opencv

# Windows: Should work out of the box

Quick Start

Command Line Interface

# Check installation
cv-toolbox --help
toolbox --help  # Alternative command

# Example usage (when implemented)
cv-toolbox process --input image.jpg --output result.jpg

Python API

import cv_toolbox

# Example usage of spatial primitives
from cv_toolbox.spatial.primitives import Point, Vector

# Create a 3D point
point = Point(x=1.0, y=2.0, z=3.0)

# Create a vector
vector = Vector(x=0.0, y=0.0, z=1.0)

# More examples coming soon...

Development

Setting up Development Environment

# Clone the repository
git clone https://github.com/logiroad/cv-toolbox.git
cd cv-toolbox

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=cv_toolbox

# Run specific test categories
pytest -m "not slow"  # Skip slow tests
pytest -m integration  # Only integration tests
pytest -m unit  # Only unit tests

Code Quality

# Format code
ruff format cv_toolbox/ tests/

# Lint code
ruff check cv_toolbox/ tests/

# Type checking
mypy cv_toolbox/

Building the Package

# Clean previous builds
make clean

# Build the package
make build

# This creates:
# - dist/ltoolbox-X.Y.Z-py3-none-any.whl
# - dist/ltoolbox-X.Y.Z.tar.gz

Docker Support

Using with Docker

FROM python:3.12-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    libglib2.0-0 libsm6 libxext6 libxrender-dev libgomp1 \
    && rm -rf /var/lib/apt/lists/*

# Install ltoolbox from PyPI
RUN pip install ltoolbox

# Copy your application
COPY . .

CMD ["cv-toolbox"]

Build and run:

docker build -t my-cv-app .
docker run -it my-cv-app

Features

Spatial Primitives

  • Points and Vectors: 3D point and vector operations
  • Rotations: Support for multiple rotation representations (quaternion, Euler angles, rotation matrix, axis-angle)
  • Poses: 6DOF pose representations with transformations
  • Coordinate Transformations: Convert between different coordinate systems

Computer Vision Tools

  • Image Processing: Cropping, tiling, and preprocessing utilities
  • CVAT Integration: API client for CVAT annotation platform
  • Hugging Face Integration: Tools for dataset management

CLI Tools

  • Unified command-line interface for all toolbox features
  • Extensible plugin architecture

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please ensure:

  • All tests pass (pytest)
  • Code is formatted (ruff format)
  • Code passes linting (ruff check)
  • Type hints are correct (mypy)

Vocabulaire

Types d'images

  • originals: images d'origine
  • drawn_bbox: images d'origine avec une fissure encadrée en rouge
  • crops: vignettes avec la zone à l'intérieur de l'encadré en rouge extraite
  • tiles: images carrées extraites des vignettes par tiling et padding pour l'entrainement du modèle

Splits

Les "splits" sont les parties de la base de données destinés aux étapes d'entrainement, validation et test du modèle:

  • train: données d'entrainement du modèle
  • validation: données de validation du modèle
  • test: données de test du modèle

Annotations

Les annotations utilisent plusieurs concepts:

  • label: représente la classe de l'annotation
  • tag: type d'annotation de classification pure dans laquelle il n'y a pas de détection d'objet
  • detection: type d'annotation dans laquelle il y a une détection d'objet, avec par exemple un masque, une bounding box
  • mask: masque de segmentation
  • bbox: bounding box
  • attribute: clef/valeur représentant un attribut (ex: Orientation:Transversale)

License

Copyright (c) 2025 Logiroad. All rights reserved.

Support

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

lcvtoolbox-1.0.1.tar.gz (100.3 kB view details)

Uploaded Source

Built Distribution

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

lcvtoolbox-1.0.1-py3-none-any.whl (119.9 kB view details)

Uploaded Python 3

File details

Details for the file lcvtoolbox-1.0.1.tar.gz.

File metadata

  • Download URL: lcvtoolbox-1.0.1.tar.gz
  • Upload date:
  • Size: 100.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for lcvtoolbox-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7595e135942be299e67b7f0f196c0e0dacbefdb706570b93ada94d501479d98d
MD5 866740395e246ff2df94c5c99d6672fe
BLAKE2b-256 491b85a8170f2ee12eb75df70da1b21082a49d842cf268d9d0b5f5a4eb5d9971

See more details on using hashes here.

File details

Details for the file lcvtoolbox-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: lcvtoolbox-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 119.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for lcvtoolbox-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88d9036e0e31bbd30a5380efaffb45b050d148c3103c73b483a613b04b24ac2b
MD5 3136f15a2daa1718ff5ebfa3eb1b1cb6
BLAKE2b-256 758d7d8d9ea21e575b29226b2bf2f4b66e115cdddf079d5b8f04d3214c0f268f

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