AMD rocAL - Meta Data API

AMD rocAL - Meta Data API#

rocAL: API: AMD rocAL - Meta Data API
API: AMD rocAL - Meta Data API

The AMD rocAL meta data functions. More...

Functions

RocalMetaData ROCAL_API_CALL rocalCreateLabelReader (RocalContext rocal_context, const char *source_path)
 rocalCreateLabelReader More...
 
RocalMetaData ROCAL_API_CALL rocalCreateVideoLabelReader (RocalContext rocal_context, const char *source_path, unsigned sequence_length, unsigned frame_step, unsigned frame_stride, bool file_list_frame_num=true)
 rocalCreateVideoLabelReader More...
 
RocalMetaData ROCAL_API_CALL rocalCreateTFReader (RocalContext rocal_context, const char *source_path, bool is_output, const char *user_key_for_label, const char *user_key_for_filename)
 rocalCreateTFReader More...
 
RocalMetaData ROCAL_API_CALL rocalCreateTFReaderDetection (RocalContext rocal_context, const char *source_path, bool is_output, const char *user_key_for_label, const char *user_key_for_text, const char *user_key_for_xmin, const char *user_key_for_ymin, const char *user_key_for_xmax, const char *user_key_for_ymax, const char *user_key_for_filename)
 rocalCreateTFReaderDetection More...
 
RocalMetaData ROCAL_API_CALL rocalCreateCOCOReader (RocalContext rocal_context, const char *source_path, bool is_output)
 rocalCreateCOCOReader More...
 
RocalMetaData ROCAL_API_CALL rocalCreateCOCOReaderKeyPoints (RocalContext rocal_context, const char *source_path, bool is_output, float sigma=0.0, unsigned pose_output_width=0, unsigned pose_output_height=0)
 rocalCreateCOCOReaderKeyPoints More...
 
RocalMetaData ROCAL_API_CALL rocalCreateTextFileBasedLabelReader (RocalContext rocal_context, const char *source_path)
 rocalCreateTextFileBasedLabelReader More...
 
RocalMetaData ROCAL_API_CALL rocalCreateCaffeLMDBLabelReader (RocalContext rocal_context, const char *source_path)
 rocalCreateCaffeLMDBLabelReader More...
 
RocalMetaData ROCAL_API_CALL rocalCreateCaffeLMDBReaderDetection (RocalContext rocal_context, const char *source_path)
 rocalCreateCaffeLMDBReaderDetection More...
 
RocalMetaData ROCAL_API_CALL rocalCreateCaffe2LMDBLabelReader (RocalContext rocal_context, const char *source_path, bool is_output)
 rocalCreateCaffe2LMDBLabelReader More...
 
RocalMetaData ROCAL_API_CALL rocalCreateCaffe2LMDBReaderDetection (RocalContext rocal_context, const char *source_path, bool is_output)
 rocalCreateCaffe2LMDBReaderDetection More...
 
RocalMetaData ROCAL_API_CALL rocalCreateMXNetReader (RocalContext rocal_context, const char *source_path, bool is_output)
 rocalCreateMXNetReader More...
 
void ROCAL_API_CALL rocalGetImageName (RocalContext rocal_context, char *buf)
 rocalGetImageName More...
 
unsigned ROCAL_API_CALL rocalGetImageNameLen (RocalContext rocal_context, int *buf)
 rocalGetImageNameLen More...
 
void ROCAL_API_CALL rocalGetImageLabels (RocalContext rocal_context, void *buf, RocalOutputMemType output_mem_type=RocalOutputMemType::ROCAL_MEMCPY_HOST)
 rocalGetImageLabels More...
 
unsigned ROCAL_API_CALL rocalGetBoundingBoxCount (RocalContext rocal_context, int *buf)
 rocalGetBoundingBoxCount More...
 
void ROCAL_API_CALL rocalGetBoundingBoxLabel (RocalContext rocal_context, int *buf)
 rocalGetBoundingBoxLabel More...
 
void ROCAL_API_CALL rocalGetBoundingBoxCords (RocalContext rocal_context, float *buf)
 rocalGetBoundingBoxCords More...
 
void ROCAL_API_CALL rocalGetImageSizes (RocalContext rocal_context, int *buf)
 rocalGetImageSizes More...
 
RocalMetaData ROCAL_API_CALL rocalCreateTextCifar10LabelReader (RocalContext rocal_context, const char *source_path, const char *file_prefix)
 rocalCreateTextCifar10LabelReader More...
 
void ROCAL_API_CALL rocalGetOneHotImageLabels (RocalContext rocal_context, void *buf, int numOfClasses, int dest)
 rocalGetOneHotImageLabels More...
 
