/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 
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 
195  const char* source_path,
196  const char* json_path,
197  RocalImageColor rocal_color_format,
198  unsigned internal_shard_count,
199  bool is_output,
200  std::vector<float>& area_factor,
201  std::vector<float>& aspect_ratio,
202  unsigned num_attempts,
203  bool shuffle = false,
204  bool loop = false,
206  unsigned max_width = 0, unsigned max_height = 0,
207  RocalShardingInfo rocal_sharding_info = RocalShardingInfo(),
209 
229  const char* source_path,
230  const char* json_path,
231  RocalImageColor rocal_color_format,
232  unsigned shard_id,
233  unsigned shard_count,
234  bool is_output,
235  std::vector<float>& area_factor,
236  std::vector<float>& aspect_ratio,
237  unsigned num_attempts,
238  bool shuffle = false,
239  bool loop = false,
241  unsigned max_width = 0, unsigned max_height = 0,
242  RocalShardingInfo rocal_sharding_info = RocalShardingInfo(),
244 
262  const char* source_path,
263  const char* json_path,
264  RocalImageColor color_format,
265  unsigned shard_id,
266  unsigned shard_count,
267  bool is_output,
268  bool shuffle = false,
269  bool loop = false,
271  unsigned max_width = 0, unsigned max_height = 0,
273  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
274 
292  const char* source_path,
293  RocalImageColor rocal_color_format,
294  unsigned internal_shard_count,
295  bool is_output,
296  bool shuffle = false,
297  bool loop = false,
299  unsigned max_width = 0, unsigned max_height = 0,
301  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
302 
321  const char* source_path,
322  RocalImageColor rocal_color_format,
323  unsigned shard_id,
324  unsigned shard_count,
325  bool is_output,
326  bool shuffle = false,
327  bool loop = false,
329  unsigned max_width = 0, unsigned max_height = 0,
331  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
332 
350  const char* source_path,
351  RocalImageColor rocal_color_format,
352  unsigned internal_shard_count,
353  bool is_output,
354  bool shuffle = false,
355  bool loop = false,
357  unsigned max_width = 0, unsigned max_height = 0,
359  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
360 
379  const char* source_path,
380  RocalImageColor rocal_color_format,
381  unsigned shard_id,
382  unsigned shard_count,
383  bool is_output,
384  bool shuffle = false,
385  bool loop = false,
387  unsigned max_width = 0, unsigned max_height = 0,
389  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
390 
407 extern "C" RocalTensor ROCAL_API_CALL rocalMXNetRecordSource(RocalContext context,
408  const char* source_path,
409  RocalImageColor rocal_color_format,
410  unsigned internal_shard_count,
411  bool is_output,
412  bool shuffle = false,
413  bool loop = false,
415  unsigned max_width = 0, unsigned max_height = 0,
417  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
418 
437  const char* source_path,
438  RocalImageColor rocal_color_format,
439  unsigned shard_id,
440  unsigned shard_count,
441  bool is_output,
442  bool shuffle = false,
443  bool loop = false,
445  unsigned max_width = 0, unsigned max_height = 0,
447  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
448 
468 extern "C" RocalTensor ROCAL_API_CALL rocalFusedJpegCrop(RocalContext context,
469  const char* source_path,
470  RocalImageColor rocal_color_format,
471  unsigned num_threads,
472  bool is_output,
473  std::vector<float>& area_factor,
474  std::vector<float>& aspect_ratio,
475  unsigned num_attempts,
476  bool shuffle = false,
477  bool loop = false,
479  unsigned max_width = 0, unsigned max_height = 0,
480  RocalShardingInfo rocal_sharding_info = RocalShardingInfo(),
482 
502  const char* source_path,
503  RocalImageColor color_format,
504  unsigned shard_id,
505  unsigned shard_count,
506  bool is_output,
507  std::vector<float>& area_factor,
508  std::vector<float>& aspect_ratio,
509  unsigned num_attempts,
510  bool shuffle = false,
511  bool loop = false,
513  unsigned max_width = 0, unsigned max_height = 0,
514  RocalShardingInfo rocal_sharding_info = RocalShardingInfo(),
516 
533 extern "C" RocalTensor ROCAL_API_CALL rocalJpegTFRecordSource(RocalContext context,
534  const char* source_path,
535  RocalImageColor rocal_color_format,
536  unsigned internal_shard_count,
537  bool is_output,
538  const char* user_key_for_encoded,
539  const char* user_key_for_filename,
540  bool shuffle = false,
541  bool loop = false,
543  unsigned max_width = 0, unsigned max_height = 0,
545  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
546 
565  const char* source_path,
566  RocalImageColor rocal_color_format,
567  unsigned shard_id,
568  unsigned shard_count,
569  bool is_output,
570  const char* user_key_for_encoded,
571  const char* user_key_for_filename,
572  bool shuffle = false,
573  bool loop = false,
575  unsigned max_width = 0, unsigned max_height = 0,
577  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
578 
592 extern "C" RocalTensor ROCAL_API_CALL rocalRawTFRecordSource(RocalContext p_context,
593  const char* source_path,
594  const char* user_key_for_raw_file,
595  const char* user_key_for_filename,
596  RocalImageColor rocal_color_format,
597  bool is_output,
598  bool shuffle = false,
599  bool loop = false,
600  unsigned out_width = 0, unsigned out_height = 0,
601  const char* record_name_prefix = "",
602  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
603 
619  const char* source_path,
620  const char* user_key_for_raw_file,
621  const char* user_key_for_filename,
622  RocalImageColor rocal_color_format,
623  unsigned shard_id,
624  unsigned shard_count,
625  bool is_output,
626  bool shuffle = false,
627  bool loop = false,
628  unsigned out_width = 0, unsigned out_height = 0,
629  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
630 
645 extern "C" RocalTensor ROCAL_API_CALL rocalNumpyFileSource(RocalContext context,
646  const char* source_path,
647  unsigned internal_shard_count,
649  std::vector<std::string> files = {},
650  bool is_output = false,
651  bool shuffle = false,
652  bool loop = false,
653  unsigned seed = 0,
654  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
655 
671 extern "C" RocalTensor rocalNumpyFileSourceSingleShard(RocalContext context,
672  const char* source_path,
674  std::vector<std::string> files = {},
675  bool is_output = false,
676  bool shuffle = false,
677  bool loop = false,
678  unsigned shard_id = 0,
679  unsigned shard_count = 1,
680  unsigned seed = 0,
681  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
682 
702 extern "C" RocalTensor ROCAL_API_CALL rocalVideoFileSource(RocalContext context,
703  const char* source_path,
704  RocalImageColor color_format,
705  RocalDecodeDevice rocal_decode_device,
706  unsigned internal_shard_count,
707  unsigned sequence_length,
708  bool is_output = false,
709  bool shuffle = false,
710  bool loop = false,
712  unsigned step = 0,
713  unsigned stride = 0,
714  bool file_list_frame_num = true,
715  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
716 
737  const char* source_path,
738  RocalImageColor color_format,
739  RocalDecodeDevice rocal_decode_device,
740  unsigned shard_id,
741  unsigned shard_count,
742  unsigned sequence_length,
743  bool shuffle = false,
744  bool is_output = false,
745  bool loop = false,
747  unsigned step = 0,
748  unsigned stride = 0,
749  bool file_list_frame_num = true,
750  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
751 
772 extern "C" RocalTensor ROCAL_API_CALL rocalVideoFileResize(RocalContext context,
773  const char* source_path,
774  RocalImageColor color_format,
775  RocalDecodeDevice rocal_decode_device,
776  unsigned internal_shard_count,
777  unsigned sequence_length,
778  unsigned dest_width,
779  unsigned dest_height,
780  bool shuffle = false,
781  bool is_output = false,
782  bool loop = false,
784  unsigned step = 0,
785  unsigned stride = 0,
786  bool file_list_frame_num = true,
788  std::vector<unsigned> max_size = {},
789  unsigned resize_shorter = 0,
790  unsigned resize_longer = 0,
792  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
793 
816  const char* source_path,
817  RocalImageColor color_format,
818  RocalDecodeDevice rocal_decode_device,
819  unsigned shard_id,
820  unsigned shard_count,
821  unsigned sequence_length,
822  unsigned dest_width,
823  unsigned dest_height,
824  bool shuffle = false,
825  bool is_output = false,
826  bool loop = false,
828  unsigned step = 0,
829  unsigned stride = 0,
830  bool file_list_frame_num = true,
832  std::vector<unsigned> max_size = {},
833  unsigned resize_shorter = 0,
834  unsigned resize_longer = 0,
836  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
837 
850 extern "C" RocalTensor ROCAL_API_CALL rocalRawCIFAR10Source(RocalContext context,
851  const char* source_path,
852  RocalImageColor color_format,
853  bool is_output,
854  unsigned out_width, unsigned out_height, const char* filename_prefix = "",
855  bool loop = false);
856 
874  const char* source_path,
875  RocalImageColor color_format,
876  unsigned shard_id,
877  unsigned shard_count,
878  bool is_output,
879  bool shuffle,
880  bool loop,
881  unsigned out_width, unsigned out_height, const char* filename_prefix = "",
882  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
883 
890 
912  const char* source_path,
913  RocalImageColor rocal_color_format,
914  unsigned shard_id,
915  unsigned shard_count,
916  bool is_output,
917  std::vector<float>& area_factor,
918  std::vector<float>& aspect_ratio,
919  unsigned num_attempts,
920  bool shuffle = false,
921  bool loop = false,
923  unsigned max_width = 0, unsigned max_height = 0,
924  RocalShardingInfo rocal_sharding_info = RocalShardingInfo(),
926 
945  const char* source_path,
946  RocalImageColor rocal_color_format,
947  unsigned shard_id,
948  unsigned shard_count,
949  bool is_output,
950  std::vector<float>& area_factor,
951  std::vector<float>& aspect_ratio,
952  unsigned num_attempts,
953  bool shuffle = false,
954  bool loop = false,
956  unsigned max_width = 0, unsigned max_height = 0,
957  RocalShardingInfo rocal_sharding_info = RocalShardingInfo(),
974 extern "C" RocalTensor ROCAL_API_CALL rocalJpegExternalFileSource(RocalContext p_context,
975  RocalImageColor rocal_color_format,
976  bool is_output = false,
977  bool shuffle = false,
978  bool loop = false,
980  unsigned max_width = 0, unsigned max_height = 0,
983  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
984 
1001 extern "C" RocalTensor ROCAL_API_CALL rocalAudioFileSource(RocalContext context,
1002  const char* source_path,
1003  const char* source_file_list_path,
1004  unsigned shard_count,
1005  bool is_output,
1006  bool shuffle = false,
1007  bool loop = false,
1008  bool downmix = false,
1010  unsigned max_decoded_samples = 0,
1011  unsigned max_decoded_channels = 0,
1012  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
1013 
1032  const char* source_path,
1033  const char* source_file_list_path,
1034  unsigned shard_id,
1035  unsigned shard_count,
1036  bool is_output,
1037  bool shuffle = false,
1038  bool loop = false,
1039  bool downmix = false,
1041  unsigned max_decoded_samples = 0,
1042  unsigned max_decoded_channels = 0,
1043  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
1044 
1063  const char* source_path,
1064  const char* index_path,
1065  RocalImageColor rocal_color_format,
1066  unsigned shard_id,
1067  unsigned shard_count,
1068  bool is_output,
1069  bool shuffle = false,
1070  bool loop = false,
1072  unsigned max_width = 0,
1073  unsigned max_height = 0,
1075  RocalShardingInfo rocal_sharding_info = RocalShardingInfo());
1076 
1077 #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 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 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 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 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 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: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