nemo_curator.stages.interleaved.filter.qrcode_filter

View as Markdown

Module Contents

Classes

NameDescription
InterleavedQRCodeFilterStageFilter interleaved image rows by QR code area ratio; drop images with high QR coverage.

Functions

NameDescription
_qr_code_ratioReturn the ratio of image area covered by all detected QR code(s), in [0, 1].

Data

DEFAULT_QRCODE_SCORE_THRESHOLD

API

class nemo_curator.stages.interleaved.filter.qrcode_filter.InterleavedQRCodeFilterStage(
name: str = 'interleaved_qrcode_filter',
drop_invalid_rows: bool = True,
score_threshold: float = DEFAULT_QRCODE_SCORE_THRESHOLD
)
Dataclass

Bases: BaseInterleavedFilterStage

Filter interleaved image rows by QR code area ratio; drop images with high QR coverage.

name
str = 'interleaved_qrcode_filter'
score_threshold
float = DEFAULT_QRCODE_SCORE_THRESHOLD
nemo_curator.stages.interleaved.filter.qrcode_filter.InterleavedQRCodeFilterStage.content_keep_mask(
task: nemo_curator.tasks.InterleavedBatch,
df: pandas.DataFrame
) -> pandas.Series
nemo_curator.stages.interleaved.filter.qrcode_filter._qr_code_ratio(
image: numpy.ndarray,
row_index: collections.abc.Hashable | None = None
) -> float

Return the ratio of image area covered by all detected QR code(s), in [0, 1].

nemo_curator.stages.interleaved.filter.qrcode_filter.DEFAULT_QRCODE_SCORE_THRESHOLD: float = 0.05