All Products
Search
Document Center

Platform For AI:LVM-Image-Aspect-Ratio Filter (DLC)

Last Updated:Apr 01, 2026

The LVM-Image-Aspect-Ratio Filter (DLC) component removes images with extreme aspect ratios from your training dataset. Use it to enforce consistent image proportions before training image generation models.

Supported computing resources

Deep Learning Containers (DLC)

How it works

The component calculates the width-to-height ratio (W/H) for each image and filters out any image whose ratio falls outside the configured range. Images within the range are written to the output file; images outside the range are discarded. In most cases, the component is used for the subsequent training of image generation models.

Example: With Minimum Aspect Ratio set to 0.333 and Maximum Aspect Ratio set to 3.0:

ImageDimensionsAspect ratio (W/H)Result
img11920 x 10801.78Kept
img2100 x 10000.10Filtered out (too narrow)
img33200 x 4008.00Filtered out (too wide)

Inputs and outputs

Input

Connect one of the following upstream components:

  • Read File Data — reads the Object Storage Service (OSS) path where your training data is stored.

  • Image Data OSS Path — configure this parameter to select the OSS directory where the image data is stored or to select the image metadata file.

  • Any image data preprocessing component — the output of an upstream preprocessing step can feed directly into this filter.

Output

The filtering results are written to the OSS path specified in Output File OSS Path. The output consists of three files:

FileDescription
{name}.jsonlThe filtered output file. The filename is set by Output Filename.
{name}_stats.jsonlThe state file.
dj_run_yaml.yamlThe parameter configuration used during the run.

Parameters

Configure the component in Machine Learning Designer. The following table describes all parameters.

TabParameterRequiredDefaultDescription
Field SettingsImage Data OSS PathNoThe OSS directory containing your image data. On the first run without an upstream component, select this directory manually. The component generates a metadata file meta.jsonl in the parent directory of the path you specify. For subsequent runs, select meta.jsonl directly instead of the directory.
Field SettingsOutput File OSS PathYesThe OSS directory where filtering results are stored.
Field SettingsOutput FilenameYesresult.jsonlThe filename for the filtered output file.
Parameter SettingsMinimum Aspect Ratio (W/H)Yes0.333Images with an aspect ratio below this value are filtered out. The value 0.333 corresponds approximately to a 1:3 portrait ratio.
Parameter SettingsMaximum Aspect Ratio (W/H)Yes3.0Images with an aspect ratio above this value are filtered out. The value 3.0 corresponds to a 3:1 landscape ratio.
Execution TuningNumber of ProcessesYes4The number of parallel processes for the filtering job.
Execution TuningSelect Resource Group > Public Resource GroupNoThe instance type (CPU or GPU) and virtual private cloud (VPC) for the job. We recommend that you use the CPU instance type to save costs.
Execution TuningSelect Resource Group > Dedicated resource groupNoThe number of vCPUs, memory, shared memory, and GPUs for the job.
Execution TuningMaximum Running Duration (seconds)NoThe maximum time the component is allowed to run. The job is terminated if this limit is exceeded.