Skip to main content

Forward-biased frame selection for OMP to reconstruct frame sequences and object trajectories as bases

Project description

mosaic-basis

Python License Code style: black Linting: Ruff

Forward-biased frame selection for OMP to reconstruct frame sequences and object trajectories as bases.

Installation

For Users

pip install mosaic-basis

For Development

# Clone the repository
git clone https://github.com/egoughnour/mosaic-basis.git
cd mosaic-basis

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

Development

Quick Start with Makefile

The project includes a Makefile for common development tasks:

# Show all available commands
make help

# Run all checks (format, lint, test)
make check

# Run tests
make test

# Run tests with coverage
make coverage

# Format code
make format

# Run linter
make lint

# Clean build artifacts
make clean

Running Tests

# Run all tests
pytest

# Run tests with coverage
pytest --cov=mosaic_basis --cov-report=html

# Run specific test file
pytest tests/test_basic.py

The richer test suite downloads a tiny public clip via yt-dlp to validate the timestamp-aware mosaic and preview flows. Make sure you have network access when running pytest; if the download fails (e.g., offline CI), the integration tests will automatically skip.

Downloading Videos via yt-dlp

Install the optional extra to enable the built-in downloader:

pip install -e ".[yt]"

You can then let the pipeline fetch a clip directly:

python src/video_omp_pipeline.py \
  --video ./work/input.mp4 \
  --download-url https://www.youtube.com/watch?v=V3-HL7MgzzA \
  --work ./work \
  --download-max-height 360

Use --download-overwrite to force a re-download if the target file already exists.

Code Quality

# Format code with black
black src tests

# Lint with ruff
ruff check src tests

# Type check with mypy
mypy src

Project Structure

mosaic-basis/
├── src/
│   └── mosaic_basis/      # Main package source code
│       └── __init__.py
├── tests/                  # Unit tests
│   ├── __init__.py
│   └── test_basic.py
├── pyproject.toml         # Project configuration (TOML-style)
├── README.md
└── LICENSE

Publishing to PyPI

Preparation

  1. Update the version in pyproject.toml and src/mosaic_basis/__init__.py
  2. Update the README.md with any new features or changes
  3. Ensure all tests pass: pytest
  4. Build the distribution: python -m build

Publishing

# Install build tools
pip install build twine

# Build the distribution
python -m build

# Upload to TestPyPI (for testing)
twine upload --repository testpypi dist/*

# Upload to PyPI
twine upload dist/*

Renaming the Package

To rename this package for a different project:

  1. Update name in pyproject.toml (line 6)
  2. Rename the directory src/mosaic_basis/ to src/your_new_name/
  3. Update known-first-party in pyproject.toml (line 109)
  4. Update imports in tests/test_basic.py
  5. Update the description and URLs in pyproject.toml
  6. Update this README.md

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

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

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

mosaic_basis-0.1.0.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

mosaic_basis-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file mosaic_basis-0.1.0.tar.gz.

File metadata

  • Download URL: mosaic_basis-0.1.0.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for mosaic_basis-0.1.0.tar.gz
Algorithm Hash digest
SHA256 798c81b983b3e057471dfea93a9ba24400ef7bbb0760afbc5db1d3ac9370974e
MD5 92e88c7baab662148fc4f72b6e1be10e
BLAKE2b-256 a3092988e4da8048f4cb454dc5576fef1a0d06478220ba38d44e484ec6d2edb7

See more details on using hashes here.

File details

Details for the file mosaic_basis-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mosaic_basis-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for mosaic_basis-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 755e2cf1fb6f865dbe9b18a3f8a5e919e621dce5c2d5a8d517ec9d3681fb1494
MD5 596e730d295f34cca72ee59d0cfde75f
BLAKE2b-256 75ba45f63ecceaf8f35a8230bd365a46a48ae7e8240d33cfc62a53fbe01c7398

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