GPU data augmentation

Decode one image, record five deterministic GPU augmentation views, and compose the source plus results through OA’s headless Vulkan renderer.

TuPaired source6 semantic viewsVision

Source

SurfaceRepository pathSHA-256
C++sdk/cpp/tutorials/vision/tuVisionDataAugmentation.cpp5da595a9424f3070
Pythonsdk/py/tutorials/vision/tuVisionDataAugmentation.py58f1a67ed1f69fc2
Presentationsdk/asset/docs/vision/oa-vision-data-augmentation.pngea818dd5f205783c

Example

Both programs apply the same flip, crop and resize, brightness and contrast, seeded Gaussian noise, clamp, and solarize operations. The semantic images remain GPU-resident until the composed figure reaches its terminal PNG output boundary.

1oa::Vector<oa::Image> views;
2 views.reserve(6);
3 views.pushBack(oa::move(decoded).getValue());
4 const oa::Matrix& source = views.front().asMatrix();
5
6 views.pushBack(rgbImage(oa::FnImage::flip(source, true, false)));
7 auto crop = oa::FnImage::centerCrop(source, 280, 150);
8 views.pushBack(rgbImage(oa::FnImage::resize(crop, 320, 180)));
9 views.pushBack(rgbImage(
10 oa::FnImage::brightnessContrast(source, 0.08F, 1.15F)));
11 auto noisy = oa::FnImage::gaussianNoise(source, 0.0F, 0.035F, 2026U);
12 views.pushBack(rgbImage(oa::FnImage::clamp(noisy, 0.0F, 1.0F)));
13 views.pushBack(rgbImage(oa::FnImage::solarize(source, 0.55F, 1.0F)));
14

This tutorial proves the transformation and residency contract. It does not claim a speedup over another image stack without matching decode policy, transforms, shapes, synchronization, and output validation.

Present

Six deterministic views. The source image and five GPU augmentation results are composed by the tutorial into this exact checked PNG.

Six deterministic OA GPU image augmentation views

present

Augmentation gallery

Download image

Source, horizontal flip, crop and resize, brightness and contrast, seeded Gaussian noise, and solarization.

1200×760 · image/pngSHA-256 ea818dd5f205783c2526b8cd9b93bb27ff30583108746ee7552db379da04e42esdk/cpp/tutorials/vision/tuVisionDataAugmentation.cpp