Skip to main content

Module vision

Module vision 

Source
Expand description

Vision model captioning for images.

This module provides infrastructure for generating captions from images using vision models. With the vision feature enabled, a BLIP-based captioner is available. Otherwise, only a placeholder implementation exists.

Re-exportsยง

use async_trait::async_trait; ๐Ÿ”’
use std::path::PathBuf; ๐Ÿ”’
use std::sync::Arc; ๐Ÿ”’
use thiserror::Error; ๐Ÿ”’
use tokio::sync::RwLock; ๐Ÿ”’
use tracing::debug; ๐Ÿ”’
use candle_core::DType; ๐Ÿ”’
use candle_core::Device; ๐Ÿ”’
use candle_core::IndexOp; ๐Ÿ”’
use candle_core::Module; ๐Ÿ”’
use candle_core::Tensor; ๐Ÿ”’
use candle_nn::VarBuilder; ๐Ÿ”’
use candle_transformers::models::blip; ๐Ÿ”’
use hf_hub::Repo; ๐Ÿ”’
use hf_hub::RepoType; ๐Ÿ”’
use hf_hub::api::tokio::Api; ๐Ÿ”’
use tokenizers::Tokenizer; ๐Ÿ”’
use tracing::info; ๐Ÿ”’

Structsยง

BlipCaptioner
BLIP-based image captioner using Candle.
CaptionConfig
Configuration for vision captioning.
PlaceholderCaptioner
Placeholder vision captioner that returns no captions.

Enumsยง

CaptionError
Error type for vision captioning operations.

Constantsยง

BLIP_IMAGE_SIZE ๐Ÿ”’
Image size for BLIP preprocessing.
BLIP_MODEL_ID ๐Ÿ”’
BLIP model identifier on HuggingFace Hub.

Traitsยง

ImageCaptioner
Trait for vision-based image captioning.