Forward-biased frame selection for OMP to reconstruct frame sequences and object trajectories as bases
Project description
mosaic-basis
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
- Update the version in
pyproject.tomlandsrc/mosaic_basis/__init__.py - Update the
README.mdwith any new features or changes - Ensure all tests pass:
pytest - 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:
- Update
nameinpyproject.toml(line 6) - Rename the directory
src/mosaic_basis/tosrc/your_new_name/ - Update
known-first-partyinpyproject.toml(line 109) - Update imports in
tests/test_basic.py - Update the description and URLs in
pyproject.toml - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
798c81b983b3e057471dfea93a9ba24400ef7bbb0760afbc5db1d3ac9370974e
|
|
| MD5 |
92e88c7baab662148fc4f72b6e1be10e
|
|
| BLAKE2b-256 |
a3092988e4da8048f4cb454dc5576fef1a0d06478220ba38d44e484ec6d2edb7
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
755e2cf1fb6f865dbe9b18a3f8a5e919e621dce5c2d5a8d517ec9d3681fb1494
|
|
| MD5 |
596e730d295f34cca72ee59d0cfde75f
|
|
| BLAKE2b-256 |
75ba45f63ecceaf8f35a8230bd365a46a48ae7e8240d33cfc62a53fbe01c7398
|