feat: add Vision LLM integration (CLIP + Qwen3-VL cascade)

- Add Qwen3-VL dynamic management (start/stop/status CLI)
- Add CLIP + Qwen3-VL cascade detection strategy
- Add Vision CLI commands (vision start/stop/status, detect)
- Add cascade_vision processor module
- Add clip processor module
- Add qwen_vl_manager module

Changes:
- scripts/start_qwen3vl.sh, stop_qwen3vl.sh: Qwen3-VL management scripts
- src/core/vision/: Qwen3-VL manager module
- src/core/processor/cascade_vision.rs: CLIP + Qwen3-VL cascade logic
- src/core/processor/clip.rs: CLIP classification and detection
- src/api/clip_api.rs: CLIP API endpoints
- src/cli/vision.rs: Vision CLI implementation
- src/cli/args.rs: Add Vision and Detect commands
- src/main.rs: Integrate Vision CLI
- src/core/mod.rs: Add vision module
- src/core/processor/mod.rs: Add cascade_vision module
This commit is contained in:
Accusys
2026-06-13 16:25:52 +08:00
parent 834b0d4865
commit 17e4e15860
37 changed files with 2185 additions and 294 deletions
+12 -11
View File
@@ -1,7 +1,5 @@
use anyhow::{Context, Result};
use momentry_core::{
Database, Embedder, PostgresDb, QdrantDb, VectorPayload,
};
use momentry_core::{Database, Embedder, PostgresDb, QdrantDb, VectorPayload};
use std::time::{Duration, Instant};
#[tokio::main]
@@ -9,16 +7,17 @@ async fn main() -> Result<()> {
dotenv::from_filename("/Users/accusys/momentry_core_0.1/.env.development").ok();
tracing_subscriber::fmt::init();
let pg = PostgresDb::init().await.context("Failed to init PostgreSQL")?;
let pg = PostgresDb::init()
.await
.context("Failed to init PostgreSQL")?;
let qdrant = QdrantDb::new();
let embedder = Embedder::new("embeddinggemma-300m".to_string());
let uuid = "63acd3bb02b5b9dfbb9d6db499fcc864";
let chunk_table = momentry_core::core::db::schema::table_name("chunk");
let rows = sqlx::query_as::<_, (String, String, i64, i64, f64, f64, String)>(
&format!(
"SELECT chunk_id, text_content, start_frame, end_frame, \
let rows = sqlx::query_as::<_, (String, String, i64, i64, f64, f64, String)>(&format!(
"SELECT chunk_id, text_content, start_frame, end_frame, \
start_time, end_time, content::text \
FROM {} \
WHERE file_uuid = $1 \
@@ -26,15 +25,17 @@ async fn main() -> Result<()> {
AND embedding IS NULL \
AND (text_content IS NOT NULL AND text_content != '') \
ORDER BY id",
chunk_table
),
)
chunk_table
))
.bind(uuid)
.fetch_all(pg.pool())
.await?;
let total = rows.len();
println!("Found {} sentence chunks without embedding for {}", total, uuid);
println!(
"Found {} sentence chunks without embedding for {}",
total, uuid
);
if total == 0 {
println!("Nothing to vectorize. Exiting.");