void ROCAL_API_CALL rocalRandomBBoxCrop (RocalContext p_context, bool all_boxes_overlap, bool no_crop, RocalFloatParam aspect_ratio=NULL, bool has_shape=false, int crop_width=0, int crop_height=0, int num_attempts=1, RocalFloatParam scaling=NULL, int total_num_attempts=0, int64_t seed=0)
 rocalRandomBBoxCrop More...
 
void ROCAL_API_CALL rocalGetSequenceStartFrameNumber (RocalContext rocal_context, unsigned int *buf)
 rocalGetSequenceStartFrameNumber More...
 
void ROCAL_API_CALL rocalGetSequenceFrameTimestamps (RocalContext rocal_context, float *buf)
 rocalGetSequenceFrameTimestamps More...
 
void ROCAL_API_CALL rocalBoxEncoder (RocalContext p_context, std::vector< float > &anchors, float criteria, std::vector< float > &means, std::vector< float > &stds, bool offset=false, float scale=1.0)
 rocalBoxEncoder More...
 
void ROCAL_API_CALL rocalCopyEncodedBoxesAndLables (RocalContext p_context, float *boxes_buf, int *labels_buf)
 rocalCopyEncodedBoxesAndLables More...
 
void ROCAL_API_CALL rocalGetEncodedBoxesAndLables (RocalContext p_context, float **boxes_buf_ptr, int **labels_buf_ptr, int num_encoded_boxes)
 rocalGetEncodedBoxesAndLables More...
 
void ROCAL_API_CALL rocalGetImageId (RocalContext p_context, int *buf)
 rocalGetImageId More...
 
void ROCAL_API_CALL rocalGetJointsDataPtr (RocalContext p_context, RocalJointsData **joints_data)
 rocalGetJointsDataPtr More...
 

Detailed Description

The AMD rocAL meta data functions.

Function Documentation

◆ rocalBoxEncoder()

void ROCAL_API_CALL rocalBoxEncoder ( RocalContext  p_context,
std::vector< float > &  anchors,
float  criteria,
std::vector< float > &  means,
std::vector< float > &  stds,
bool  offset = false,
float  scale = 1.0 
)

rocalBoxEncoder

Parameters
anchorsAnchors to be used for encoding, as the array of floats is in the ltrb format.
criteriaThreshold IoU for matching bounding boxes with anchors. The value needs to be between 0 and 1.
offsetReturns normalized offsets ((encoded_bboxes*scale - anchors*scale) - mean) / stds in EncodedBBoxes that use std and the mean and scale arguments
means[x y w h] mean values for normalization.
stds[x y w h] standard deviations for offset normalization.
scaleRescales the box and anchor values before the offset is calculated (for example, to return to the absolute values).

◆ rocalCopyEncodedBoxesAndLables()

void ROCAL_API_CALL rocalCopyEncodedBoxesAndLables ( RocalContext  p_context,
float *  boxes_buf,
int *  labels_buf 
)

rocalCopyEncodedBoxesAndLables

Parameters
boxes_bufuser's buffer that will be filled with encoded bounding boxes . Its needs to be at least of size batch_size.
labels_bufuser's buffer that will be filled with encoded labels . Its needs to be at least of size batch_size.

◆ rocalCreateCaffe2LMDBLabelReader()

RocalMetaData ROCAL_API_CALL rocalCreateCaffe2LMDBLabelReader ( RocalContext  rocal_context,
const char *  source_path,
bool  is_output 
)

rocalCreateCaffe2LMDBLabelReader

Parameters
rocal_context
source_pathpath to the Caffe2LMDB records for Classification
Returns
RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors

◆ rocalCreateCaffe2LMDBReaderDetection()

RocalMetaData ROCAL_API_CALL rocalCreateCaffe2LMDBReaderDetection ( RocalContext  rocal_context,
const char *  source_path,
bool  is_output 
)

rocalCreateCaffe2LMDBReaderDetection

Parameters
rocal_context
source_pathpath to the Caffe2LMDB records for Object Detection
Returns
RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors

◆ rocalCreateCaffeLMDBLabelReader()

RocalMetaData ROCAL_API_CALL rocalCreateCaffeLMDBLabelReader ( RocalContext  rocal_context,
const char *  source_path 
)

rocalCreateCaffeLMDBLabelReader

Parameters
rocal_context
source_pathpath to the Caffe LMDB records for Classification
Returns
RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors

◆ rocalCreateCaffeLMDBReaderDetection()

RocalMetaData ROCAL_API_CALL rocalCreateCaffeLMDBReaderDetection ( RocalContext  rocal_context,
const char *  source_path 
)

rocalCreateCaffeLMDBReaderDetection

Parameters
rocal_context
source_pathpath to the Caffe LMDB records for Object Detection
Returns
RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors

