Skip to main content

ImageAnalysis

Struct ImageAnalysis 

Source
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

Source

pub fn new() -> ImageAnalysis

Construct an empty ImageAnalysis (all fields default).

Source

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.

Source

pub fn with_scene(self, val: impl Into<SmolStr>) -> ImageAnalysis

Builder-style setter for scene. Pass an empty string to clear.

Source

pub fn set_scene(&mut self, val: impl Into<SmolStr>) -> &mut ImageAnalysis

In-place setter for scene. Pass an empty string to clear.

Source

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).

Source

pub fn with_description(self, val: impl Into<SmolStr>) -> ImageAnalysis

Builder-style setter for description. Pass an empty string to clear.

Source

pub fn set_description(&mut self, val: impl Into<SmolStr>) -> &mut ImageAnalysis

In-place setter for description. Pass an empty string to clear.

Source

pub fn subjects(&self) -> &[SmolStr]

Distinct people or animals visible in the scene.

Source

pub fn with_subjects(self, val: Vec<SmolStr>) -> ImageAnalysis

Builder-style setter for subjects.

Source

pub fn set_subjects(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis

In-place setter for subjects.

Source

pub fn objects(&self) -> &[SmolStr]

Notable, search-relevant objects.

Source

pub fn with_objects(self, val: Vec<SmolStr>) -> ImageAnalysis

Builder-style setter for objects.

Source

pub fn set_objects(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis

In-place setter for objects.

Source

pub fn actions(&self) -> &[SmolStr]

Visible actions.

Source

pub fn with_actions(self, val: Vec<SmolStr>) -> ImageAnalysis

Builder-style setter for actions.

Source

pub fn set_actions(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis

In-place setter for actions.

Source

pub fn mood(&self) -> &[SmolStr]

Scene-level mood terms.

Source

pub fn with_mood(self, val: Vec<SmolStr>) -> ImageAnalysis

Builder-style setter for mood.

Source

pub fn set_mood(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis

In-place setter for mood.

Source

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.

Source

pub fn with_shot_type(self, val: impl Into<SmolStr>) -> ImageAnalysis

Builder-style setter for shot_type. Pass an empty string to clear.

Source

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.

Source

pub fn lighting(&self) -> &[SmolStr]

Lighting terms.

Source

pub fn with_lighting(self, val: Vec<SmolStr>) -> ImageAnalysis

Builder-style setter for lighting.

Source

pub fn set_lighting(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis

In-place setter for lighting.

Source

pub fn tags(&self) -> &[SmolStr]

8-12 short English search tags in lowercase.

Source

pub fn with_tags(self, val: Vec<SmolStr>) -> ImageAnalysis

Builder-style setter for tags.

Source

pub fn set_tags(&mut self, val: Vec<SmolStr>) -> &mut ImageAnalysis

In-place setter for tags.

Trait Implementations§

Source§

impl Clone for ImageAnalysis

Source§

fn clone(&self) -> ImageAnalysis

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ImageAnalysis

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for ImageAnalysis

Source§

fn default() -> ImageAnalysis

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ImageAnalysis

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<ImageAnalysis, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ImageAnalysis

Source§

fn eq(&self, other: &ImageAnalysis) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ImageAnalysis

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for ImageAnalysis

Source§

impl StructuralPartialEq for ImageAnalysis

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,