Lfm3ImageProcessor class final

Processes packed RGB uint8 pixels. Decoding JPEG/PNG and applying EXIF orientation are the caller's responsibility. This lab API supports the official processor's RGB, antialiased bicubic and normalization settings.

Constructors

Lfm3ImageProcessor({int patchSize = 16, int mergeSize = 2, int temporalPatchSize = 2, int minPixels = 65536, int maxPixels = 16777216})
Lfm3ImageProcessor.fromJson(Map<String, Object?> json)
factory
Lfm3ImageProcessor.load(String modelDir)
factory

Properties

factor → int
no setter
hashCode → int
The hash code for this object.
no setterinherited
maxImageTokens → int
The pixel budget in merged image tokens, each factor x factor.
no setter
maxPixels → int
final
mergeSize → int
final
minPixels → int
final
patchSize → int
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
temporalPatchSize → int
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepareRgb(Uint8List rgb, {required int height, required int width}) → VisionImageInput
resizedSize(int height, int width) → (int, int)
Upstream rounds ties to even before checking the pixel budget. The budget is an area, despite the config's shortest_edge/longest_edge names.
toString() → String
A string representation of this object.
inherited
withMaxImageTokens(int tokens) → Lfm3ImageProcessor
This processor with its pixel budget lowered to tokens merged image tokens, or this processor if its budget is no larger. The resize rule is unchanged: the result is upstream's with a smaller longest_edge. As there, a side that would shrink below factor is kept at factor, so a very elongated image can still exceed tokens.

Operators

operator ==(Object other) → bool
The equality operator.
inherited