◆ rocalCreateCOCOReader()

RocalMetaData ROCAL_API_CALL rocalCreateCOCOReader ( RocalContext  rocal_context,
const char *  source_path,
bool  is_output 
)

rocalCreateCOCOReader

Parameters
rocal_context
source_pathpath to the coco json file
Returns
RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors

◆ rocalCreateCOCOReaderKeyPoints()

RocalMetaData ROCAL_API_CALL rocalCreateCOCOReaderKeyPoints ( RocalContext  rocal_context,
const char *  source_path,
bool  is_output,
float  sigma = 0.0,
unsigned  pose_output_width = 0,
unsigned  pose_output_height = 0 
)

rocalCreateCOCOReaderKeyPoints

Parameters
rocal_context
source_pathpath to the coco json file
sigmasigma used for gaussian distribution (needed for HRNet Pose estimation)
pose_output_widthoutput image width (needed for HRNet Pose estimation)
pose_output_widthoutput image height (needed for HRNet Pose estimation)
Returns
RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors

◆ rocalCreateLabelReader()

RocalMetaData ROCAL_API_CALL rocalCreateLabelReader ( RocalContext  rocal_context,
const char *  source_path 
)

rocalCreateLabelReader

Parameters
rocal_context
source_pathpath to the folder that contains the dataset or metadata file
Returns
RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors

◆ rocalCreateMXNetReader()

RocalMetaData ROCAL_API_CALL rocalCreateMXNetReader ( RocalContext  rocal_context,
const char *  source_path,
bool  is_output 
)

rocalCreateMXNetReader

Parameters
rocal_context
source_pathpath to the MXNet recordio files for Classification
Returns
RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors

◆ rocalCreateTextCifar10LabelReader()

RocalMetaData ROCAL_API_CALL rocalCreateTextCifar10LabelReader ( RocalContext  rocal_context,
const char *  source_path,
const char *  file_prefix 
)

rocalCreateTextCifar10LabelReader

Parameters
rocal_context
source_pathpath to the file that contains the metadata file
filename_prefixlook only files with prefix ( needed for cifar10)
Returns
RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors

◆ rocalCreateTextFileBasedLabelReader()

RocalMetaData ROCAL_API_CALL rocalCreateTextFileBasedLabelReader ( RocalContext  rocal_context,
const char *  source_path 
)

rocalCreateTextFileBasedLabelReader

Parameters
rocal_context
source_pathpath to the file that contains the metadata file
Returns
RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors

◆ rocalCreateTFReader()

RocalMetaData ROCAL_API_CALL rocalCreateTFReader ( RocalContext  rocal_context,
const char *  source_path,
bool  is_output,
const char *  user_key_for_label,
const char *  user_key_for_filename 
)

rocalCreateTFReader

Parameters
rocal_context
source_pathpath to the coco json file
Returns
RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors

◆ rocalCreateTFReaderDetection()

RocalMetaData ROCAL_API_CALL rocalCreateTFReaderDetection ( RocalContext  rocal_context,
const char *  source_path,
bool  is_output,
const char *  user_key_for_label,
const char *  user_key_for_text,
const char *  user_key_for_xmin,
const char *  user_key_for_ymin,
const char *  user_key_for_xmax,
const char *  user_key_for_ymax,
const char *  user_key_for_filename 
)

rocalCreateTFReaderDetection

Parameters
rocal_context
source_pathpath to the coco json file
Returns
RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors

◆ rocalCreateVideoLabelReader()

RocalMetaData ROCAL_API_CALL rocalCreateVideoLabelReader ( RocalContext  rocal_context,
const char *  source_path,
unsigned  sequence_length,
unsigned  frame_step,
unsigned  frame_stride,
bool  file_list_frame_num = true 
)

rocalCreateVideoLabelReader

Parameters
rocal_context
source_pathpath to the folder that contains the dataset or metadata file
sequence_lengthThe number of frames in a sequence.
frame_stepFrame interval between each sequence.
frame_strideFrame interval between frames in a sequence.
file_list_frame_numTrue : when the inputs from text file is to be considered as frame numbers. False : when the inputs from text file is to considered as timestamps.
Returns
RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors

◆ rocalGetBoundingBoxCords()

void ROCAL_API_CALL rocalGetBoundingBoxCords ( RocalContext  rocal_context,
float *  buf 
)

rocalGetBoundingBoxCords

Parameters
rocal_context

◆ rocalGetBoundingBoxCount()

unsigned ROCAL_API_CALL rocalGetBoundingBoxCount ( RocalContext  rocal_context,
int *  buf 
)

rocalGetBoundingBoxCount

