CameraConfiguration class

Configuration for a live camera scan session.

Reuses ScanMode and ModelIds from the library-scan API so the same models (classification + NudeNet detection) work in camera mode.

Annotations

Constructors

CameraConfiguration({String modelId = ModelIds.openNsfw2, double confidenceThreshold = 0.7, ScanMode mode = ScanMode.classification, int fps = 2, CameraResolution resolution = CameraResolution.medium, double detectionConfidenceThreshold = 0.25, double iouThreshold = 0.45, IosComputeUnits iosComputeUnits = IosComputeUnits.all, AndroidDelegate? androidDelegate})
const

Properties

androidDelegate AndroidDelegate?
Android TFLite delegate.
final
confidenceThreshold double
NSFW confidence threshold used for CameraFrameResult.isNsfw.
final
detectionConfidenceThreshold double
Per-box confidence threshold for NudeNet detector. Only relevant when mode is ScanMode.detection.
final
fps int
Target frames-per-second for inference. Frames are dropped to keep the rate at or below this value. Range: 1–30. Default: 2.
final
hashCode int
The hash code for this object.
no setteroverride
iosComputeUnits IosComputeUnits
iOS Core ML compute units.
final
iouThreshold double
Non-maximum suppression IoU threshold for NudeNet detector. Only relevant when mode is ScanMode.detection.
final
mode ScanMode
Classification vs detection mode. Detection mode populates CameraFrameResult.detections.
final
modelId String
Model to run per frame. Default: ModelIds.openNsfw2.
final
resolution CameraResolution
Camera capture resolution preset. Maps to native capture session preset / camera resolution. Default: CameraResolution.medium.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({String? modelId, double? confidenceThreshold, ScanMode? mode, int? fps, CameraResolution? resolution, double? detectionConfidenceThreshold, double? iouThreshold, IosComputeUnits? iosComputeUnits, AndroidDelegate? androidDelegate}) CameraConfiguration
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toChannelMap() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override