LVM-Image-Shape Filter (DLC)

更新时间:
复制 MD 格式

The LVM-Image-Shape Filter (DLC) component filters images by resolution, discarding any image whose width or height falls outside the specified pixel range. Use this component to clean training data before running image generation model training jobs.

Supported computing resources

Deep Learning Containers (DLC)

How it works

The component reads image data from Object Storage Service (OSS), calculates the width and height of each image in pixels, and removes any image whose dimensions fall outside the configured minimum-maximum range. Images that pass all threshold checks are written to the output path as a filtered dataset. In most cases, the component is used for the subsequent training of image generation models.

The component generates an image metadata file (meta.jsonl) in the parent directory of the path you specify in Image Data OSS Path. On subsequent runs, point directly to this file instead of the original directory to skip re-scanning the source data.

Inputs and outputs

Input ports

Use one of the following as the upstream input:

  • Read File Data — reads the OSS path where your training data is stored.

  • Image Data OSS Path — specify the OSS directory containing your images, or point directly to a previously generated meta.jsonl metadata file.

  • Any image data preprocessing component.

Output port

The filtered dataset. The output path contains three files:

File

Description

{name}.jsonl

The filtered output file. The filename is set by the Output Filename parameter (default: result.jsonl).

{name}_stats.jsonl

The state file.

dj_run_yaml.yaml

The parameter configuration snapshot used when the algorithm ran.

Configure the component

Configure the LVM-Image-Shape Filter (DLC) component in Machine Learning Designer. The following table describes all parameters.

Tab

Parameter

Required

Default

Description

Field Settings

Image Data OSS Path

No

The OSS directory containing your image data, or the path to a previously generated meta.jsonl file. On the first run (when no upstream component exists), specify the directory manually. The component writes meta.jsonl to the parent directory of this path.

Field Settings

OSS Directory for Saving OutputData

No

The OSS directory where the filtering results are stored.

Field Settings

Output Filename

No

result.jsonl

The filename of the output file (without the _stats suffix).

Parameter Settings

Minimum Width

Yes

1

The minimum image width, in pixels. Images narrower than this value are filtered out.

Parameter Settings

Maximum Width

Yes

2048

The maximum image width, in pixels. Images wider than this value are filtered out.

Parameter Settings

Minimum Height

Yes

1

The minimum image height, in pixels. Images shorter than this value are filtered out.

Parameter Settings

Maximum Height

Yes

2048

The maximum image height, in pixels. Images taller than this value are filtered out.

Execution Tuning

Number of Processes

No

4

The number of parallel processes to use during filtering.

Single-node/Multi-node

No

single-node

Single-node or multi-node mode. Default value: single-node. Multi-node mode supports only the Ray framework.

Select Resource Group

No

Select a public resource group or a resource quota (if distributed mode is used, you must set resource parameters for the head and worker nodes separately):

  • Public resource group: We recommend that you use the CPU instance type to save costs.

  • Resource quota: select the number of GPUs, number of vCPUs, memory (GB), and shared memory (GB).

Maximum Running Duration (seconds)

No

The time limit for the job, in seconds. The job is terminated if it exceeds this limit.