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ยง
- Blip
Captioner - BLIP-based image captioner using Candle.
- Caption
Config - Configuration for vision captioning.
- Placeholder
Captioner - Placeholder vision captioner that returns no captions.
Enumsยง
- Caption
Error - 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ยง
- Image
Captioner - Trait for vision-based image captioning.