Parameters
rocal_context
bufThe user's buffer that will be filled with number of object in the images.
Returns
The size of the buffer needs to be provided by user to get bounding box info for all images in the output batch.

◆ rocalGetBoundingBoxLabel()

void ROCAL_API_CALL rocalGetBoundingBoxLabel ( RocalContext  rocal_context,
int *  buf 
)

rocalGetBoundingBoxLabel

Parameters
rocal_context
bufThe user's buffer that will be filled with bounding box label info for the images in the output batch. It needs to be of size returned by a call to the rocalGetBoundingBoxCount

◆ rocalGetEncodedBoxesAndLables()

void ROCAL_API_CALL rocalGetEncodedBoxesAndLables ( RocalContext  p_context,
float **  boxes_buf_ptr,
int **  labels_buf_ptr,
int  num_encoded_boxes 
)

rocalGetEncodedBoxesAndLables

Parameters
boxes_bufptr to user's buffer that will be filled with encoded bounding boxes . Its needs to be at least of size batch_size.
labels_bufuser's buffer that will be filled with encoded labels . Its needs to be at least of size batch_size.

◆ rocalGetImageId()

void ROCAL_API_CALL rocalGetImageId ( RocalContext  p_context,
int *  buf 
)

rocalGetImageId

Parameters
rocal_context
bufThe user's buffer that will be filled with image id info for the images in the output batch.

◆ rocalGetImageLabels()

void ROCAL_API_CALL rocalGetImageLabels ( RocalContext  rocal_context,
void *  buf,
RocalOutputMemType  output_mem_type = RocalOutputMemType::ROCAL_MEMCPY_HOST 
)

rocalGetImageLabels

Parameters
meta_dataRocalMetaData object that contains info about the images and labels
bufuser's buffer that will be filled with labels. Its needs to be at least of size batch_size.

◆ rocalGetImageName()

void ROCAL_API_CALL rocalGetImageName ( RocalContext  rocal_context,
char *  buf 
)

rocalGetImageName

Parameters
rocal_context
bufuser buffer provided to be filled with output image names for images in the output batch.

◆ rocalGetImageNameLen()

unsigned ROCAL_API_CALL rocalGetImageNameLen ( RocalContext  rocal_context,
int *  buf 
)

rocalGetImageNameLen

Parameters
rocal_context
bufuserbuffer provided to be filled with the length of the image names in the output batch
Returns
The size of the buffer needs to be provided by user to get the image names of the output batch

◆ rocalGetImageSizes()

void ROCAL_API_CALL rocalGetImageSizes ( RocalContext  rocal_context,
int *  buf 
)

rocalGetImageSizes

Parameters
rocal_context

◆ rocalGetJointsDataPtr()

void ROCAL_API_CALL rocalGetJointsDataPtr ( RocalContext  p_context,
RocalJointsData **  joints_data 
)

rocalGetJointsDataPtr

Parameters
rocal_context
joints_dataThe user's RocalJointsData pointer that will be pointed to JointsDataBatch pointer

◆ rocalGetOneHotImageLabels()

void ROCAL_API_CALL rocalGetOneHotImageLabels ( RocalContext  rocal_context,
void *  buf,
int  numOfClasses,
int  dest 
)

rocalGetOneHotImageLabels

Parameters
meta_dataRocalMetaData object that contains info about the images and labels
numOfClassesthe number of classes for a image dataset
bufuser's buffer that will be filled with labels. Its needs to be at least of size batch_size.
destdestination can be host=0 / device=1

◆ rocalGetSequenceFrameTimestamps()

void ROCAL_API_CALL rocalGetSequenceFrameTimestamps ( RocalContext  rocal_context,
float *  buf 
)

rocalGetSequenceFrameTimestamps

Parameters
rocal_context
bufThe user's buffer that will be filled with frame timestamps of each of the frames in output batch sequences.

◆ rocalGetSequenceStartFrameNumber()

void ROCAL_API_CALL rocalGetSequenceStartFrameNumber ( RocalContext  rocal_context,
unsigned int *  buf 
)

rocalGetSequenceStartFrameNumber

Parameters
rocal_context
bufThe user's buffer that will be filled with starting frame numbers of the output batch sequences.

◆ rocalRandomBBoxCrop()

void ROCAL_API_CALL rocalRandomBBoxCrop ( RocalContext  p_context,
bool  all_boxes_overlap,
bool  no_crop,
RocalFloatParam  aspect_ratio = NULL,
bool  has_shape = false,
int  crop_width = 0,
int  crop_height = 0,
int  num_attempts = 1,
RocalFloatParam  scaling = NULL,
int  total_num_attempts = 0,
int64_t  seed = 0 
)

rocalRandomBBoxCrop

Parameters
rocal_context