Hocrox is an image preprocessing and augmentation library. It provides a Keras like simple interface to make preprocessing and augmentation pipelines.
Project description
Hocrox
An image preprocessing and augmentation library with Keras like interface.
Introduction
Hocrox is an image preprocessing and augmentation library. It provides a Keras like simple interface to make preprocessing and augmentation pipelines. Hocrox internally uses OpenCV to perform the operations on images. OpenCV is one of the most popular Computer Vision library.
Here are some of the highlights of Hocrox:
- Provides an easy interface that is suitable for radio pipeline development
- It internally uses OpenCV
- Highly configurable with support for custom layers
The Keas interface
Keras is one of the most popular Deep Learning library. Keras provides a very simple yet powerful interface that can be used to develop start-of-the-art Deep Learning models.
Check the code below. This is a simple Keras code to make a simple neural network.
model = keras.Sequential()
model.add(layers.Dense(2, activation="relu"))
model.add(layers.Dense(3, activation="relu"))
model.add(layers.Dense(4))
In Hocrox, the interface for making pipelines is very much similar. So anyone can make complex pipelines with few lines of code.
Install
To install Hocrox, run the following command.
pip install Hocrox
Dependencies
Hocrox uses OpenCV internally so install it before.
Documentation
Documentation for Hocrox is available here.
Example
Here is one simple pipeline for preprocessing images.
from hocrox.model import Model
from hocrox.layer import Read, Save
from hocrox.layer.preprocessing.transformation import Resize
from hocrox.layer.augmentation.flip import RandomFlip
from hocrox.layer.augmentation.transformation import RandomRotate
# Initalizing the model
model = Model()
# Reading the images
model.add(Read(path="./images", name="Read images"))
# Resizing the images
model.add(Resize((224, 244), interpolation="INTER_LINEAR", name="Resize images"))
# Augmentating the images
model.add(
RandomRotate(
start_angle=-10.0, end_angle=10.0, probability=0.7, number_of_outputs=5, name="Randomly rotates the image"
)
)
model.add(RandomFlip(probability=0.7, name="Randomly flips the image"))
# Saving the images
model.add(Save("./preprocessed_images", format="npy", name="Save the image"))
# Generating the model summary
print(model.summary())
# Transforming the images
model.transform()
Contributors
Check the list of contributors here.
License
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
File details
Details for the file Hocrox-0.3.0.tar.gz
.
File metadata
- Download URL: Hocrox-0.3.0.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21536fb34f8674f95e8c7f63b4ced1db5b5166b51e890221b3db9a2e464b4fed |
|
MD5 | 7a926a8b632ca712ed866aa15eee4933 |
|
BLAKE2b-256 | 5bd6b6e29912bfee1246df2f2279582459993b0deeb7ce923498b73049414902 |
File details
Details for the file Hocrox-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: Hocrox-0.3.0-py3-none-any.whl
- Upload date:
- Size: 47.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0befbe9fce7028b7136d7e2bdb6cbfb767cf4561a7053eab6c3d50c0fc766b48 |
|
MD5 | c92b9c9fd53550dc0d9cac0f6b99e38f |
|
BLAKE2b-256 | 3fdaf36943fe1aa4e05e38b9fd8c2881f7c8881708d16f67013fbb14e6c49fc7 |