pub struct ImageAnalysis { /* private fields */ }std or alloc only.Expand description
Structured single-image VLM output. Construct via an engine’s
ImageAnalysisTask::parse (the Task::parse impl) or, for
tests/builders, ImageAnalysis::new
followed by with_* chains. All fields are private; the accessor
surface follows the rest of the crate’s scenesdetect-style getter /
with_* / set_* convention.
Detection-array fields (subjects / objects / actions / mood /
lighting) are Vec<SmolStr> — flat label lists, no per-detection
confidence. Wrapping each label in a Detection { label, confidence }
would require a confidence source the VLM can’t reliably provide —
VLM self-reported confidence is poorly calibrated, and a hardcoded
placeholder is a no-op for both UX and search-time ranking. If a
downstream consumer needs per-detection scoring, the practical
sources are search-time embedding similarity or scene-aggregation
metrics, not VLM self-report.
Implementations§
Source§impl ImageAnalysis
impl ImageAnalysis
Sourcepub fn scene(&self) -> &str
pub fn scene(&self) -> &str
Short scene category (e.g. "office", "airport arrivals hall").
Returns the empty string when the model didn’t classify the scene
(SCENE_PROMPT instructs the model to use empty strings for unknown
fields). Check scene().is_empty() to test for absence.
Sourcepub fn with_scene(self, val: impl Into<SmolStr>) -> Self
pub fn with_scene(self, val: impl Into<SmolStr>) -> Self
Builder-style setter for scene. Pass an empty string to clear.
Sourcepub fn set_scene(&mut self, val: impl Into<SmolStr>) -> &mut Self
pub fn set_scene(&mut self, val: impl Into<SmolStr>) -> &mut Self
In-place setter for scene. Pass an empty string to clear.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
1-2 sentence free-form scene description, or empty when the model produced no description (e.g., on a low-information frame).
Sourcepub fn with_description(self, val: impl Into<SmolStr>) -> Self
pub fn with_description(self, val: impl Into<SmolStr>) -> Self
Builder-style setter for description. Pass an empty string to clear.
Sourcepub fn set_description(&mut self, val: impl Into<SmolStr>) -> &mut Self
pub fn set_description(&mut self, val: impl Into<SmolStr>) -> &mut Self
In-place setter for description. Pass an empty string to clear.
Sourcepub fn with_subjects(self, val: Vec<SmolStr>) -> Self
pub fn with_subjects(self, val: Vec<SmolStr>) -> Self
Builder-style setter for subjects.
Sourcepub fn set_subjects(&mut self, val: Vec<SmolStr>) -> &mut Self
pub fn set_subjects(&mut self, val: Vec<SmolStr>) -> &mut Self
In-place setter for subjects.
Sourcepub fn with_objects(self, val: Vec<SmolStr>) -> Self
pub fn with_objects(self, val: Vec<SmolStr>) -> Self
Builder-style setter for objects.
Sourcepub fn set_objects(&mut self, val: Vec<SmolStr>) -> &mut Self
pub fn set_objects(&mut self, val: Vec<SmolStr>) -> &mut Self
In-place setter for objects.
Sourcepub fn with_actions(self, val: Vec<SmolStr>) -> Self
pub fn with_actions(self, val: Vec<SmolStr>) -> Self
Builder-style setter for actions.
Sourcepub fn set_actions(&mut self, val: Vec<SmolStr>) -> &mut Self
pub fn set_actions(&mut self, val: Vec<SmolStr>) -> &mut Self
In-place setter for actions.
Sourcepub fn shot_type(&self) -> &str
pub fn shot_type(&self) -> &str
One short camera-shot label (e.g. "wide shot", "close-up"),
or empty when the model didn’t pick one.
Sourcepub fn with_shot_type(self, val: impl Into<SmolStr>) -> Self
pub fn with_shot_type(self, val: impl Into<SmolStr>) -> Self
Builder-style setter for shot_type. Pass an empty string to clear.
Sourcepub fn set_shot_type(&mut self, val: impl Into<SmolStr>) -> &mut Self
pub fn set_shot_type(&mut self, val: impl Into<SmolStr>) -> &mut Self
In-place setter for shot_type. Pass an empty string to clear.
Sourcepub fn with_lighting(self, val: Vec<SmolStr>) -> Self
pub fn with_lighting(self, val: Vec<SmolStr>) -> Self
Builder-style setter for lighting.
Sourcepub fn set_lighting(&mut self, val: Vec<SmolStr>) -> &mut Self
pub fn set_lighting(&mut self, val: Vec<SmolStr>) -> &mut Self
In-place setter for lighting.
8-12 short English search tags in lowercase.
Builder-style setter for tags.
In-place setter for tags.
Trait Implementations§
Source§impl Clone for ImageAnalysis
impl Clone for ImageAnalysis
Source§fn clone(&self) -> ImageAnalysis
fn clone(&self) -> ImageAnalysis
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ImageAnalysis
impl Debug for ImageAnalysis
Source§impl Default for ImageAnalysis
impl Default for ImageAnalysis
Source§fn default() -> ImageAnalysis
fn default() -> ImageAnalysis
Source§impl PartialEq for ImageAnalysis
impl PartialEq for ImageAnalysis
Source§fn eq(&self, other: &ImageAnalysis) -> bool
fn eq(&self, other: &ImageAnalysis) -> bool
self and other values to be equal, and is used by ==.