Thank you for your interest in contributing to SceneFlow! This document provides guidelines and instructions for contributing.
git clone https://github.com/vertexcover-io/sceneflow.git
cd sceneflowWindows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh# Install all dependencies including dev dependencies
uv sync
# Or install in development mode
uv pip install -e ".[dev]"uv add --dev pre-commit
uv run pre-commit installsceneflow/
├── src/sceneflow/ # Main package code
│ ├── __init__.py # Package exports
│ ├── cli.py # CLI implementation
│ ├── speech_detector.py # VAD-based speech detection
│ ├── ranker.py # Main ranking orchestrator
│ ├── extractors.py # Feature extraction
│ ├── scorer.py # Multi-stage scoring
│ ├── config.py # Configuration
│ ├── models.py # Data models
│ ├── normalizer.py # Normalization utilities
│ ├── quality_gating.py # Quality penalties
│ └── stability_analyzer.py # Temporal stability
├── tests/ # Test files
├── README.md # User documentation
├── CONTRIBUTING.md # This file
└── pyproject.toml # Package configuration
git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-description- Write clean, readable code
- Follow existing code style
- Add docstrings to functions and classes
- Update documentation if needed
# Run the CLI locally
uv run sceneflow /path/to/test/video.mp4 --verbose
# Run tests (when available)
uv run pytest tests/
# Test the package can be built
uv run python -m build# Format code with black
uv run black src/sceneflow/
# Lint with ruff
uv run ruff check src/sceneflow/
# Type check with mypy (optional)
uv run mypy src/sceneflow/Use clear, descriptive commit messages:
git add .
git commit -m "feat: add support for custom VAD models"
# or
git commit -m "fix: handle edge case in eye openness calculation"
# or
git commit -m "docs: update README with new examples"Commit message prefixes:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Adding or updating testschore:Maintenance tasks
git push origin feature/your-feature-nameThen create a Pull Request on GitHub with:
- Clear description of changes
- Reference to any related issues
- Screenshots/examples if applicable
- Follow PEP 8
- Use type hints where appropriate
- Line length: 100 characters (configured in pyproject.toml)
- Use
blackfor formatting - Use
rufffor linting
Use Google-style docstrings:
def my_function(param1: str, param2: int) -> bool:
"""
Brief description of function.
Longer description if needed.
Args:
param1: Description of param1
param2: Description of param2
Returns:
Description of return value
Raises:
ValueError: When param2 is negative
"""
pass- Classes:
PascalCase - Functions/methods:
snake_case - Constants:
UPPER_SNAKE_CASE - Private methods:
_leading_underscore
If adding new speech detection methods:
- Add method to
SpeechDetectorclass inspeech_detector.py - Ensure it returns
(timestamp, confidence)tuple - Add documentation and examples
- Update tests
If adding new visual metrics:
- Add extraction logic to
extractors.py - Add scoring logic to
scorer.py - Update
FrameFeaturesandFrameScoremodels inmodels.py - Add weight parameter to
RankingConfiginconfig.py - Update documentation
If adding CLI options:
- Add parameter to
main()function incli.py - Use
cyclopts.Parameter()for help text - Update README.md with new option
- Test with
--helpflag
Create test files in tests/ directory:
# tests/test_speech_detector.py
import pytest
from sceneflow.speech_detector import SpeechDetector
def test_speech_detector_initialization():
detector = SpeechDetector(model_size="tiny")
assert detector.model is not None
assert detector.vad_model is not None# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=sceneflow
# Run specific test file
uv run pytest tests/test_speech_detector.py- Keep examples up to date
- Add new features to feature list
- Update CLI options section if needed
- Ensure all code examples work
- Document internal implementation details
- Update architecture descriptions
- Add notes about design decisions
Include:
- Python version (
python --version) - SceneFlow version (
sceneflow --version) - Operating system
- Minimal code to reproduce the bug
- Error message/traceback
- Expected vs actual behavior
Include:
- Clear description of the feature
- Use case / motivation
- Example of how it would work
- Any relevant research or references
- Check existing issues on GitHub
- Open a discussion on GitHub
By contributing to SceneFlow, you agree that your contributions will be licensed under the MIT License.