MCPcopy Create free account
hub / github.com/AllentDan/LibtorchSegmentation / Resize

Method Resize

src/utils/Augmentations.cpp:54–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53
54Data Augmentations::Resize(Data mData, int width, int height, float probability) {
55 float rand_number = RandomNum<float>(0, 1);
56 if (rand_number <= probability) {
57
58 float h_scale = height * 1.0 / mData.image.rows;
59 float w_scale = width * 1.0 / mData.image.cols;
60
61 cv::resize(mData.image, mData.image, cv::Size(width, height));
62 cv::resize(mData.mask, mData.mask, cv::Size(width, height));
63 }
64 return mData;
65}
66
67Data Augmentations::HorizontalFlip(Data mData, float probability) {
68 float rand_number = RandomNum<float>(0, 1);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected