/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocal/checkouts/develop/rocAL/include/api/rocal_api_data_loaders.h Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocal/checkouts/develop/rocAL/include/api/rocal_api_data_loaders.h Source File#

rocAL: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocal/checkouts/develop/rocAL/include/api/rocal_api_data_loaders.h Source File
rocal_api_data_loaders.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2019 - 2025 Advanced Micro Devices, Inc. All rights reserved.
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 THE SOFTWARE.
21 */
22 
23 #ifndef MIVISIONX_ROCAL_API_DATA_LOADERS_H
24 #define MIVISIONX_ROCAL_API_DATA_LOADERS_H
25 #include "rocal_api_types.h"
26 
53  const char* source_path,
54  RocalImageColor rocal_color_format,
55  unsigned internal_shard_count,
56  bool is_output,
57  bool shuffle = false,
58  bool loop = false,
60  unsigned max_width = 0, unsigned max_height = 0, RocalDecoderType rocal_decoder_type = RocalDecoderType::ROCAL_DECODER_TJPEG,
61  RocalShardingInfo rocal_sharding_info = RocalShardingInfo(), unsigned seed = 0);
62 
82  const char* source_path,
83  RocalImageColor rocal_color_format,
84  unsigned shard_id,
85  unsigned shard_count,
86  bool is_output,
87  bool shuffle = false,
88  bool loop = false,
90  unsigned max_width = 0, unsigned max_height = 0, RocalDecoderType rocal_decoder_type = RocalDecoderType::ROCAL_DECODER_TJPEG,
91  RocalShardingInfo rocal_sharding_info = RocalShardingInfo(), unsigned seed = 0);
92 
109  const char* source_path,
110  RocalImageColor rocal_color_format,
111  unsigned internal_shard_count,
112  unsigned sequence_length,
113  bool is_output,
114  bool shuffle = false,
115  bool loop = false,
116  unsigned step = 0,
117  unsigned stride = 0,
118  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
119 
137  const char* source_path,
138  RocalImageColor rocal_color_format,
139  unsigned shard_id,
140  unsigned shard_count,
141  unsigned sequence_length,
142  bool is_output,
143  bool shuffle = false,
144  bool loop = false,
145  unsigned step = 0,
146  unsigned stride = 0,
147  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
148 
165  const char* source_path,
166  const char* json_path,
167  RocalImageColor color_format,
168  unsigned internal_shard_count,
169  bool is_output,
170  bool shuffle = false,
171  bool loop = false,
173  unsigned max_width = 0, unsigned max_height = 0,
175  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
176 
196  const char* source_path,
197  const char* json_path,
198  RocalImageColor rocal_color_format,
199  unsigned internal_shard_count,
200  bool is_output,
201  std::vector<float>& area_factor,
202  std::vector<float>& aspect_ratio,
203  unsigned num_attempts,
204  bool shuffle = false,
205  bool loop = false,
207  unsigned max_width = 0, unsigned max_height = 0,
208  RocalShardingInfo rocal_sharding_info = RocalShardingInfo(),
210 
230  const char* source_path,
231  const char* json_path,
232  RocalImageColor rocal_color_format,
233  unsigned shard_id,
234  unsigned shard_count,
235  bool is_output,
236  std::vector<float>& area_factor,
237  std::vector<float>& aspect_ratio,
238  unsigned num_attempts,
239  bool shuffle = false,
240  bool loop = false,
242  unsigned max_width = 0, unsigned max_height = 0,
243  RocalShardingInfo rocal_sharding_info = RocalShardingInfo(),
245 
263  const char* source_path,
264  const char* json_path,
265  RocalImageColor color_format,
266  unsigned shard_id,
267  unsigned shard_count,
268  bool is_output,
269  bool shuffle = false,
270  bool loop = false,
272  unsigned max_width = 0, unsigned max_height = 0,
274  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
275 
293  const char* source_path,
294  RocalImageColor rocal_color_format,
295  unsigned internal_shard_count,
296  bool is_output,
297  bool shuffle = false,
298  bool loop = false,
300  unsigned max_width = 0, unsigned max_height = 0,
302  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
303 
322  const char* source_path,
323  RocalImageColor rocal_color_format,
324  unsigned shard_id,
325  unsigned shard_count,
326  bool is_output,
327  bool shuffle = false,
328  bool loop = false,
330  unsigned max_width = 0, unsigned max_height = 0,
332  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
333 
351  const char* source_path,
352  RocalImageColor rocal_color_format,
353  unsigned internal_shard_count,
354  bool is_output,
355  bool shuffle = false,
356  bool loop = false,
358  unsigned max_width = 0, unsigned max_height = 0,
360  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
361 
380  const char* source_path,
381  RocalImageColor rocal_color_format,
382  unsigned shard_id,
383  unsigned shard_count,
384  bool is_output,
385  bool shuffle = false,
386  bool loop = false,
388  unsigned max_width = 0, unsigned max_height = 0,
390  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
391 
409  const char* source_path,
410  RocalImageColor rocal_color_format,
411  unsigned internal_shard_count,
412  bool is_output,
413  bool shuffle = false,
414  bool loop = false,
416  unsigned max_width = 0, unsigned max_height = 0,
418  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
419 
438  const char* source_path,
439  RocalImageColor rocal_color_format,
440  unsigned shard_id,
441  unsigned shard_count,
442  bool is_output,
443  bool shuffle = false,
444  bool loop = false,
446  unsigned max_width = 0, unsigned max_height = 0,
448  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
449 
470  const char* source_path,
471  RocalImageColor rocal_color_format,
472  unsigned num_threads,
473  bool is_output,
474  std::vector<float>& area_factor,
475  std::vector<float>& aspect_ratio,
476  unsigned num_attempts,
477  bool shuffle = false,
478  bool loop = false,
480  unsigned max_width = 0, unsigned max_height = 0,
481  RocalShardingInfo rocal_sharding_info = RocalShardingInfo(),
483 
503  const char* source_path,
504  RocalImageColor color_format,
505  unsigned shard_id,
506  unsigned shard_count,
507  bool is_output,
508  std::vector<float>& area_factor,
509  std::vector<float>& aspect_ratio,
510  unsigned num_attempts,
511  bool shuffle = false,
512  bool loop = false,
514  unsigned max_width = 0, unsigned max_height = 0,
515  RocalShardingInfo rocal_sharding_info = RocalShardingInfo(),
517 
535  const char* source_path,
536  RocalImageColor rocal_color_format,
537  unsigned internal_shard_count,
538  bool is_output,
539  const char* user_key_for_encoded,
540  const char* user_key_for_filename,
541  bool shuffle = false,
542  bool loop = false,
544  unsigned max_width = 0, unsigned max_height = 0,
546  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
547 
566  const char* source_path,
567  RocalImageColor rocal_color_format,
568  unsigned shard_id,
569  unsigned shard_count,
570  bool is_output,
571  const char* user_key_for_encoded,
572  const char* user_key_for_filename,
573  bool shuffle = false,
574  bool loop = false,
576  unsigned max_width = 0, unsigned max_height = 0,
578  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
579 
594  const char* source_path,
595  const char* user_key_for_raw_file,
596  const char* user_key_for_filename,
597  RocalImageColor rocal_color_format,
598  bool is_output,
599  bool shuffle = false,
600  bool loop = false,
601  unsigned out_width = 0, unsigned out_height = 0,
602  const char* record_name_prefix = "",
603  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
604 
620  const char* source_path,
621  const char* user_key_for_raw_file,
622  const char* user_key_for_filename,
623  RocalImageColor rocal_color_format,
624  unsigned shard_id,
625  unsigned shard_count,
626  bool is_output,
627  bool shuffle = false,
628  bool loop = false,
629  unsigned out_width = 0, unsigned out_height = 0,
630  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
631 
647  const char* source_path,
648  unsigned internal_shard_count,
650  std::vector<std::string> files = {},
651  bool is_output = false,
652  bool shuffle = false,
653  bool loop = false,
654  unsigned seed = 0,
655  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
656 
673  const char* source_path,
675  std::vector<std::string> files = {},
676  bool is_output = false,
677  bool shuffle = false,
678  bool loop = false,
679  unsigned shard_id = 0,
680  unsigned shard_count = 1,
681  unsigned seed = 0,
682  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
683 
704  const char* source_path,
705  RocalImageColor color_format,
706  RocalDecodeDevice rocal_decode_device,
707  unsigned internal_shard_count,
708  unsigned sequence_length,
709  bool is_output = false,
710  bool shuffle = false,
711  bool loop = false,
713  unsigned step = 0,
714  unsigned stride = 0,
715  bool file_list_frame_num = true,
716  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
717 
738  const char* source_path,
739  RocalImageColor color_format,
740  RocalDecodeDevice rocal_decode_device,
741  unsigned shard_id,
742  unsigned shard_count,
743  unsigned sequence_length,
744  bool shuffle = false,
745  bool is_output = false,
746  bool loop = false,
748  unsigned step = 0,
749  unsigned stride = 0,
750  bool file_list_frame_num = true,
751  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
752 
774  const char* source_path,
775  RocalImageColor color_format,
776  RocalDecodeDevice rocal_decode_device,
777  unsigned internal_shard_count,
778  unsigned sequence_length,
779  unsigned dest_width,
780  unsigned dest_height,
781  bool shuffle = false,
782  bool is_output = false,
783  bool loop = false,
785  unsigned step = 0,
786  unsigned stride = 0,
787  bool file_list_frame_num = true,
789  std::vector<unsigned> max_size = {},
790  unsigned resize_shorter = 0,
791  unsigned resize_longer = 0,
793  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
794 
817  const char* source_path,
818  RocalImageColor color_format,
819  RocalDecodeDevice rocal_decode_device,
820  unsigned shard_id,
821  unsigned shard_count,
822  unsigned sequence_length,
823  unsigned dest_width,
824  unsigned dest_height,
825  bool shuffle = false,
826  bool is_output = false,
827  bool loop = false,
829  unsigned step = 0,
830  unsigned stride = 0,
831  bool file_list_frame_num = true,
833  std::vector<unsigned> max_size = {},
834  unsigned resize_shorter = 0,
835  unsigned resize_longer = 0,
837  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
838 
852  const char* source_path,
853  RocalImageColor color_format,
854  bool is_output,
855  unsigned out_width, unsigned out_height, const char* filename_prefix = "",
856  bool loop = false);
857 
875  const char* source_path,
876  RocalImageColor color_format,
877  unsigned shard_id,
878  unsigned shard_count,
879  bool is_output,
880  bool shuffle,
881  bool loop,
882  unsigned out_width, unsigned out_height, const char* filename_prefix = "",
883  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
884 
891 
913  const char* source_path,
914  RocalImageColor rocal_color_format,
915  unsigned shard_id,
916  unsigned shard_count,
917  bool is_output,
918  std::vector<float>& area_factor,
919  std::vector<float>& aspect_ratio,
920  unsigned num_attempts,
921  bool shuffle = false,
922  bool loop = false,
924  unsigned max_width = 0, unsigned max_height = 0,
925  RocalShardingInfo rocal_sharding_info = RocalShardingInfo(),
927 
946  const char* source_path,
947  RocalImageColor rocal_color_format,
948  unsigned shard_id,
949  unsigned shard_count,
950  bool is_output,
951  std::vector<float>& area_factor,
952  std::vector<float>& aspect_ratio,
953  unsigned num_attempts,
954  bool shuffle = false,
955  bool loop = false,
957  unsigned max_width = 0, unsigned max_height = 0,
958  RocalShardingInfo rocal_sharding_info = RocalShardingInfo(),
976  RocalImageColor rocal_color_format,
977  bool is_output = false,
978  bool shuffle = false,
979  bool loop = false,
981  unsigned max_width = 0, unsigned max_height = 0,
984  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
985 
1003  const char* source_path,
1004  const char* source_file_list_path,
1005  unsigned shard_count,
1006  bool is_output,
1007  bool shuffle = false,
1008  bool loop = false,
1009  bool downmix = false,
1011  unsigned max_decoded_samples = 0,
1012  unsigned max_decoded_channels = 0,
1013  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
1014 
1033  const char* source_path,
1034  const char* source_file_list_path,
1035  unsigned shard_id,
1036  unsigned shard_count,
1037  bool is_output,
1038  bool shuffle = false,
1039  bool loop = false,
1040  bool downmix = false,
1042  unsigned max_decoded_samples = 0,
1043  unsigned max_decoded_channels = 0,
1044  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
1045 
1064  const char* source_path,
1065  const char* index_path,
1066  RocalImageColor rocal_color_format,
1067  unsigned shard_id,
1068  unsigned shard_count,
1069  bool is_output,
1070  bool shuffle = false,
1071  bool loop = false,
1073  unsigned max_width = 0,
1074  unsigned max_height = 0,
1076  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
1077 
1078 #endif // MIVISIONX_ROCAL_API_DATA_LOADERS_H
class representing rocal tensor
Definition: rocal_api_tensor.h:38
RocalTensor ROCAL_API_CALL rocalMXNetRecordSource(RocalContext context, const char *source_path, RocalImageColor rocal_color_format, unsigned internal_shard_count, bool is_output, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates JPEG image reader and decoder for MXNet records. It allocates the resources and objects requi...
RocalTensor rocalNumpyFileSourceSingleShard(RocalContext context, const char *source_path, RocalTensorLayout output_layout=RocalTensorLayout::ROCAL_NONE, std::vector< std::string > files={}, bool is_output=false, bool shuffle=false, bool loop=false, unsigned shard_id=0, unsigned shard_count=1, unsigned seed=0, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates Numpy raw data reader and loader. It allocates the resources and objects required to read raw...
RocalTensor ROCAL_API_CALL rocalJpegExternalFileSource(RocalContext p_context, RocalImageColor rocal_color_format, bool is_output=false, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG, RocalExternalSourceMode external_source_mode=RocalExternalSourceMode::ROCAL_EXTSOURCE_FNAME, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates JPEG external source image reader.
RocalTensor ROCAL_API_CALL rocalVideoFileResizeSingleShard(RocalContext context, const char *source_path, RocalImageColor color_format, RocalDecodeDevice rocal_decode_device, unsigned shard_id, unsigned shard_count, unsigned sequence_length, unsigned dest_width, unsigned dest_height, bool shuffle=false, bool is_output=false, bool loop=false, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_VIDEO_FFMPEG_SW, unsigned step=0, unsigned stride=0, bool file_list_frame_num=true, RocalResizeScalingMode scaling_mode=ROCAL_SCALING_MODE_DEFAULT, std::vector< unsigned > max_size={}, unsigned resize_shorter=0, unsigned resize_longer=0, RocalResizeInterpolationType interpolation_type=ROCAL_LINEAR_INTERPOLATION, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates a video reader and decoder as a source. It allocates the resources and objects required to re...
RocalTensor ROCAL_API_CALL rocalRawTFRecordSourceSingleShard(RocalContext p_context, const char *source_path, const char *user_key_for_raw_file, const char *user_key_for_filename, RocalImageColor rocal_color_format, unsigned shard_id, unsigned shard_count, bool is_output, bool shuffle=false, bool loop=false, unsigned out_width=0, unsigned out_height=0, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates Raw image loader. It allocates the resources and objects required to load images stored on th...
RocalTensor ROCAL_API_CALL rocalJpegCOCOFileSourcePartialSingleShard(RocalContext p_context, const char *source_path, const char *json_path, RocalImageColor rocal_color_format, unsigned shard_id, unsigned shard_count, bool is_output, std::vector< float > &area_factor, std::vector< float > &aspect_ratio, unsigned num_attempts, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalShardingInfo rocal_sharding_info=RocalShardingInfo(), RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG)
Creates JPEG image reader and partial decoder. It allocates the resources and objects required to rea...
RocalTensor ROCAL_API_CALL rocalJpegCaffeLMDBRecordSource(RocalContext context, const char *source_path, RocalImageColor rocal_color_format, unsigned internal_shard_count, bool is_output, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates JPEG image reader and decoder for Caffe LMDB records. It allocates the resources and objects ...
RocalTensor ROCAL_API_CALL rocalVideoFileSource(RocalContext context, const char *source_path, RocalImageColor color_format, RocalDecodeDevice rocal_decode_device, unsigned internal_shard_count, unsigned sequence_length, bool is_output=false, bool shuffle=false, bool loop=false, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_VIDEO_FFMPEG_SW, unsigned step=0, unsigned stride=0, bool file_list_frame_num=true, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates a video reader and decoder as a source. It allocates the resources and objects required to re...
RocalTensor ROCAL_API_CALL rocalRawCIFAR10Source(RocalContext context, const char *source_path, RocalImageColor color_format, bool is_output, unsigned out_width, unsigned out_height, const char *filename_prefix="", bool loop=false)
Creates CIFAR10 raw data reader and loader. It allocates the resources and objects required to read r...
RocalTensor ROCAL_API_CALL rocalNumpyFileSource(RocalContext context, const char *source_path, unsigned internal_shard_count, RocalTensorLayout output_layout=RocalTensorLayout::ROCAL_NONE, std::vector< std::string > files={}, bool is_output=false, bool shuffle=false, bool loop=false, unsigned seed=0, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates Numpy raw data reader and loader. It allocates the resources and objects required to read raw...
RocalTensor ROCAL_API_CALL rocalJpegFileSource(RocalContext context, const char *source_path, RocalImageColor rocal_color_format, unsigned internal_shard_count, bool is_output, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG, RocalShardingInfo rocal_sharding_info=RocalShardingInfo(), unsigned seed=0)
Creates JPEG image reader and decoder. It allocates the resources and objects required to read and de...
RocalTensor ROCAL_API_CALL rocalJpegCOCOFileSource(RocalContext context, const char *source_path, const char *json_path, RocalImageColor color_format, unsigned internal_shard_count, bool is_output, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
JPEG image reader and decoder. It allocates the resources and objects required to read and decode COC...
RocalTensor ROCAL_API_CALL rocalSequenceReaderSingleShard(RocalContext context, const char *source_path, RocalImageColor rocal_color_format, unsigned shard_id, unsigned shard_count, unsigned sequence_length, bool is_output, bool shuffle=false, bool loop=false, unsigned step=0, unsigned stride=0, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates JPEG image reader and decoder. Reads [Frames] sequences from a directory representing a colle...
RocalTensor ROCAL_API_CALL rocalJpegTFRecordSource(RocalContext context, const char *source_path, RocalImageColor rocal_color_format, unsigned internal_shard_count, bool is_output, const char *user_key_for_encoded, const char *user_key_for_filename, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates TensorFlow records JPEG image reader and decoder. It allocates the resources and objects requ...
RocalTensor ROCAL_API_CALL rocalVideoFileSourceSingleShard(RocalContext context, const char *source_path, RocalImageColor color_format, RocalDecodeDevice rocal_decode_device, unsigned shard_id, unsigned shard_count, unsigned sequence_length, bool shuffle=false, bool is_output=false, bool loop=false, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_VIDEO_FFMPEG_SW, unsigned step=0, unsigned stride=0, bool file_list_frame_num=true, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates a video reader and decoder as a source. It allocates the resources and objects required to re...
RocalTensor ROCAL_API_CALL rocalRawCIFAR10SourceSingleShard(RocalContext context, const char *source_path, RocalImageColor color_format, unsigned shard_id, unsigned shard_count, bool is_output, bool shuffle, bool loop, unsigned out_width, unsigned out_height, const char *filename_prefix="", RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates CIFAR10 raw data reader and loader. It allocates the resources and objects required to read r...
RocalTensor ROCAL_API_CALL rocalSequenceReader(RocalContext context, const char *source_path, RocalImageColor rocal_color_format, unsigned internal_shard_count, unsigned sequence_length, bool is_output, bool shuffle=false, bool loop=false, unsigned step=0, unsigned stride=0, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates JPEG image reader and decoder. Reads [Frames] sequences from a directory representing a colle...
RocalTensor ROCAL_API_CALL rocalJpegCaffeLMDBRecordSourceSingleShard(RocalContext p_context, const char *source_path, RocalImageColor rocal_color_format, unsigned shard_id, unsigned shard_count, bool is_output, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates JPEG image reader and decoder for Caffe LMDB records. It allocates the resources and objects ...
RocalTensor ROCAL_API_CALL rocalVideoFileResize(RocalContext context, const char *source_path, RocalImageColor color_format, RocalDecodeDevice rocal_decode_device, unsigned internal_shard_count, unsigned sequence_length, unsigned dest_width, unsigned dest_height, bool shuffle=false, bool is_output=false, bool loop=false, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_VIDEO_FFMPEG_SW, unsigned step=0, unsigned stride=0, bool file_list_frame_num=true, RocalResizeScalingMode scaling_mode=ROCAL_SCALING_MODE_DEFAULT, std::vector< unsigned > max_size={}, unsigned resize_shorter=0, unsigned resize_longer=0, RocalResizeInterpolationType interpolation_type=ROCAL_LINEAR_INTERPOLATION, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates a video reader and decoder as a source. It allocates the resources and objects required to re...
RocalTensor ROCAL_API_CALL rocalJpegCaffe2LMDBRecordSource(RocalContext context, const char *source_path, RocalImageColor rocal_color_format, unsigned internal_shard_count, bool is_output, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates JPEG image reader and decoder for Caffe2 LMDB records. It allocates the resources and objects...
RocalTensor ROCAL_API_CALL rocalFusedJpegCrop(RocalContext context, const char *source_path, RocalImageColor rocal_color_format, unsigned num_threads, bool is_output, std::vector< float > &area_factor, std::vector< float > &aspect_ratio, unsigned num_attempts, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalShardingInfo rocal_sharding_info=RocalShardingInfo(), RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG)
Creates JPEG image reader and partial decoder. It allocates the resources and objects required to rea...
RocalTensor ROCAL_API_CALL rocalJpegCaffe2LMDBRecordSourceSingleShard(RocalContext p_context, const char *source_path, RocalImageColor rocal_color_format, unsigned shard_id, unsigned shard_count, bool is_output, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates JPEG image reader and decoder for Caffe2 LMDB records. It allocates the resources and objects...
RocalTensor ROCAL_API_CALL rocalJpegTFRecordSourceSingleShard(RocalContext context, const char *source_path, RocalImageColor rocal_color_format, unsigned shard_id, unsigned shard_count, bool is_output, const char *user_key_for_encoded, const char *user_key_for_filename, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates TensorFlow records JPEG image reader and decoder. It allocates the resources and objects requ...
RocalTensor ROCAL_API_CALL rocalJpegFileSourceSingleShard(RocalContext context, const char *source_path, RocalImageColor rocal_color_format, unsigned shard_id, unsigned shard_count, bool is_output, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG, RocalShardingInfo rocal_sharding_info=RocalShardingInfo(), unsigned seed=0)
Creates JPEG image reader and decoder. It allocates the resources and objects required to read and de...
RocalTensor ROCAL_API_CALL rocalJpegCOCOFileSourceSingleShard(RocalContext context, const char *source_path, const char *json_path, RocalImageColor color_format, unsigned shard_id, unsigned shard_count, bool is_output, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates JPEG image reader. It allocates the resources and objects required to read and decode COCO Jp...
RocalStatus ROCAL_API_CALL rocalResetLoaders(RocalContext context)
reset Loaders
RocalTensor ROCAL_API_CALL rocalFusedJpegCropSingleShard(RocalContext context, const char *source_path, RocalImageColor color_format, unsigned shard_id, unsigned shard_count, bool is_output, std::vector< float > &area_factor, std::vector< float > &aspect_ratio, unsigned num_attempts, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalShardingInfo rocal_sharding_info=RocalShardingInfo(), RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG)
Creates JPEG image reader and partial decoder. It allocates the resources and objects required to rea...
RocalTensor ROCAL_API_CALL rocalJpegCaffe2LMDBRecordSourcePartialSingleShard(RocalContext p_context, const char *source_path, RocalImageColor rocal_color_format, unsigned shard_id, unsigned shard_count, bool is_output, std::vector< float > &area_factor, std::vector< float > &aspect_ratio, unsigned num_attempts, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalShardingInfo rocal_sharding_info=RocalShardingInfo(), RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG)
Creates JPEG image reader and partial decoder for Caffe2 LMDB records. It allocates the resources and...
RocalTensor ROCAL_API_CALL rocalMXNetRecordSourceSingleShard(RocalContext p_context, const char *source_path, RocalImageColor rocal_color_format, unsigned shard_id, unsigned shard_count, bool is_output, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates JPEG image reader and decoder for MXNet records. It allocates the resources and objects requi...
RocalTensor ROCAL_API_CALL rocalJpegCaffeLMDBRecordSourcePartialSingleShard(RocalContext p_context, const char *source_path, RocalImageColor rocal_color_format, unsigned shard_id, unsigned shard_count, bool is_output, std::vector< float > &area_factor, std::vector< float > &aspect_ratio, unsigned num_attempts, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalShardingInfo rocal_sharding_info=RocalShardingInfo(), RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG)
Creates JPEG image reader and partial decoder for Caffe LMDB records. It allocates the resources and ...
RocalTensor ROCAL_API_CALL rocalJpegCOCOFileSourcePartial(RocalContext p_context, const char *source_path, const char *json_path, RocalImageColor rocal_color_format, unsigned internal_shard_count, bool is_output, std::vector< float > &area_factor, std::vector< float > &aspect_ratio, unsigned num_attempts, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MOST_FREQUENT_SIZE, unsigned max_width=0, unsigned max_height=0, RocalShardingInfo rocal_sharding_info=RocalShardingInfo(), RocalDecoderType rocal_decoder_type=RocalDecoderType::ROCAL_DECODER_TJPEG)
JPEG image reader and partial decoder. It allocates the resources and objects required to read and de...
RocalTensor ROCAL_API_CALL rocalRawTFRecordSource(RocalContext p_context, const char *source_path, const char *user_key_for_raw_file, const char *user_key_for_filename, RocalImageColor rocal_color_format, bool is_output, bool shuffle=false, bool loop=false, unsigned out_width=0, unsigned out_height=0, const char *record_name_prefix="", RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
Creates Raw image loader. It allocates the resources and objects required to load images stored on th...
RocalDecoderType
rocAL Decoder Type enum
Definition: rocal_api_types.h:274
RocalResizeScalingMode
rocAL Resize Scaling Mode enum
Definition: rocal_api_types.h:324
RocalTensorLayout
rocAL Tensor Layout enum
Definition: rocal_api_types.h:209
RocalStatus
rocAL Status enum
Definition: rocal_api_types.h:113
RocalImageSizeEvaluationPolicy
rocAL Image Size Evaluation Policy enum
Definition: rocal_api_types.h:176
RocalExternalSourceMode
RocalExternalSourceMode struct.
Definition: rocal_api_types.h:394
RocalDecodeDevice
rocAL Decode Device enum
Definition: rocal_api_types.h:197
void * RocalContext
typedef void* rocAL Context
Definition: rocal_api_types.h:64
RocalResizeInterpolationType
rocAL Resize Interpolation Type enum
Definition: rocal_api_types.h:346
RocalImageColor
rocAL Image Color enum
Definition: rocal_api_types.h:134
@ ROCAL_DECODER_VIDEO_FFMPEG_SW
AMD ROCAL_DECODER_VIDEO_FFMPEG_SW.
Definition: rocal_api_types.h:280
@ ROCAL_DECODER_TJPEG
AMD ROCAL_DECODER_TJPEG.
Definition: rocal_api_types.h:277
@ ROCAL_SCALING_MODE_DEFAULT
scales wrt specified size, if only resize width/height is provided the other dimension is scaled acco...
Definition: rocal_api_types.h:327
@ ROCAL_NONE
AMD ROCAL_NONE.
Definition: rocal_api_types.h:241
@ ROCAL_USE_MOST_FREQUENT_SIZE
AMD ROCAL_USE_MOST_FREQUENT_SIZE.
Definition: rocal_api_types.h:185
@ ROCAL_USE_MAX_SIZE
AMD ROCAL_USE_MAX_SIZE.
Definition: rocal_api_types.h:179
@ ROCAL_EXTSOURCE_FNAME
list of filename passed as input
Definition: rocal_api_types.h:397
@ ROCAL_LINEAR_INTERPOLATION
AMD ROCAL_LINEAR_INTERPOLATION.
Definition: rocal_api_types.h:352
RocalTensor ROCAL_API_CALL rocalAudioFileSource(RocalContext context, const char *source_path, const char *source_file_list_path, unsigned shard_count, bool is_output, bool shuffle=false, bool loop=false, bool downmix=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MAX_SIZE, unsigned max_decoded_samples=0, unsigned max_decoded_channels=0, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
RocalTensor ROCAL_API_CALL rocalWebDatasetSourceSingleShard(RocalContext p_context, const char *source_path, const char *index_path, RocalImageColor rocal_color_format, unsigned shard_id, unsigned shard_count, bool is_output, bool shuffle=false, bool loop=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MAX_SIZE, unsigned max_width=0, unsigned max_height=0, RocalDecoderType dec_type=RocalDecoderType::ROCAL_DECODER_TJPEG, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
RocalTensor ROCAL_API_CALL rocalAudioFileSourceSingleShard(RocalContext p_context, const char *source_path, const char *source_file_list_path, unsigned shard_id, unsigned shard_count, bool is_output, bool shuffle=false, bool loop=false, bool downmix=false, RocalImageSizeEvaluationPolicy decode_size_policy=ROCAL_USE_MAX_SIZE, unsigned max_decoded_samples=0, unsigned max_decoded_channels=0, RocalShardingInfo rocal_sharding_info=RocalShardingInfo())
The AMD rocAL Library - Types.
#define ROCAL_API_CALL
Definition: rocal_api_types.h:36
rocAL RocalShardingInfo enum
Definition: rocal_api_types.h:484