Metadata-Version: 2.4
Name: mv
Version: 0.0.9
Summary: Live video ML pipeline toolbox
Project-URL: Homepage, https://github.com/thorwhalen/mv
License: MIT
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: config2py
Requires-Dist: numpy
Requires-Dist: opencv-python
Provides-Extra: dev
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: sphinx-rtd-theme>=1.0; extra == 'docs'
Requires-Dist: sphinx>=6.0; extra == 'docs'
Description-Content-Type: text/markdown

# mv

Live video ML pipeline toolbox.

To install:	```pip install mv```

Make it easy to build components for live video processing, to compute video features, 
run ML models, and display results. 


# Examples

## Record video from camera

```python
from mv.util import record_video_from_camera

# To record and save to a file (auto-named if not given):
record_video_from_camera()  # Press ESC or Ctrl+C to stop

# Or specify a filename:
record_video_from_camera("my_recording.mp4")
```

## Reverse video

```py
import mv.wip.video_transforms as vt 
reversed_video_path = vt.reverse_video_w_moviepy("input.mp4", "output.mp4")
```

or, with only builtins (but you need `ffmpeg` installed on your system)

```py
import mv.wip.video_transforms as vt 
reversed_video_path = vt.reverse_video_w_ffmpeg("input.mp4", "output.mp4")
```

## OverlayManager: Manages persistent overlays on video frames.

To see examples of use, run `mv.wip.live_qr_codes.run_example_with_qr_detector(...)` or 
from terminal, `python ...path_to__live_qr_codes__module`

# More examples (for images)

## Make qr code

```py
>>> qr_img = create_qr_code("https://www.example.com")  # doctest: +SKIP
>>> qr_img.size  # doctest: +SKIP
(410, 410)
```

## grid_image: Create a grid of images from a list of images.

```py
>>> from PIL import Image
>>> img1 = Image.new('RGB', (100, 100), color='red')
>>> img2 = Image.new('RGB', (100, 100), color='blue')
>>> img3 = Image.new('RGB', (100, 100), color='green')
>>> img4 = Image.new('RGB', (100, 100), color='yellow')
>>> imgs = [img1, img2, img3, img4]
>>> grid = grid_image(imgs, n_rows=2, n_cols=2, v_padding=10, h_padding=10)
>>> grid.size  # Check the size of the resulting grid image
(220, 220)
```
