Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
755eb52
tensor changes
LakshmiKumar23 Sep 26, 2023
9caa64c
Update Doxyfile
LakshmiKumar23 Sep 26, 2023
6fa17b3
test updates
LakshmiKumar23 Sep 26, 2023
f128ab9
bug fixes
LakshmiKumar23 Sep 27, 2023
215fb90
bug fix
LakshmiKumar23 Sep 27, 2023
d65b188
adding image augemntation app changes
LakshmiKumar23 Sep 28, 2023
40a6ae2
Minor changes
fgladwin Oct 6, 2023
660ccd9
Add ROI structure
fgladwin Oct 6, 2023
11d2cd6
Add support to update multi dimension ROI
fgladwin Oct 6, 2023
95338bc
Merge branch 'PR67' into develop-tensor
SundarRajan28 Oct 6, 2023
d444fb9
Adding mask pipeline support for rocAL
SundarRajan28 Oct 6, 2023
d5a74be
Fix build issues wrt ROI struct
fgladwin Oct 9, 2023
93271f4
Merge branch 'develop' into lk/tensor
LakshmiKumar23 Oct 12, 2023
82d2e93
Merge branch 'fg/tensor_generic_roi' into fg/retinanet
fgladwin Oct 15, 2023
aaa349e
Merge branch 'PR_tensor_mask' of https://github.com/SundarRajan98/roc…
fgladwin Oct 15, 2023
416b6f5
Fix build issue
fgladwin Oct 15, 2023
d2f8fab
Add box IOU matcher changes
fgladwin Oct 15, 2023
0b6fc58
Merge branch 'develop-tensor' into fg/tensor_generic_roi
SundarRajan98 Oct 16, 2023
4671d78
Merge branch 'fg/tensor generic roi' into PR_tensor_mask
SundarRajan28 Oct 16, 2023
36f852c
Fixing build issues
SundarRajan28 Oct 16, 2023
8475948
Merge branch 'lk/tensor' of https://github.com/LakshmiKumar23/rocAL i…
fgladwin Oct 17, 2023
efb3f45
Merge branch 'fg/tensor_generic_roi' of https://github.com/fgladwin/r…
fgladwin Oct 17, 2023
223cdec
Merge branch 'fg/tensor_generic_roi' of https://github.com/fgladwin/r…
fgladwin Oct 18, 2023
0a2b646
Merge branch 'develop' of https://github.com/ROCmSoftwarePlatform/roc…
fgladwin Oct 18, 2023
1ac0258
Merge branch 'fg/tensor_roi' into fg/tensor_generic_roi
fgladwin Oct 18, 2023
f9d5fa6
Minor change
fgladwin Oct 18, 2023
b47cadb
Merge remote-tracking branch 'fg/tensor_roi' into PR_tensor_mask
SundarRajan28 Oct 18, 2023
987ddbc
Merge branch 'fg/tensor' into fg/tensor_generic_roi
fgladwin Oct 18, 2023
971f614
Remove redundant code
fgladwin Oct 18, 2023
0985898
Minor change
fgladwin Oct 18, 2023
3a04a02
Minor changes
fgladwin Oct 18, 2023
bdb0443
Modify struct names
fgladwin Oct 19, 2023
52de343
Adding external source reader support to rocAL
SundarRajan98 Oct 20, 2023
b290600
ROCm Path - Options added (#73)
kiritigowda Oct 23, 2023
75af629
Remove strides in ROI
fgladwin Oct 24, 2023
daf4913
Change shape to end for ROICords
fgladwin Oct 24, 2023
30390bc
Fix crop dims in ssd random crop
fgladwin Oct 24, 2023
8a825bc
Change ROI type to const in node.h
fgladwin Oct 24, 2023
c87cd20
Resolving review comments
SundarRajan98 Oct 25, 2023
a771f65
set mem handle with label buffer
SundarRajan28 Oct 25, 2023
8071dfb
Resolving review comments
SundarRajan98 Oct 25, 2023
d4e939f
Merge remote-tracking branch 'fg_dev/fg/tensor_generic_roi' into PR_t…
SundarRajan98 Oct 26, 2023
58c9e3b
Merge branch 'PR_tensor_mask' of https://github.com/SundarRajan98/roc…
fgladwin Oct 26, 2023
5fc4b2d
change casting to c++ style
SundarRajan28 Oct 26, 2023
12609ea
Merge Roi tensor branch
SundarRajan28 Oct 26, 2023
5c5a440
Resolving review comments
SundarRajan98 Oct 26, 2023
5c4a23d
Formatting changes
SundarRajan98 Oct 26, 2023
3776f92
Address review comments
SundarRajan28 Oct 27, 2023
d5d8131
Remove external source label reader
fgladwin Oct 27, 2023
0152f62
Minor changes
fgladwin Oct 27, 2023
e29d021
Remove labels bool in loaders
fgladwin Oct 27, 2023
14e6ba3
Minor changes
fgladwin Oct 27, 2023
5ffeec8
Revert storage_type to type
fgladwin Oct 27, 2023
de54706
Minor changes
fgladwin Oct 27, 2023
0fe4b97
Minor changes
fgladwin Oct 27, 2023
43a3c74
Adding numpy reader support to rocAL
SundarRajan98 Oct 29, 2023
913a2fb
Adding fmadd kernel integration in rocAL
SundarRajan98 Oct 29, 2023
eedad89
Adding flip and gaussian noise 3D kernel support in rocAL
SundarRajan98 Oct 29, 2023
2fb286e
Combine all the test modes in pytorch.py
fgladwin Oct 30, 2023
4ef9010
Adding external source support to generic iterator
SundarRajan98 Oct 30, 2023
3828a5a
Adding readme for external source python examples
SundarRajan98 Oct 31, 2023
a42e3a9
Merge remote-tracking branch 'origin/develop' into PR_tensor_mask
SundarRajan98 Oct 31, 2023
bffff3f
Resolving review comments
SundarRajan98 Oct 31, 2023
a8f5d7b
Merge remote-tracking branch 'origin/develop' into external_source_re…
SundarRajan98 Oct 31, 2023
166d9ab
Adding min_max scaling mode comment
SundarRajan98 Oct 31, 2023
4ac0429
Merge branch 'PR_tensor_mask' of https://github.com/SundarRajan98/roc…
fgladwin Nov 1, 2023
e49fece
Removing unused vector in coco reader
SundarRajan98 Nov 1, 2023
ac66905
CMake Find - Half (#76)
kiritigowda Nov 1, 2023
8320904
Change copyright year
SundarRajan98 Nov 2, 2023
e6e24bd
Improve code readability
fgladwin Nov 2, 2023
85097bb
Merge remote-tracking branch 'ToT/develop' into numpy_reader
SundarRajan98 Nov 3, 2023
26f92ae
Merge branch 'numpy_reader' into voxel_kernel_integration
SundarRajan98 Nov 3, 2023
d1fc5fc
Resolving review comments
SundarRajan98 Nov 3, 2023
f89c58d
Merge remote-tracking branch 'origin/PR_tensor_mask' into numpy_reader
Nov 8, 2023
f1a1190
Merge remote-tracking branch 'fg/fg/retinanet' into numpy_reader
swetha097 Nov 8, 2023
e7e719d
Add the test cases for numpy reader
swetha097 Nov 9, 2023
e586baf
Prerequisites - Boost Removal (#71)
hansely Nov 9, 2023
f1cb0d5
Merge remote-tracking branch 'ToT/develop' into external_source_reader
SundarRajan98 Nov 9, 2023
ad11859
Multiple Inheritance in External Source Reader
swetha097 Nov 15, 2023
ce02683
Add the commit the pass the ROI as xywh structure
swetha097 Nov 15, 2023
f45b74e
Increase the pqd
swetha097 Nov 15, 2023
2c4469a
Put all the examples in a single file
swetha097 Nov 15, 2023
99aa77f
Make minor changes from commit
SundarRajan28 Nov 15, 2023
eaf1052
Merge branch 'external_source_reader' of https://github.com/SundarRaj…
swetha097 Nov 15, 2023
0fc09f6
Del remaining examples
swetha097 Nov 15, 2023
5f095fb
Adding roi_random_crop and slice kernel integration
SundarRajan98 Nov 17, 2023
56e3a30
Add changes for ROI
swetha097 Nov 21, 2023
935c769
Fixing bug with numpy reader shuffle
SundarRajan98 Nov 27, 2023
bcb050f
Resizing file headers after last batch padding
SundarRajan98 Nov 27, 2023
5bfe974
Remove the rocAL external source folder
SundarRajan28 Nov 29, 2023
0c89a7b
Change the ROI struct of vectors to a vector of ROI structs and chang…
swetha097 Dec 7, 2023
04b4bdb
Add NONE to Mode and Resize the size of the ROIxywh vector in cpp uni…
swetha097 Dec 8, 2023
b04dce9
Merge branch 'external_source_reader_check' into external_source_reader
Dec 8, 2023
a986ccb
Remove the print statment
Dec 8, 2023
2198636
Merge remote-tracking branch 'ToT/develop' into unet_integration
SundarRajan98 Dec 8, 2023
e82f634
Adding changes for
SundarRajan98 Dec 8, 2023
e2838a5
Pass the vectors as reference
swetha097 Dec 12, 2023
ea1f247
Move the ExternalSourceMode to the right
swetha097 Dec 12, 2023
c30e56e
Add const to pass vectors by reference and add one to one mapping in …
swetha097 Dec 12, 2023
61890cd
Some changes in the example file
swetha097 Dec 12, 2023
e75c44c
Changes in example file
swetha097 Dec 12, 2023
fda81a2
Minor changes in the test suite
swetha097 Dec 12, 2023
9cf3bb1
Remove nchw_to_nhwc conversions
swetha097 Dec 12, 2023
2d74fdc
Merge branch 'master' into external_source_reader
swetha097 Dec 13, 2023
80cace6
Merge branch 'develop' into external_source_reader
swetha097 Dec 13, 2023
510a83d
Resolve PR comments - 1
swetha097 Dec 14, 2023
e803b54
Merge branch 'numpy_reader' of https://github.com/SundarRajan98/rocAL…
swetha097 Dec 14, 2023
b28e61c
Adding header caching, files and seed options to numpy reader
SundarRajan98 Dec 15, 2023
aece203
Fix warnings
SundarRajan28 Dec 15, 2023
5087e33
Merge branch 'external_source_reader' of https://github.com/SundarRaj…
Dec 15, 2023
2d377ce
Bracket Spacing
SundarRajan28 Dec 19, 2023
7320123
Merge remote-tracking branch 'ToT/develop' into external_source_reader
SundarRajan98 Jan 3, 2024
4ce813d
Removing boost includes and updating python example
SundarRajan98 Jan 4, 2024
3c1084e
Merge branch 'external_source_reader' into unet_integration
SundarRajan98 Jan 4, 2024
c618bcf
Merge branch 'develop' into unet_integration
SundarRajan98 Jan 19, 2024
b1dda8f
Changes to ROI random crop and fix for output routine bug
SundarRajan98 Jan 19, 2024
55d13ca
Adding back missed formatting for crop node
SundarRajan98 Jan 19, 2024
0c0e89c
Fixing build issues
SundarRajan98 Jan 24, 2024
33aaf83
Merge branch 'develop' into numpy_reader
SundarRajan98 Jan 25, 2024
2497047
Adding parameterVX changes
SundarRajan98 Jan 25, 2024
d0f9a87
Adding ROI changes for numpy reader
SundarRajan98 Jan 25, 2024
338fe5e
Adding setLayout function for numpy reader
SundarRajan98 Jan 25, 2024
dd6c616
Fixing numpy header order issue in numpy reader
SundarRajan98 Jan 25, 2024
23b193b
Formatting changes for numpy data reader
SundarRajan98 Jan 25, 2024
3fc350b
Merge branch 'numpy_reader' into unet_integration
SundarRajan98 Jan 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 70 additions & 4 deletions rocAL/include/api/rocal_api_augmentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,13 @@ extern "C" RocalTensor ROCAL_API_CALL rocalRotateFixed(RocalContext context, Roc
* \param [in] is_output is the output tensor part of the graph output
* \param [in] alpha controls contrast of the image
* \param [in] beta controls brightness of the image
* \param [in] conditional_execution controls the execution of the augmentation
* \param [in] output_layout the layout of the output tensor
* \param [in] output_datatype the data type of the output tensor
* \return RocalTensor
*/
extern "C" RocalTensor ROCAL_API_CALL rocalBrightness(RocalContext context, RocalTensor input, bool is_output,
RocalFloatParam alpha = NULL, RocalFloatParam beta = NULL,
RocalFloatParam alpha = NULL, RocalFloatParam beta = NULL, RocalIntParam conditional_execution = NULL,
RocalTensorLayout output_layout = ROCAL_NONE,
RocalTensorOutputType output_datatype = ROCAL_UINT8);

Expand All @@ -219,13 +220,14 @@ extern "C" RocalTensor ROCAL_API_CALL rocalBrightness(RocalContext context, Roca
* \param [in] is_output is the output tensor part of the graph output
* \param [in] alpha controls contrast of the image
* \param [in] beta controls brightness of the image
* \param [in] conditional_execution controls the execution of the augmentation
* \param [in] output_layout the layout of the output tensor
* \param [in] output_datatype the data type of the output tensor
* \return RocalTensor
*/
extern "C" RocalTensor ROCAL_API_CALL rocalBrightnessFixed(RocalContext context, RocalTensor input,
float alpha, float beta,
bool is_output,
bool is_output, int conditional_execution = 1,
RocalTensorLayout output_layout = ROCAL_NONE,
RocalTensorOutputType output_datatype = ROCAL_UINT8);

Expand Down Expand Up @@ -307,7 +309,7 @@ extern "C" RocalTensor ROCAL_API_CALL rocalContrastFixed(RocalContext context, R
* \return RocalTensor
*/
extern "C" RocalTensor ROCAL_API_CALL rocalFlip(RocalContext context, RocalTensor input, bool is_output,
RocalIntParam horizonal_flag = NULL, RocalIntParam vertical_flag = NULL,
RocalIntParam horizonal_flag = NULL, RocalIntParam vertical_flag = NULL, RocalIntParam depth_flag = NULL,
RocalTensorLayout output_layout = ROCAL_NONE,
RocalTensorOutputType output_datatype = ROCAL_UINT8);

Expand All @@ -323,7 +325,7 @@ extern "C" RocalTensor ROCAL_API_CALL rocalFlip(RocalContext context, RocalTenso
* \return RocalTensor
*/
extern "C" RocalTensor ROCAL_API_CALL rocalFlipFixed(RocalContext context, RocalTensor input,
int horizonal_flag, int vertical_flag, bool is_output,
int horizonal_flag, int vertical_flag, int depth_flag, bool is_output,
RocalTensorLayout output_layout = ROCAL_NONE,
RocalTensorOutputType output_datatype = ROCAL_UINT8);

Expand Down Expand Up @@ -565,6 +567,68 @@ extern "C" RocalTensor ROCAL_API_CALL rocalSnPNoiseFixed(RocalContext context, R
RocalTensorLayout output_layout = ROCAL_NONE,
RocalTensorOutputType output_datatype = ROCAL_UINT8);

/*! \brief Applies gaussian noise effect on images.
* \ingroup group_rocal_augmentations
* \param [in] context Rocal context
* \param [in] input Input Rocal tensor
* \param [in] is_output is the output tensor part of the graph output
* \param [in] mean Mean of the distribution
* \param [in] std_dev Standard deviation of the distribution
* \param [in] seed seed value for the random number generator
* \param [in] conditional_execution controls the execution of the augmentation
* \param [in] output_layout the layout of the output tensor
* \param [in] output_datatype the data type of the output tensor
* \return RocalTensor
*/
extern "C" RocalTensor ROCAL_API_CALL rocalGaussianNoise(RocalContext context, RocalTensor input,
bool is_output,
RocalFloatParam mean = NULL, RocalFloatParam std_dev = NULL,
int seed = 0, RocalIntParam conditional_execution = NULL,
RocalTensorLayout output_layout = ROCAL_NONE,
RocalTensorOutputType output_datatype = ROCAL_UINT8);

/*! \brief Applies gaussian noise effect on images with fixed parameters.
* \ingroup group_rocal_augmentations
* \param [in] context Rocal context
* \param [in] input Input Rocal tensor
* \param [in] is_output is the output tensor part of the graph output
* \param [in] mean Mean of the distribution
* \param [in] std_dev Standard deviation of the distribution
* \param [in] seed seed value for the random number generator
* \param [in] conditional_execution controls the execution of the augmentation
* \param [in] output_layout the layout of the output tensor
* \param [in] output_datatype the data type of the output tensor
* \return RocalTensor
*/
extern "C" RocalTensor ROCAL_API_CALL rocalGaussianNoiseFixed(RocalContext context, RocalTensor input,
float mean, float std_dev,
bool is_output, int seed = 0, int conditional_execution = 1,
RocalTensorLayout output_layout = ROCAL_NONE,
RocalTensorOutputType output_datatype = ROCAL_UINT8);

/*! \brief Applies slice augmentation on images.
* \ingroup group_rocal_augmentations
* \param [in] context Rocal context
* \param [in] input Input Rocal tensor
* \param [in] is_output is the output tensor part of the graph output
* \param [in] anchor_tensor Anchor used for slice
* \param [in] shape_tensor Shape of the output slice
* \param [in] fill_values Fill value for the slice padding
* \param [in] policy Padding policy used for slice augmentation
* \param [in] output_layout the layout of the output tensor
* \param [in] output_datatype the data type of the output tensor
* \return RocalTensor
*/
extern "C" RocalTensor ROCAL_API_CALL rocalSlice(RocalContext context,
RocalTensor input,
bool is_output,
RocalTensor anchor_tensor,
std::vector<int> shape_tensor,
std::vector<float> fill_values,
RocalOutOfBoundsPolicy policy,
RocalTensorLayout output_layout = ROCAL_NONE,
RocalTensorOutputType output_datatype = ROCAL_UINT8);

/*! \brief Applies snow effect on images.
* \ingroup group_rocal_augmentations
* \param [in] context Rocal context
Expand Down Expand Up @@ -1098,4 +1162,6 @@ extern "C" RocalTensor ROCAL_API_CALL rocalSSDRandomCrop(RocalContext context, R
RocalTensorLayout output_layout = ROCAL_NONE,
RocalTensorOutputType output_datatype = ROCAL_UINT8);

extern "C" RocalTensor ROCAL_API_CALL rocalSetLayout(RocalContext context, RocalTensor input,
RocalTensorLayout output_layout = ROCAL_NONE);
#endif // MIVISIONX_ROCAL_API_AUGMENTATION_H
46 changes: 46 additions & 0 deletions rocAL/include/api/rocal_api_data_loaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,52 @@ extern "C" RocalTensor ROCAL_API_CALL rocalRawTFRecordSourceSingleShard(RocalCon
unsigned out_width = 0, unsigned out_height = 0,
const char* record_name_prefix = "");

/*! \brief Creates Numpy raw data reader and loader. It allocates the resources and objects required to read raw data stored on the numpy arrays.
* \ingroup group_rocal_data_loaders
* \param [in] context Rocal context
* \param [in] source_path A NULL terminated char string pointing to the location on the disk
* \param [in] internal_shard_count Defines the parallelism level by internally sharding the input dataset and load/decode using multiple decoder/loader instances. Using shard counts bigger than 1 improves the load/decode performance if compute resources (CPU cores) are available.
* \param [in] is_output Determines if the user wants the loaded images to be part of the output or not.
* \param [in] shuffle Determines if the user wants to shuffle the dataset or not.
* \param [in] loop Determines if the user wants to indefinitely loops through images or not.
* \param [in] decode_size_policy Decode size policy used for the loader
* \return Reference to the output tensor
*/
extern "C" RocalTensor ROCAL_API_CALL rocalNumpyFileSource(
RocalContext p_context,
const char* source_path,
unsigned internal_shard_count,
std::vector<std::string> files = {},
bool is_output = false,
bool shuffle = false,
bool loop = false,
RocalImageSizeEvaluationPolicy decode_size_policy = ROCAL_USE_MAX_SIZE,
unsigned seed = 0);

/*! \brief Creates Numpy raw data reader and loader. It allocates the resources and objects required to read raw data stored on the numpy arrays.
* \ingroup group_rocal_data_loaders
* \param [in] context Rocal context
* \param [in] source_path A NULL terminated char string pointing to the location on the disk
* \param [in] is_output Determines if the user wants the loaded images to be part of the output or not.
* \param [in] shuffle Determines if the user wants to shuffle the dataset or not.
* \param [in] loop Determines if the user wants to indefinitely loops through images or not.
* \param [in] decode_size_policy Decode size policy used for the loader
* \param [in] shard_id Shard id for this loader
* \param [in] shard_count Total shard count
* \return Reference to the output tensor
*/
extern "C" RocalTensor rocalNumpyFileSourceSingleShard(
RocalContext p_context,
const char* source_path,
std::vector<std::string> files = {},
bool is_output = false,
bool shuffle = false,
bool loop = false,
RocalImageSizeEvaluationPolicy decode_size_policy = ROCAL_USE_MAX_SIZE,
unsigned shard_id = 0,
unsigned shard_count = 1,
unsigned seed = 0);

/*!
* \brief Creates a video reader and decoder as a source. It allocates the resources and objects required to read and decode mp4 videos stored on the file systems.
* \ingroup group_rocal_data_loaders
Expand Down
19 changes: 19 additions & 0 deletions rocAL/include/api/rocal_api_meta_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,23 @@ extern "C" void ROCAL_API_CALL rocalBoxIouMatcher(RocalContext p_context, std::v
*/
extern "C" RocalTensorList ROCAL_API_CALL rocalGetMatchedIndices(RocalContext p_context);

/*! \brief initialize the values required for ROI Random crop
* \ingroup group_rocal_meta_data
* \param [in] rocal_context rocal context
* \param [in] crop_shape_batch
* \param [in] roi_begin_batch
* \param [in] input_shape_batch
* \param [in] roi_end_batch
* \param [out] anchor The generated anchor tensor
*/
extern "C" RocalTensor ROCAL_API_CALL rocalROIRandomCrop(RocalContext p_context, RocalTensor p_input, RocalTensor roi_start, RocalTensor roi_end, std::vector<int> crop_shape);

/*! \brief initialize the values required for ROI Random crop
* \ingroup group_rocal_meta_data
* \param [in] rocal_context rocal context
* \param [in] p_input
* \param [out] anchor The generated anchor tensor
*/
extern "C" RocalTensorList ROCAL_API_CALL rocalRandomObjectBbox(RocalContext p_context, RocalTensor p_input, std::string output_format="anchor_shape", int k_largest = -1, float foreground_prob = 1.0);

#endif // MIVISIONX_ROCAL_API_META_DATA_H
23 changes: 20 additions & 3 deletions rocAL/include/api/rocal_api_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,15 @@ enum RocalTensorLayout {
/*! \brief AMD ROCAL_NFCHW
*/
ROCAL_NFCHW = 3,
/*! \brief AMD ROCAL_NDHWC
*/
ROCAL_NDHWC = 4,
/*! \brief AMD ROCAL_NCDHW
*/
ROCAL_NCDHW = 5,
/*! \brief AMD ROCAL_NONE
*/
ROCAL_NONE = 4 // Layout for generic tensors (Non-Image or Non-Video)
ROCAL_NONE = 6 // Layout for generic tensors (Non-Image or Non-Video)
};

/*! \brief rocAL Tensor Output Type enum
Expand Down Expand Up @@ -312,8 +318,7 @@ enum RocalResizeScalingMode {
/*! \brief rocAL Resize Interpolation Type enum
* \ingroup group_rocal_types
*/
enum RocalResizeInterpolationType
{
enum RocalResizeInterpolationType {
/*! \brief AMD ROCAL_NEAREST_NEIGHBOR_INTERPOLATION
*/
ROCAL_NEAREST_NEIGHBOR_INTERPOLATION = 0,
Expand Down Expand Up @@ -373,4 +378,16 @@ enum RocalExternalSourceMode {
ROCAL_EXTSOURCE_RAW_UNCOMPRESSED = 2,
};

/*! \brief Tensor padding types
* \ingroup group_rocal_types
*/
enum RocalOutOfBoundsPolicy {
/*! \brief TRIM_TO_SHAPE
*/
TRIMTOSHAPE = 0,
/*! \brief PAD
*/
PAD,
};

#endif // MIVISIONX_ROCAL_API_TYPES_H
2 changes: 2 additions & 0 deletions rocAL/include/augmentations/augmentations_nodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ THE SOFTWARE.
#include "node_copy.h"
#include "node_nop.h"
#include "node_sequence_rearrange.h"
#include "node_gaussian_noise.h"
#include "node_slice.h"
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class BrightnessNode : public Node {
BrightnessNode(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs);
BrightnessNode() = delete;

void init(float alpha, float beta);
void init(FloatParam *alpha_param, FloatParam *beta_param);
void init(float alpha, float beta, int conditional_execution);
void init(FloatParam *alpha_param, FloatParam *beta_param, IntParam *conditional_execution);

protected:
void create_node() override;
Expand All @@ -41,6 +41,8 @@ class BrightnessNode : public Node {
private:
ParameterVX<float> _alpha;
ParameterVX<float> _beta;
ParameterVX<int> _conditional_execution;
constexpr static float ALPHA_RANGE[2] = {0.1, 1.95};
constexpr static float BETA_RANGE[2] = {0, 25};
constexpr static int CONDITIONAL_EXECUTION_RANGE[2] = {0, 1};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
Copyright (c) 2019 - 2023 Advanced Micro Devices, Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

#pragma once

#include "graph.h"
#include "node.h"
#include "parameter_factory.h"
#include "parameter_vx.h"

class GaussianNoiseNode : public Node {
public:
GaussianNoiseNode(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs);
GaussianNoiseNode() = delete;
void init(float mean, float std_dev, int seed, int conditional_execution);
void init(FloatParam *mean_param, FloatParam *stddev_param, int seed, IntParam *condition_execution_param);

protected:
void create_node() override;
void update_node() override;

private:
ParameterVX<float> _mean, _stddev;
ParameterVX<int> _conditional_execution;
constexpr static float MEAN_RANGE[2] = {0, 5};
constexpr static float STDDEV_RANGE[2] = {1, 5};
constexpr static int CONDITIONAL_EXECUTION_RANGE[2] = {0, 1};
int _seed;
};
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ class FlipNode : public Node {
public:
FlipNode(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs);
FlipNode() = delete;
void init(int h_flag, int v_flag);
void init(IntParam *h_flag_param, IntParam *v_flag_param);
void init(int h_flag, int v_flag, int d_flag);
void init(IntParam *h_flag_param, IntParam *v_flag_param, IntParam *d_flag_param);
vx_array get_horizontal_flip() { return _horizontal.default_array(); }
vx_array get_vertical_flip() { return _vertical.default_array(); }
vx_array get_depth_flip() { return _depth.default_array(); }

protected:
void create_node() override;
void update_node() override;

private:
ParameterVX<int> _horizontal, _vertical;
ParameterVX<int> _horizontal, _vertical, _depth;
constexpr static int HORIZONTAL_RANGE[2] = {0, 1};
constexpr static int VERTICAL_RANGE[2] = {0, 1};
constexpr static int DEPTH_RANGE[2] = {0, 1};
};
51 changes: 51 additions & 0 deletions rocAL/include/augmentations/geometry_augmentations/node_slice.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

#pragma once
#include "graph.h"
#include "node.h"
#include "parameter_factory.h"
#include "parameter_vx.h"
#include "rocal_api_types.h"

class SliceNode : public Node {
public:
SliceNode(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs);
SliceNode() = delete;
~SliceNode();
void init(Tensor *anchor_param, std::vector<int> shape_param, std::vector<float> &fill_values_param, RocalOutOfBoundsPolicy policy);

protected:
void create_node() override;
void update_node() override;
void create_shape_tensor();

private:
vx_array _fill_values_array;
void *_shape_array;
Tensor *_anchor;
vx_tensor _shape = nullptr;
std::vector<float> _fill_values, _fill_values_vec;
std::vector<int> _anchor_vec, _shape_vec;
std::vector<std::vector<uint32_t>> _slice_roi;
RocalOutOfBoundsPolicy _policy = RocalOutOfBoundsPolicy::PAD;
};
Loading