#!/bin/bash # Scene VLM Test Script # This script tests the Scene VLM functionality with a real video set -e echo "=== Scene VLM Test Script ===" # Configuration UUID="3677f81d232e59f13453d737ceb582cb" VIDEO_NAME="Gamma Carry Saves the World..mp4" OUTPUT_DIR="/Users/accusys/momentry/output" # Check if video is registered echo "1. Checking if video is registered..." if [ -f "$OUTPUT_DIR/$UUID.probe.json" ]; then echo " ✅ Video registered: $UUID" else echo " ❌ Video not registered: $UUID" exit 1 fi # Check if CUT data exists echo "2. Checking if CUT data exists..." if [ -f "$OUTPUT_DIR/$UUID.cut.json" ]; then echo " ✅ CUT data exists" cut_count=$(python3 -c "import json; data=json.load(open('$OUTPUT_DIR/$UUID.cut.json')); print(len(data.get('scenes', [])))") echo " Scenes: $cut_count" else echo " ❌ No CUT data" exit 1 fi # Check if scenes.json already exists echo "3. Checking if scenes.json already exists..." if [ -f "$OUTPUT_DIR/$UUID.scenes.json" ]; then echo " ⚠️ scenes.json already exists" echo " Do you want to re-generate? (y/n)" read -r answer if [ "$answer" != "y" ]; then echo " Skipping generation" exit 0 fi echo " Removing old scenes.json and frames..." rm -f "$OUTPUT_DIR/$UUID.scenes.json" rm -rf "$OUTPUT_DIR/$UUID/scenes" fi # Enable Scene VLM echo "4. Enabling Scene VLM..." export MOMENTRY_SCENE_VLM_ENABLED=true export MOMENTRY_SCENE_VLM_INTERVAL=10 export MOMENTRY_SCENE_VLM_SAMPLES=10 export MOMENTRY_SCENE_VLM_USE_CUTS=true export MOMENTRY_SCENE_VLM_MAX_WORKERS=10 echo " ✅ Scene VLM enabled" # Run processor (this would normally be done by worker) echo "5. Testing Scene VLM processor..." echo " (This would normally be done by worker automatically)" # Check if Rust binary exists if [ -f "target/debug/momentry" ]; then echo " Using debug binary..." BINARY="target/debug/momentry" elif [ -f "target/release/momentry" ]; then echo " Using release binary..." BINARY="target/release/momentry" else echo " ❌ No binary found, building..." cargo build --bin momentry BINARY="target/debug/momentry" fi echo "" echo "=== Test Complete ===" echo "" echo "To enable Scene VLM in production, set:" echo " export MOMENTRY_SCENE_VLM_ENABLED=true" echo "" echo "The worker will automatically run Scene VLM after CUT completes."