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

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

rocAL: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocal/checkouts/docs-7.0.0/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 
51 extern "C" RocalTensor ROCAL_API_CALL rocalJpegFileSource(RocalContext context,
52  const char* source_path,
53  RocalImageColor rocal_color_format,
54  unsigned internal_shard_count,
55  bool is_output,
56  bool shuffle = false,
57  bool loop = false,
59  unsigned max_width = 0, unsigned max_height = 0, RocalDecoderType rocal_decoder_type = RocalDecoderType::ROCAL_DECODER_TJPEG,
60  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
61 
81  const char* source_path,
82  RocalImageColor rocal_color_format,
83  unsigned shard_id,
84  unsigned shard_count,
85  bool is_output,
86  bool shuffle = false,
87  bool loop = false,
89  unsigned max_width = 0, unsigned max_height = 0, RocalDecoderType rocal_decoder_type = RocalDecoderType::ROCAL_DECODER_TJPEG,
90  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
91 
107 extern "C" RocalTensor ROCAL_API_CALL rocalSequenceReader(RocalContext context,
108  const char* source_path,
109  RocalImageColor rocal_color_format,
110  unsigned internal_shard_count,
111  unsigned sequence_length,
112  bool is_output,
113  bool shuffle = false,
114  bool loop = false,
115  unsigned step = 0,
116  unsigned stride = 0,
117  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
118 
136  const char* source_path,
137  RocalImageColor rocal_color_format,
138  unsigned shard_id,
139  unsigned shard_count,
140  unsigned sequence_length,
141  bool is_output,
142  bool shuffle = false,
143  bool loop = false,
144  unsigned step = 0,
145  unsigned stride = 0,
146  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
147 
163 extern "C" RocalTensor ROCAL_API_CALL rocalJpegCOCOFileSource(RocalContext context,
164  const char* source_path,
165  const char* json_path,
166  RocalImageColor color_format,
167  unsigned internal_shard_count,
168  bool is_output,
169  bool shuffle = false,
170  bool loop = false,
172  unsigned max_width = 0, unsigned max_height = 0,
174  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
175 
194  const char* source_path,
195  const char* json_path,
196  RocalImageColor rocal_color_format,
197  unsigned internal_shard_count,
198  bool is_output,
199  std::vector<float>& area_factor,
200  std::vector<float>& aspect_ratio,
201  unsigned num_attempts,
202  bool shuffle = false,
203  bool loop = false,
205  unsigned max_width = 0, unsigned max_height = 0,
206  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
207 
226  const char* source_path,
227  const char* json_path,
228  RocalImageColor rocal_color_format,
229  unsigned shard_id,
230  unsigned shard_count,
231  bool is_output,
232  std::vector<float>& area_factor,
233  std::vector<float>& aspect_ratio,
234  unsigned num_attempts,
235  bool shuffle = false,
236  bool loop = false,
238  unsigned max_width = 0, unsigned max_height = 0,
239  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
240 
258  const char* source_path,
259  const char* json_path,
260  RocalImageColor color_format,
261  unsigned shard_id,
262  unsigned shard_count,
263  bool is_output,
264  bool shuffle = false,
265  bool loop = false,
267  unsigned max_width = 0, unsigned max_height = 0,
269  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
270 
287  const char* source_path,
288  RocalImageColor rocal_color_format,
289  unsigned internal_shard_count,
290  bool is_output,
291  bool shuffle = false,
292  bool loop = false,
294  unsigned max_width = 0, unsigned max_height = 0,
296  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
297 
316  const char* source_path,
317  RocalImageColor rocal_color_format,
318  unsigned shard_id,
319  unsigned shard_count,
320  bool is_output,
321  bool shuffle = false,
322  bool loop = false,
324  unsigned max_width = 0, unsigned max_height = 0,
326  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
327 
345  const char* source_path,
346  RocalImageColor rocal_color_format,
347  unsigned internal_shard_count,
348  bool is_output,
349  bool shuffle = false,
350  bool loop = false,
352  unsigned max_width = 0, unsigned max_height = 0,
354  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
355 
374  const char* source_path,
375  RocalImageColor rocal_color_format,
376  unsigned shard_id,
377  unsigned shard_count,
378  bool is_output,
379  bool shuffle = false,
380  bool loop = false,
382  unsigned max_width = 0, unsigned max_height = 0,
384  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
385 
402 extern "C" RocalTensor ROCAL_API_CALL rocalMXNetRecordSource(RocalContext context,
403  const char* source_path,
404  RocalImageColor rocal_color_format,
405  unsigned internal_shard_count,
406  bool is_output,
407  bool shuffle = false,
408  bool loop = false,
410  unsigned max_width = 0, unsigned max_height = 0,
412  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
413 
432  const char* source_path,
433  RocalImageColor rocal_color_format,
434  unsigned shard_id,
435  unsigned shard_count,
436  bool is_output,
437  bool shuffle = false,
438  bool loop = false,
440  unsigned max_width = 0, unsigned max_height = 0,
442  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
443 
462 extern "C" RocalTensor ROCAL_API_CALL rocalFusedJpegCrop(RocalContext context,
463  const char* source_path,
464  RocalImageColor rocal_color_format,
465  unsigned num_threads,
466  bool is_output,
467  std::vector<float>& area_factor,
468  std::vector<float>& aspect_ratio,
469  unsigned num_attempts,
470  bool shuffle = false,
471  bool loop = false,
473  unsigned max_width = 0, unsigned max_height = 0,
474  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
475 
494  const char* source_path,
495  RocalImageColor color_format,
496  unsigned shard_id,
497  unsigned shard_count,
498  bool is_output,
499  std::vector<float>& area_factor,
500  std::vector<float>& aspect_ratio,
501  unsigned num_attempts,
502  bool shuffle = false,
503  bool loop = false,
505  unsigned max_width = 0, unsigned max_height = 0,
506  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
507 
524 extern "C" RocalTensor ROCAL_API_CALL rocalJpegTFRecordSource(RocalContext context,
525  const char* source_path,
526  RocalImageColor rocal_color_format,
527  unsigned internal_shard_count,
528  bool is_output,
529  const char* user_key_for_encoded,
530  const char* user_key_for_filename,
531  bool shuffle = false,
532  bool loop = false,
534  unsigned max_width = 0, unsigned max_height = 0,
536  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
537 
556  const char* source_path,
557  RocalImageColor rocal_color_format,
558  unsigned shard_id,
559  unsigned shard_count,
560  bool is_output,
561  const char* user_key_for_encoded,
562  const char* user_key_for_filename,
563  bool shuffle = false,
564  bool loop = false,
566  unsigned max_width = 0, unsigned max_height = 0,
568  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
569 
583 extern "C" RocalTensor ROCAL_API_CALL rocalRawTFRecordSource(RocalContext p_context,
584  const char* source_path,
585  const char* user_key_for_raw_file,
586  const char* user_key_for_filename,
587  RocalImageColor rocal_color_format,
588  bool is_output,
589  bool shuffle = false,
590  bool loop = false,
591  unsigned out_width = 0, unsigned out_height = 0,
592  const char* record_name_prefix = "",
593  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
594 
610  const char* source_path,
611  const char* user_key_for_raw_file,
612  const char* user_key_for_filename,
613  RocalImageColor rocal_color_format,
614  unsigned shard_id,
615  unsigned shard_count,
616  bool is_output,
617  bool shuffle = false,
618  bool loop = false,
619  unsigned out_width = 0, unsigned out_height = 0,
620  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
621 
636 extern "C" RocalTensor ROCAL_API_CALL rocalNumpyFileSource(RocalContext context,
637  const char* source_path,
638  unsigned internal_shard_count,
640  std::vector<std::string> files = {},
641  bool is_output = false,
642  bool shuffle = false,
643  bool loop = false,
644  unsigned seed = 0,
645  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
646 
662 extern "C" RocalTensor rocalNumpyFileSourceSingleShard(RocalContext context,
663  const char* source_path,
665  std::vector<std::string> files = {},
666  bool is_output = false,
667  bool shuffle = false,
668  bool loop = false,
669  unsigned shard_id = 0,
670  unsigned shard_count = 1,
671  unsigned seed = 0,
672  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
673 
693 extern "C" RocalTensor ROCAL_API_CALL rocalVideoFileSource(RocalContext context,
694  const char* source_path,
695  RocalImageColor color_format,
696  RocalDecodeDevice rocal_decode_device,
697  unsigned internal_shard_count,
698  unsigned sequence_length,
699  bool is_output = false,
700  bool shuffle = false,
701  bool loop = false,
703  unsigned step = 0,
704  unsigned stride = 0,
705  bool file_list_frame_num = true,
706  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
707 
728  const char* source_path,
729  RocalImageColor color_format,
730  RocalDecodeDevice rocal_decode_device,
731  unsigned shard_id,
732  unsigned shard_count,
733  unsigned sequence_length,
734  bool shuffle = false,
735  bool is_output = false,
736  bool loop = false,
738  unsigned step = 0,
739  unsigned stride = 0,
740  bool file_list_frame_num = true,
741  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
742 
763 extern "C" RocalTensor ROCAL_API_CALL rocalVideoFileResize(RocalContext context,
764  const char* source_path,
765  RocalImageColor color_format,
766  RocalDecodeDevice rocal_decode_device,
767  unsigned internal_shard_count,
768  unsigned sequence_length,
769  unsigned dest_width,
770  unsigned dest_height,
771  bool shuffle = false,
772  bool is_output = false,
773  bool loop = false,
775  unsigned step = 0,
776  unsigned stride = 0,
777  bool file_list_frame_num = true,
779  std::vector<unsigned> max_size = {},
780  unsigned resize_shorter = 0,
781  unsigned resize_longer = 0,
783  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
784 
807  const char* source_path,
808  RocalImageColor color_format,
809  RocalDecodeDevice rocal_decode_device,
810  unsigned shard_id,
811  unsigned shard_count,
812  unsigned sequence_length,
813  unsigned dest_width,
814  unsigned dest_height,
815  bool shuffle = false,
816  bool is_output = false,
817  bool loop = false,
819  unsigned step = 0,
820  unsigned stride = 0,
821  bool file_list_frame_num = true,
823  std::vector<unsigned> max_size = {},
824  unsigned resize_shorter = 0,
825  unsigned resize_longer = 0,
827  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
828 
841 extern "C" RocalTensor ROCAL_API_CALL rocalRawCIFAR10Source(RocalContext context,
842  const char* source_path,
843  RocalImageColor color_format,
844  bool is_output,
845  unsigned out_width, unsigned out_height, const char* filename_prefix = "",
846  bool loop = false);
847 
865  const char* source_path,
866  RocalImageColor color_format,
867  unsigned shard_id,
868  unsigned shard_count,
869  bool is_output,
870  bool shuffle,
871  bool loop,
872  unsigned out_width, unsigned out_height, const char* filename_prefix = "",
873  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
874 
881 
902  const char* source_path,
903  RocalImageColor rocal_color_format,
904  unsigned shard_id,
905  unsigned shard_count,
906  bool is_output,
907  std::vector<float>& area_factor,
908  std::vector<float>& aspect_ratio,
909  unsigned num_attempts,
910  bool shuffle = false,
911  bool loop = false,
913  unsigned max_width = 0, unsigned max_height = 0,
914  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
915 
933  const char* source_path,
934  RocalImageColor rocal_color_format,
935  unsigned shard_id,
936  unsigned shard_count,
937  bool is_output,
938  std::vector<float>& area_factor,
939  std::vector<float>& aspect_ratio,
940  unsigned num_attempts,
941  bool shuffle = false,
942  bool loop = false,
944  unsigned max_width = 0, unsigned max_height = 0,
945  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
961 extern "C" RocalTensor ROCAL_API_CALL rocalJpegExternalFileSource(RocalContext p_context,
962  RocalImageColor rocal_color_format,
963  bool is_output = false,
964  bool shuffle = false,
965  bool loop = false,
967  unsigned max_width = 0, unsigned max_height = 0,
970  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
971 
988 extern "C" RocalTensor ROCAL_API_CALL rocalAudioFileSource(RocalContext context,
989  const char* source_path,
990  const char* source_file_list_path,
991  unsigned shard_count,
992  bool is_output,
993  bool shuffle = false,
994  bool loop = false,
995  bool downmix = false,
997  unsigned max_decoded_samples = 0,
998  unsigned max_decoded_channels = 0,
999  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
1000 
1019  const char* source_path,
1020  const char* source_file_list_path,
1021  unsigned shard_id,
1022  unsigned shard_count,
1023  bool is_output,
1024  bool shuffle = false,
1025  bool loop = false,
1026  bool downmix = false,
1028  unsigned max_decoded_samples = 0,
1029  unsigned max_decoded_channels = 0,
1030  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
1031 
1050  const char* source_path,
1051  const char* index_path,
1052  RocalImageColor rocal_color_format,
1053  unsigned shard_id,
1054  unsigned shard_count,
1055  bool is_output,
1056  bool shuffle = false,
1057  bool loop = false,
1059  unsigned max_width = 0,
1060  unsigned max_height = 0,
1062  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
1063 
1064 #endif // MIVISIONX_ROCAL_API_DATA_LOADERS_H
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 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())
Creates JPEG image reader and partial decoder. It allocates the resources and objects required to rea...
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 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())
Creates JPEG image reader and partial decoder for Caffe2 LMDB records. It allocates the resources and...
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 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 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())
Creates JPEG image reader and partial decoder. It allocates the resources and objects required to rea...
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())
Creates JPEG image reader and decoder. It allocates the resources and objects required to read and de...
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 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())
Creates JPEG image reader and decoder. It allocates the resources and objects required to read and de...
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 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())
Creates JPEG image reader and partial decoder. It allocates the resources and objects required to rea...
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())
Creates JPEG image reader and partial decoder for Caffe LMDB records. It allocates the resources and ...
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 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 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())
JPEG image reader and partial 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 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 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:273
RocalResizeScalingMode
rocAL Resize Scaling Mode enum
Definition: rocal_api_types.h:326
RocalTensorLayout
rocAL Tensor Layout enum
Definition: rocal_api_types.h:208
RocalStatus
rocAL Status enum
Definition: rocal_api_types.h:112
RocalImageSizeEvaluationPolicy
rocAL Image Size Evaluation Policy enum
Definition: rocal_api_types.h:175
RocalExternalSourceMode
RocalExternalSourceMode struct.
Definition: rocal_api_types.h:396
RocalDecodeDevice
rocAL Decode Device enum
Definition: rocal_api_types.h:196
void * RocalContext
typedef void* rocAL Context
Definition: rocal_api_types.h:63
RocalResizeInterpolationType
rocAL Resize Interpolation Type enum
Definition: rocal_api_types.h:348
RocalImageColor
rocAL Image Color enum
Definition: rocal_api_types.h:133
@ ROCAL_DECODER_VIDEO_FFMPEG_SW
AMD ROCAL_DECODER_VIDEO_FFMPEG_SW.
Definition: rocal_api_types.h:282
@ ROCAL_DECODER_TJPEG
AMD ROCAL_DECODER_TJPEG.
Definition: rocal_api_types.h:276
@ 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:329
@ ROCAL_NONE
AMD ROCAL_NONE.
Definition: rocal_api_types.h:240
@ ROCAL_USE_MOST_FREQUENT_SIZE
AMD ROCAL_USE_MOST_FREQUENT_SIZE.
Definition: rocal_api_types.h:184
@ ROCAL_USE_MAX_SIZE
AMD ROCAL_USE_MAX_SIZE.
Definition: rocal_api_types.h:178
@ ROCAL_EXTSOURCE_FNAME
list of filename passed as input
Definition: rocal_api_types.h:399
@ ROCAL_LINEAR_INTERPOLATION
AMD ROCAL_LINEAR_INTERPOLATION.
Definition: rocal_api_types.h:354
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:35
rocAL RocalShardingInfo enum
Definition: rocal_api_types.h:470