|
| 1 | +# Project Title |
| 2 | + |
| 3 | +[](https://github.com/alexlib/pyptv/actions/workflows/python-app.yml) |
| 4 | +[](https://zenodo.org/badge/latestdoi/121291437) |
| 5 | +[](https://pypi.org/project/pyptv/) |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +**PyPTV** or otherwise called **OpenPTV-Python** is the Python GUI for [OpenPTV](http://www.openptv.net). It is based on `traits`, `traitsui`, `chaco`, `enable` and `pyface` from Enthought Inc. and provides an UI *interface* the OpenPTV library that includes all the core algorithms (correspondence, tracking, calibration, etc.) written in ANSI C and has Python bindings using Cython. |
| 12 | + |
| 13 | +Both PyPTV and the OpenPTV library are in the development phase and continuously refactored. Please follow the development on the community mailing list: |
| 14 | + |
| 15 | + openptv@googlegroups.com |
| 16 | + |
| 17 | + |
| 18 | +## Documentation: |
| 19 | + |
| 20 | + 👉 **[View PyPTV documentation](https://alexlib.github.io/pyptv)** |
| 21 | + 👉 **[View OpenPTV documentation](https://openptv-python.readthedocs.io/en/latest/))** |
| 22 | + |
| 23 | +## Installation instructions |
| 24 | + |
| 25 | +### Using uv (recommended for development) |
| 26 | + |
| 27 | +This project uses [uv](https://github.com/astral-sh/uv) for fast dependency management. A local wheel of `optv>=0.3.2` is included in the `wheels/` directory until it's available on PyPI. |
| 28 | + |
| 29 | +```bash |
| 30 | +# Install uv if you haven't already |
| 31 | +curl -LsSf https://astral.sh/uv/install.sh | sh |
| 32 | + |
| 33 | +# Create virtual environment and install dependencies |
| 34 | +uv sync |
| 35 | + |
| 36 | +# Or to create environment from scratch |
| 37 | +rm -rf .venv && uv sync |
| 38 | +``` |
| 39 | + |
| 40 | +The `uv.toml` configuration automatically uses the local wheel from `wheels/`. The `uv.lock` file pins all dependencies for reproducible builds. |
| 41 | + |
| 42 | +### Using pip |
| 43 | + |
| 44 | +Short version: |
| 45 | + |
| 46 | + pip install numpy |
| 47 | + python -m pip install pyptv --index-url https://pypi.fury.io/pyptv --extra-index-url https://pypi.org/simple |
| 48 | + |
| 49 | +**Note:** If `optv>=0.3.2` is not yet available on PyPI, install it from the local wheel first: |
| 50 | + |
| 51 | + pip install wheels/optv-0.3.2-*.whl |
| 52 | + python -m pip install pyptv --index-url https://pypi.fury.io/pyptv --extra-index-url https://pypi.org/simple |
| 53 | + |
| 54 | +Detailed instructions for various platforms are in our documentation: |
| 55 | +https://openptv-python.readthedocs.io/en/latest/installation_instruction.html |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +Follow the instructions in our **screencasts and tutorials**: |
| 62 | + |
| 63 | + * Tutorial 1: <http://youtu.be/S2fY5WFsFwo> |
| 64 | + |
| 65 | + * Tutorial 2: <http://www.youtube.com/watch?v=_JxFxwVDSt0> |
| 66 | + |
| 67 | + * Tutorial 3: <http://www.youtube.com/watch?v=z1eqFL5JIJc> |
| 68 | + |
| 69 | + |
| 70 | +Ask for help on our mailing list: |
| 71 | + |
| 72 | + openptv@googlegroups.com |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | +## Working with plugins |
| 77 | + |
| 78 | +Plugins is a system of extensions to PyPTV without the need to change the GUI |
| 79 | + |
| 80 | +1. copy the `sequence_plugins.txt` and `tracking_plugins.txt` to the working folder |
| 81 | +2. copy the `plugins/` directory to the working folder |
| 82 | +3. modify the code so it performs instead of the default sequence or default tracker |
| 83 | +4. Open the GUI and Plugins -> Choose , then run the rest: Init -> Sequence |
| 84 | + |
| 85 | + |
| 86 | +Note, the specific branch `plugin_remback` requires installation of the `pip install rembg[cpu]` or `pip install rembg[gpu]` |
| 87 | + |
| 88 | + |
| 89 | +### Developers: |
| 90 | + |
| 91 | +**Version Management:** |
| 92 | +- Bump version: ```python bump_version.py --patch``` |
| 93 | + |
| 94 | +**Publishing to PyPI:** |
| 95 | +- See [DEPLOYMENT.md](DEPLOYMENT.md) for comprehensive deployment instructions using GitHub Actions and trusted publishing |
| 96 | + |
| 97 | +**Legacy Manual Publishing:** |
| 98 | +```bash |
| 99 | +pip install build |
| 100 | +python -m build |
| 101 | +pip install dist/pyptv-*.whl # Install the built wheel |
| 102 | +pip install twine |
| 103 | +python -m twine upload dist/* |
| 104 | +``` |
| 105 | + |
| 106 | +## Compatibility Notes |
| 107 | + |
| 108 | +### NumPy Compatibility |
| 109 | +- Supported NumPy versions: >=2.0.0,<2.7 |
| 110 | +- NumPy 2.x required for optv 0.3.2+ |
| 111 | +- Tested with NumPy arrays in both float64 and uint8 formats |
| 112 | +- Array operations maintained for image processing and coordinate transformations |
| 113 | +- NumPy 2.x support requires chaco>=6.1.0 and enable>=6.1.0 |
| 114 | + |
| 115 | +### OpenPTV (optv) Compatibility |
| 116 | +- Compatible with optv 0.3.2+ |
| 117 | +- optv 0.3.2+ requires NumPy >=2.0.0 |
| 118 | +- Core functionality tested with latest optv release |
| 119 | +- Calibration and tracking functions verified |
| 120 | + |
| 121 | +## Development Setup |
| 122 | +For development work with latest NumPy: |
| 123 | + |
| 124 | +```bash |
| 125 | +conda create -n pyptv python=3.11 |
| 126 | +conda activate pyptv |
| 127 | +conda install numpy>=1.23.5 optv>=0.3.0 |
| 128 | +pip install -e . |
| 129 | +``` |
| 130 | + |
| 131 | +## Marimo UIs (uv) |
| 132 | + |
| 133 | +This repo includes Marimo-based interactive UIs. |
| 134 | + |
| 135 | +Run the Detection UI: |
| 136 | + |
| 137 | +```bash |
| 138 | +uv pip install marimo |
| 139 | +uv run marimo run pyptv/marimo_ui_detection.py |
| 140 | +``` |
| 141 | + |
| 142 | +Or use the helper script: |
| 143 | + |
| 144 | +```bash |
| 145 | +./run_marimo_detection.sh |
| 146 | +``` |
| 147 | + |
| 148 | +Run the Parameters UI: |
| 149 | + |
| 150 | +```bash |
| 151 | +uv pip install marimo |
| 152 | +uv run marimo run pyptv/marimo_ui_parameters.py |
| 153 | +``` |
| 154 | + |
| 155 | +Or use the helper script: |
| 156 | + |
| 157 | +```bash |
| 158 | +./run_marimo_parameters.sh |
| 159 | +``` |
| 160 | + |
| 161 | + |
| 162 | +This is a detailed description of the project... |
0 commit comments