https://github.com/trflorian/image-processing
Explore multiprocessing for an image processing task
https://github.com/trflorian/image-processing
data-science opencv-python python
Last synced: about 1 year ago
JSON representation
Explore multiprocessing for an image processing task
- Host: GitHub
- URL: https://github.com/trflorian/image-processing
- Owner: trflorian
- Created: 2024-12-08T13:40:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-19T09:53:38.000Z (over 1 year ago)
- Last Synced: 2025-04-15T05:17:43.398Z (about 1 year ago)
- Topics: data-science, opencv-python, python
- Language: Python
- Homepage: https://medium.com/towards-data-science/how-to-process-10k-images-in-seconds-e99661f5c2b5
- Size: 55.7 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Image Proceesing
A small image processing project exploring how to use multiprocessing to optimize a data procesisng pipeline by parallelizing a CPU bound task on multiple cores.

## Quickstart
To get started, simply clone the repo, make sure that you have uv installed and then snyc the project dependencies.
```
uv sync
```
Place some images in `./images/` folder or specify a custom input image directory with the `--input_path` argument. Then run the program, it will show a progress bar in the terminal indicating the progress and the iteration speed.
```
uv run main.py
```
By default the program will run on a single core. If you specify e.g. `--num_workers 10` it will use a pool of 10 processes and parallelize the task across them.
## Usage
```
usage: main.py [-h] [--input_path INPUT_PATH] [--output_path OUTPUT_PATH] [--image_extensions IMAGE_EXTENSIONS [IMAGE_EXTENSIONS ...]]
[--num_workers NUM_WORKERS] [--timing] [--subset SUBSET]
options:
-h, --help show this help message and exit
--input_path INPUT_PATH
Path to a folder with images
--output_path OUTPUT_PATH
Path where the processed images will be stored
--image_extensions IMAGE_EXTENSIONS [IMAGE_EXTENSIONS ...]
Extensions of image files to look for
--num_workers NUM_WORKERS
Specify number of workers to use. If not specified, will use a single process for loop.
--timing Enable timing of the process and save results to a `timing.txt` file
--subset SUBSET Specify a subset of the images to process
```