pub struct CaptioningModel { /* private fields */ }Expand description
Image captioning model
Implementations§
Source§impl CaptioningModel
impl CaptioningModel
Sourcepub fn new(model_path: &str) -> RragResult<Self>
pub fn new(model_path: &str) -> RragResult<Self>
Create new captioning model
Sourcepub fn generate_caption(&self, image: &PreprocessedImage) -> RragResult<String>
pub fn generate_caption(&self, image: &PreprocessedImage) -> RragResult<String>
Generate caption for image
Sourcepub fn generate_captions_with_scores(
&self,
image: &PreprocessedImage,
) -> RragResult<Vec<(String, f32)>>
pub fn generate_captions_with_scores( &self, image: &PreprocessedImage, ) -> RragResult<Vec<(String, f32)>>
Generate multiple captions with scores
Auto Trait Implementations§
impl Freeze for CaptioningModel
impl RefUnwindSafe for CaptioningModel
impl Send for CaptioningModel
impl Sync for CaptioningModel
impl Unpin for CaptioningModel
impl UnwindSafe for CaptioningModel
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
Mutably borrows from an owned value. Read more