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.
Example
Here is one simple pipeline for preprocessing images.
from hocrox.model import Model
from hocrox.layer.preprocessing.transformation import Grayscale, Resize, Padding
from hocrox.layer import Read, Save
# Initializing the model
model = Model()
# Adding model layers
model.add(Read(path="./images_to_preprocess"))
model.add(Resize((100, 100), name="Resize Layer"))
model.add(Grayscale(name="Grayscale Layer"))
model.add(Padding(10, 20, 70, 40, [255, 255, 255], name="Padding Layer"))
model.add(Save("preprocessed_images/", format="img", name="Save image"))
# Printing the summary of the model
print(model.summary())
# Apply transform to the images
model.transform()