Metadata-Version: 2.4
Name: ivutils
Version: 0.0.5
License: MIT license
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: opencv-python~=4.10.0.84
Requires-Dist: numpy~=2.1.3
Requires-Dist: pillow~=11.0.0
Requires-Dist: PyYAML~=6.0.3
Dynamic: description
Dynamic: description-content-type
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist

# ivutils
A set of functions to automate common image / video processing tasks for Machine learning projects.

This package is a lightweight wrapper over the `opencv` package. You can import the package into your python project to call the functions or call them directly from the `ivutils` CLI tool.

## Modules
- vid - contains a list of video transformation functions
- img - contains a list of image transformation functions

### Command Line Interface (CLI) tool
To use the CLI tool supports following syntax
```
ivutils {module} {command} {...args}
```
To see all available options, run the following command:
```output
>ivutils vid transform -h
usage: ivutils vid transform [-h] -s SOURCE -t TARGET [-sf START_FRAME] [-ef END_FRAME] [-st START_TIME] [-et END_TIME]
                             [-fi FRAME_INTERVAL] [--resize_step RESIZE_STEP] [--crop_step CROP_STEP]

options:
  -h, --help            show this help message and exit
  -s, --source SOURCE   Path to the source image file
  -t, --target TARGET   Path to save the resized image
  -sf, --start_frame START_FRAME
  -ef, --end_frame END_FRAME
  -st, --start_time START_TIME
  -et, --end_time END_TIME
  -fi, --frame_interval FRAME_INTERVAL
  --resize_step RESIZE_STEP
                        Optional: format [width]x[height]
  --crop_step CROP_STEP
                        Optional: format [top]x[bottom]x[left]x[right]

```


The following command with open the source video, starting from `00:25` to `01:50` timeframe, crop the bounding box then resize it to 640x480 and create a new video file called `target.mp4`
```
ivutils vid transform -s "source.mp4" -t "target.mp4" -st "0:25" -et "1:50" --resize_step 640x480 --crop_step 100x200x100x200
```
