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.png4cefa977dd5c6106

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 one checked image.

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/webpSHA-256 4cefa977dd5c6106a76e45bce506e1f77a9ea55f90839400a042f83b78a7711asdk/cpp/tutorials/vision/tuVisionDataAugmentation.cpp