rocAL#
The AMD ROCm Augmentation Library (rocAL) is designed to efficiently decode and process images and videos from a variety of storage formats and modify them through a processing graph programmable by the user. rocAL currently provides C API. For more details, go to docs page.
Supported Operations#
rocAL can be currently used to perform the following operations either with randomized or fixed parameters:
Blend | Blur (Gaussian 3x3) | Brightness | Color Temperature |
---|---|---|---|
ColorTwist | Contrast | Crop | Crop Mirror Normalization |
CropResize | Exposure Modification | Fisheye Lens | Flip (Horizontal, Vertical and Both) |
Fog | Gamma | Hue | Jitter |
Lens Correction | Pixelization | Raindrops | Random Crop |
Resize | Resize Crop Mirror | Rotation | Salt And Pepper Noise |
Saturation | Snowflakes | Vignette | Warp Affine |
Prerequisites#
Ubuntu
20.04
/22.04
AMD OpenVX™ and AMD OpenVX™ Extensions:
VX_RPP
andAMD Media
Turbo JPEG - Version
2.0
or higherHalf-precision floating-point library - Version
1.12.0
or higherGoogle Protobuf - Version
3.11.1
or higherOpenMP
C++ Version
17
Build instructions#
rocAL
builds and installs as part of the MIVisonX toolkit. The rocAL dependencies are installed with MIVisionX-setup.py. To manually install rocAL dependencies, follow below instructions.
Turbo JPEG installation#
Turbo JPEG library is a SIMD optimized library which currently rocAL uses to decode input JPEG images. It needs to be built from the source and installed in the default path for libraries and include headers. You can follow the instruction below to download the source, build and install it. Note: install nasm package
sudo apt-get install nasm
Note: You need wget package to download the tar file.
sudo apt-get install wget
git clone -b 2.0.6.1 https://github.com/rrawther/libjpeg-turbo.git
cd libjpeg-turbo && mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=RELEASE \
-DENABLE_STATIC=FALSE \
-DCMAKE_INSTALL_DOCDIR=/usr/share/doc/libjpeg-turbo-2.0.3 \
-DCMAKE_INSTALL_DEFAULT_LIBDIR=lib \
..
make -j$nproc && sudo make install
LMDB installation#
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
RapidJSON installation#
git clone https://github.com/Tencent/rapidjson.git
cd rapidjson && mkdir build && cd build
cmake ../ && make -j$nproc && sudo make install
PyBind11 installation#
pip install pytest==3.1
git clone -b https://github.com/pybind/pybind11
cd pybind11 && mkdir build && cd build
cmake -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON ../ && make -j4 && sudo make install
Sample and test applications#
Image augmentation application demonstrates how rocAL’s C API can be used to load jpeg images from the disk, decode them and augment the loaded images with a variety of modifications.
Augmentation unit tests can be used to test rocAL’s API individually.