pub struct ImageAnalysis { /* private fields */ }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 new() -> ImageAnalysis
pub fn new() -> ImageAnalysis
Construct an empty ImageAnalysis (all fields default).
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>) -> ImageAnalysis
pub fn with_scene(self, val: impl Into<SmolStr>) -> ImageAnalysis
Builder-style setter for scene. Pass an empty string to clear.
Sourcepub fn set_scene(&mut self, val: impl Into<SmolStr>) -> &mut ImageAnalysis
pub fn set_scene(&mut self, val: impl Into<SmolStr>) -> &mut ImageAnalysis
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>) -> ImageAnalysis
pub fn with_description(self, val: impl Into<SmolStr>) -> ImageAnalysis
Builder-style setter for description. Pass an empty string to clear.
Sourcepub fn set_description(&mut self, val: impl Into<SmolStr>) -> &mut ImageAnalysis
pub fn set_description(&mut self, val: impl Into<SmolStr>) -> &mut ImageAnalysis
In-place setter for description. Pass an empty string to clear.
Sourcepub fn with_subjects(self, val: Vec<SmolStr>) -> ImageAnalysis
pub fn with_subjects(self, val: Vec<SmolStr>) -> ImageAnalysis
Builder-style setter for subjects.
Sourcepub fn set_subjects(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis
pub fn set_subjects(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis
In-place setter for subjects.
Sourcepub fn with_objects(self, val: Vec<SmolStr>) -> ImageAnalysis
pub fn with_objects(self, val: Vec<SmolStr>) -> ImageAnalysis
Builder-style setter for objects.
Sourcepub fn set_objects(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis
pub fn set_objects(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis
In-place setter for objects.
Sourcepub fn with_actions(self, val: Vec<SmolStr>) -> ImageAnalysis
pub fn with_actions(self, val: Vec<SmolStr>) -> ImageAnalysis
Builder-style setter for actions.
Sourcepub fn set_actions(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis
pub fn set_actions(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis
In-place setter for actions.
Sourcepub fn with_mood(self, val: Vec<SmolStr>) -> ImageAnalysis
pub fn with_mood(self, val: Vec<SmolStr>) -> ImageAnalysis
Builder-style setter for mood.
Sourcepub fn set_mood(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis
pub fn set_mood(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis
In-place setter for mood.
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>) -> ImageAnalysis
pub fn with_shot_type(self, val: impl Into<SmolStr>) -> ImageAnalysis
Builder-style setter for shot_type. Pass an empty string to clear.
Sourcepub fn set_shot_type(&mut self, val: impl Into<SmolStr>) -> &mut ImageAnalysis
pub fn set_shot_type(&mut self, val: impl Into<SmolStr>) -> &mut ImageAnalysis
In-place setter for shot_type. Pass an empty string to clear.
Sourcepub fn with_lighting(self, val: Vec<SmolStr>) -> ImageAnalysis
pub fn with_lighting(self, val: Vec<SmolStr>) -> ImageAnalysis
Builder-style setter for lighting.
Sourcepub fn set_lighting(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis
pub fn set_lighting(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis
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<'de> Deserialize<'de> for ImageAnalysis
impl<'de> Deserialize<'de> for ImageAnalysis
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ImageAnalysis, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ImageAnalysis, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
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 ==.Source§impl Serialize for ImageAnalysis
impl Serialize for ImageAnalysis
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for ImageAnalysis
impl StructuralPartialEq for ImageAnalysis
Auto Trait Implementations§
impl Freeze for ImageAnalysis
impl RefUnwindSafe for ImageAnalysis
impl Send for ImageAnalysis
impl Sync for ImageAnalysis
impl Unpin for ImageAnalysis
impl UnsafeUnpin for ImageAnalysis
impl UnwindSafe for ImageAnalysis
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more