use anyhow::Result; use momentry_core::ui::progress::{ProcessorType, ProgressState, ProgressUi}; use momentry_core::OutputDir; use std::path::Path; use std::sync::{Arc, Mutex}; pub async fn process_appearance_module( appearance_path: &Path, video_path: &str, pose_path: &str, uuid: &str, progress_state: &Arc>, ui: &Arc>>, ) -> Result<()> { { let mut state = progress_state.lock().unwrap(); state.get_processor(ProcessorType::Appearance).start(1); } let appearance_result = momentry_core::core::processor::process_appearance( video_path, pose_path, appearance_path.to_str().unwrap(), Some(uuid), None, ) .await?; let appearance_json = serde_json::to_string_pretty(&appearance_result)?; std::fs::write(appearance_path, &appearance_json)?; let output_dir = OutputDir::new(); let _ = output_dir.backup_file(uuid, "appearance.json"); println!( " ✓ Appearance saved: {} frames", appearance_result.frame_count ); { let mut state = progress_state.lock().unwrap(); state .get_processor(ProcessorType::Appearance) .complete(&format!("{} frames", appearance_result.frame_count)); state.stop(); } if let Some(ref mut ui) = *ui.lock().unwrap() { let _ = ui.render(); } Ok(()) }