Skip to content

create_dl_transform_random_cropCreateDlTransformRandomCropCreateDlTransformRandomCropcreate_dl_transform_random_cropT_create_dl_transform_random_crop🔗

Short description🔗

create_dl_transform_random_cropCreateDlTransformRandomCropCreateDlTransformRandomCropcreate_dl_transform_random_cropT_create_dl_transform_random_crop — Create a random crop transform.

Signature🔗

create_dl_transform_random_crop( string TransformName, real Probability, integer Width, integer Height, attribute.name GenParamName, attribute.value GenParamValue, out dl_transform RandomCrop )void CreateDlTransformRandomCrop( const HTuple& TransformName, const HTuple& Probability, const HTuple& Width, const HTuple& Height, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* RandomCrop )static void HOperatorSet.CreateDlTransformRandomCrop( HTuple transformName, HTuple probability, HTuple width, HTuple height, HTuple genParamName, HTuple genParamValue, out HTuple randomCrop )def create_dl_transform_random_crop( transform_name: str, probability: float, width: int, height: int, gen_param_name: Sequence[str], gen_param_value: Sequence[Union[str, float, int]] ) -> HHandle

Herror T_create_dl_transform_random_crop( const Htuple TransformName, const Htuple Probability, const Htuple Width, const Htuple Height, const Htuple GenParamName, const Htuple GenParamValue, Htuple* RandomCrop )

void HDlTransform::HDlTransform( const HString& TransformName, double Probability, Hlong Width, Hlong Height, const HTuple& GenParamName, const HTuple& GenParamValue )

void HDlTransform::HDlTransform( const char* TransformName, double Probability, Hlong Width, Hlong Height, const HTuple& GenParamName, const HTuple& GenParamValue )

void HDlTransform::HDlTransform( const wchar_t* TransformName, double Probability, Hlong Width, Hlong Height, const HTuple& GenParamName, const HTuple& GenParamValue ) (Windows only)

public HDlTransform( string transformName, double probability, int width, int height, HTuple genParamName, HTuple genParamValue )

void HDlTransform::CreateDlTransformRandomCrop( const HString& TransformName, double Probability, Hlong Width, Hlong Height, const HTuple& GenParamName, const HTuple& GenParamValue )

void HDlTransform::CreateDlTransformRandomCrop( const char* TransformName, double Probability, Hlong Width, Hlong Height, const HTuple& GenParamName, const HTuple& GenParamValue )

void HDlTransform::CreateDlTransformRandomCrop( const wchar_t* TransformName, double Probability, Hlong Width, Hlong Height, const HTuple& GenParamName, const HTuple& GenParamValue ) (Windows only)

void HDlTransform.CreateDlTransformRandomCrop( string transformName, double probability, int width, int height, HTuple genParamName, HTuple genParamValue )

Description🔗

The operator create_dl_transform_random_cropCreateDlTransformRandomCrop creates a random crop transform and returns the transform handle in RandomCroprandomCroprandom_crop. The transform creates a crop of size Widthwidthwidth x Heightheightheight at a random position on the input image.

The parameter TransformNametransformNametransform_name specifies a unique, non-empty name for the transform. Note that when creating a transform pipeline using create_dl_transform_pipelineCreateDlTransformPipeline, each transform within the pipeline must have a unique name.

The parameter Probabilityprobabilityprobability specifies the probability with which the transform is executed in the pipeline. The probability must be between 0.00.0 and 1.01.0. A value of 0.00.0 disables execution, while a value of 1.01.0 guarantees that the operation is executed.

The parameters Widthwidthwidth and Heightheightheight specify the dimensions of the crop.

No generic parameters GenParamNamegenParamNamegen_param_name and GenParamValuegenParamValuegen_param_value are supported for this transform. Only the value [][] can be set.

The following parameters are specific to the transforms of type 'random_crop'"random_crop". They can respectively be get or set using the operators get_dl_transform_pipeline_paramGetDlTransformPipelineParam and set_dl_transform_pipeline_paramSetDlTransformPipelineParam:

ParamName set get
'width'"width" x x
'height'"height" x x

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on internal data level.

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters🔗

TransformNametransformNametransform_name (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Name of the output transform.

Default: 'random_crop'"random_crop"

Probabilityprobabilityprobability (input_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)

Probability to execute the transform

Default: 1.01.0

Widthwidthwidth (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Crop width

Default: 6464

Heightheightheight (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Crop height

Default: 6464

GenParamNamegenParamNamegen_param_name (input_control) attribute.name-array → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

Generic input parameter names.

Default: [][]
List of values: [][]

GenParamValuegenParamValuegen_param_value (input_control) attribute.value-array → (string / real / integer)HTuple (HString / double / Hlong)HTuple (string / double / int / long)Sequence[Union[str, float, int]]Htuple (char* / double / Hlong)

Generic input parameter values.

Default: [][]
Suggested values: [][]

RandomCroprandomCroprandom_crop (output_control) dl_transform → (handle)HTuple (HHandle)HDlTransform, HTuple (IntPtr)HHandleHtuple (handle)

Random crop transform

Combinations with other operators🔗

Combinations

Possible successors

create_dl_transform_pipelineCreateDlTransformPipeline

See also

create_dl_transform_blurCreateDlTransformBlur, create_dl_transform_normalizeCreateDlTransformNormalize, create_dl_transform_random_hsvCreateDlTransformRandomHsv, create_dl_transform_resizeCreateDlTransformResize

Module🔗

Foundation