Skip to content

Commit

Permalink
Test Suite fix - Update augmentation maps (#439)
Browse files Browse the repository at this point in the history
* Include header for map in test suite and bug fix in the HOST test suite

* update Augmentation map and function grouping map

---------

Co-authored-by: HazarathKumarM <hazarathkumar@multicorewareinc.com>
Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
  • Loading branch information
3 people authored Aug 27, 2024
1 parent b1ac444 commit ee8c667
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
8 changes: 4 additions & 4 deletions utilities/test_suite/HOST/runTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def run_unit_test(srcPath1, srcPath2, dstPathTemp, case, numRuns, testType, layo
if case == "8":
# Run all variants of noise type functions with additional argument of noiseType = gausssianNoise / shotNoise / saltandpepperNoise
for noiseType in range(3):
print("\n./Tensor_host " + srcPath1 + " " + srcPath2 + " " + dstPathTemp + " " + str(bitDepth) + " " + str(outputFormatToggle) + " " + str(case) + " " + str(noiseType) + " 0")
result = subprocess.Popen([buildFolderPath + "/build/Tensor_host", srcPath1, srcPath2, dstPathTemp, str(bitDepth), str(outputFormatToggle), str(case), str(noiseType), str(numRuns), str(testType), str(layout), "0", str(qaMode), str(decoderType), str(batchSize)] + roiList + [scriptPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) # nosec
print("./Tensor_host " + srcPath1 + " " + srcPath2 + " " + dstPathTemp + " " + str(bitDepth) + " " + str(outputFormatToggle) + " " + str(case) + " " + str(noiseType) + " 0")
result = subprocess.Popen([buildFolderPath + "/build/Tensor_host", srcPath1, srcPath2, dstPathTemp, str(bitDepth), str(outputFormatToggle), str(case), str(noiseType), str(numRuns), str(testType), str(layout), "0", str(qaMode), str(decoderType), str(batchSize)] + roiList + [scriptPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # nosec
stdout_data, stderr_data = result.communicate()
print(stdout_data.decode())
elif case == "21" or case == "23" or case == "24" or case == "79":
Expand All @@ -75,8 +75,8 @@ def run_unit_test(srcPath1, srcPath2, dstPathTemp, case, numRuns, testType, layo
if case =='79':
interpolationRange = 2
for interpolationType in range(interpolationRange):
print("\n./Tensor_host " + srcPath1 + " " + srcPath2 + " " + dstPathTemp + " " + str(bitDepth) + " " + str(outputFormatToggle) + " " + str(case) + " " + str(interpolationType) + " 0")
result = subprocess.Popen([buildFolderPath + "/build/Tensor_host", srcPath1, srcPath2, dstPathTemp, str(bitDepth), str(outputFormatToggle), str(case), str(interpolationType), str(numRuns), str(testType), str(layout), "0", str(qaMode), str(decoderType), str(batchSize)] + roiList + [scriptPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) # nosec
print("./Tensor_host " + srcPath1 + " " + srcPath2 + " " + dstPathTemp + " " + str(bitDepth) + " " + str(outputFormatToggle) + " " + str(case) + " " + str(interpolationType) + " 0")
result = subprocess.Popen([buildFolderPath + "/build/Tensor_host", srcPath1, srcPath2, dstPathTemp, str(bitDepth), str(outputFormatToggle), str(case), str(interpolationType), str(numRuns), str(testType), str(layout), "0", str(qaMode), str(decoderType), str(batchSize)] + roiList + [scriptPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # nosec
stdout_data, stderr_data = result.communicate()
print(stdout_data.decode())
else:
Expand Down
23 changes: 15 additions & 8 deletions utilities/test_suite/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,22 @@
1: ["gamma_correction", "HOST", "HIP"],
2: ["blend", "HOST", "HIP"],
4: ["contrast", "HOST", "HIP"],
5: ["pixelate", "HOST", "HIP"],
6: ["jitter", "HOST", "HIP"],
8: ["noise", "HOST", "HIP"],
13: ["exposure", "HOST", "HIP"],
20: ["flip", "HOST", "HIP"],
21: ["resize", "HOST", "HIP"],
23: ["rotate", "HOST", "HIP"],
24: ["warp_affine", "HOST", "HIP"]
26: ["lens_correction", "HOST", "HIP"],
29: ["water", "HOST", "HIP"],
30: ["non_linear_blend", "HOST", "HIP"],
31: ["color_cast", "HOST", "HIP"],
32: ["erase", "HOST", "HIP"],
33: ["crop_and_patch", "HOST", "HIP"],
34: ["lut", "HOST", "HIP"],
35: ["glitch", "HOST", "HIP"],
36: ["color_twist", "HOST", "HIP"],
37: ["crop", "HOST", "HIP"],
38: ["crop_mirror_normalize", "HOST", "HIP"],
Expand Down Expand Up @@ -81,13 +86,13 @@
}

audioAugmentationMap = {
0: ["non_silent_region_detection", "HOST"],
1: ["to_decibels", "HOST"],
2: ["pre_emphasis_filter", "HOST"],
3: ["down_mixing", "HOST"],
0: ["non_silent_region_detection", "HOST", "HIP"],
1: ["to_decibels", "HOST", "HIP"],
2: ["pre_emphasis_filter", "HOST", "HIP"],
3: ["down_mixing", "HOST", "HIP"],
4: ["spectrogram", "HOST"],
5: ["slice", "HOST"],
6: ["resample", "HOST"],
6: ["resample", "HOST", "HIP"],
7: ["mel_filter_bank", "HOST"]
}

Expand All @@ -102,13 +107,15 @@
}

miscAugmentationMap = {
1: ["normalize", "HOST", "HIP"]
0: ["transpose","HOST", "HIP"],
1: ["normalize", "HOST", "HIP"],
2: ["log", "HOST", "HIP"],
}

ImageAugmentationGroupMap = {
"color_augmentations" : [0, 1, 2, 3, 4, 13, 31, 34, 36, 45, 81],
"effects_augmentations" : [8, 29, 30, 32, 35, 46, 82, 83, 84],
"geometric_augmentations" : [20, 21, 23, 33, 37, 38, 39, 63, 79, 80, 92],
"effects_augmentations" : [5, 6, 8, 29, 30, 32, 35, 46, 82, 83, 84],
"geometric_augmentations" : [20, 21, 23, 24, 26, 33, 37, 38, 39, 63, 79, 80, 92],
"filter_augmentations" : [49, 54],
"arithmetic_operations" : [61],
"logical_operations" : [65, 68],
Expand Down
1 change: 1 addition & 0 deletions utilities/test_suite/rpp_test_suite_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ SOFTWARE.
#include <fstream>
#include <turbojpeg.h>
#include <random>
#include <map>

#ifdef GPU_SUPPORT
#include <hip/hip_fp16.h>
Expand Down
1 change: 1 addition & 0 deletions utilities/test_suite/rpp_test_suite_voxel.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ SOFTWARE.
#include <fstream>
#include <unistd.h>
#include <dirent.h>
#include <map>
#include "rpp.h"
#include "nifti1.h"

Expand Down

0 comments on commit ee8c667

Please sign in to comment.