Various utilities for working with images in Python 3. for the mir project
Project description
navalmartin_mir_vision_utils
Various utilities for working with images in the mir project.
Acknowledgements
The project incorporates the following repositories
image-quality
https://github.com/ocampor/image-quality (for BRISQUE)imutils
: https://github.com/PyImageSearch/imutils (for various utilities with OpenCV)
Dependencies
- torch
- torchvision
- numpy
- dataclasses
- Pillow
- matplotlib
- opencv-python
- scipy
- scikit-image
- libsvm
Installation
Installing the utilities via pip
pip install navalmartin-mir-vision-utils
For a specific version use
pip install navalmartin-mir-vision-utils==x.x.x
You can uninstall the project via
pip3 uninstall navalmartin_mir_vision_utils
How to use
Below are some use-case samples. You can find more in the examples.
Using image_utils
from pathlib import Path
from navalmartin_mir_vision_utils.image_utils import (is_valid_pil_image_file, get_pil_image_size,
get_img_files)
if __name__ == '__main__':
image = is_valid_pil_image_file(image=Path("/home/alex/qi3/mir-engine/datasets/cracks_v_3_id_8/train/cracked/img_9_9.jpg"))
if image is not None:
print("The provided image is OK")
image_size = get_pil_image_size(image=image)
print(f"Image size is {image_size}")
else:
print("The provided image is NOT OK")
base_path = Path("/home/alex/qi3/mir-engine/datasets/cracks_v_3_id_8/train/cracked/")
image_files = get_img_files(base_path=base_path)
print(f"There are {len(image_files)} in {base_path}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for navalmartin_mir_vision_utils-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08ff38c0ad97800d6ef6e7fc47ea92f7400ec05cd584313f93096b0711b69c83 |
|
MD5 | 4c5906095f50fd812dc49d7ab29fb6c5 |
|
BLAKE2b-256 | 95a67cd4ea6170745e80d80396f2ab6f2e1332ab250ae6da181068676d65f873 |
Close
Hashes for navalmartin_mir_vision_utils-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef3aa3a4ed93c12fca96dfea22e2b29cd9cc48c9b4fef5e264931bcf1dafcc16 |
|
MD5 | 076c37e58175cdabb81fe68797267938 |
|
BLAKE2b-256 | 14266f85ecae25a0424e59e1d067fdb71c492cb4e32030800f4f143423d1ac41 |