diff --git a/components/pages/work-flow/media-viewer.tsx b/components/pages/work-flow/media-viewer.tsx index dd7a6d1..61b5392 100644 --- a/components/pages/work-flow/media-viewer.tsx +++ b/components/pages/work-flow/media-viewer.tsx @@ -352,7 +352,7 @@ export function MediaViewer({ handleEditClick('4', 'final')} + onClick={() => handleEditClick('3', 'final')} /> )} @@ -766,7 +766,7 @@ export function MediaViewer({ handleEditClick('2')} + onClick={() => handleEditClick('1')} /> )} diff --git a/components/ui/character-editor.tsx b/components/ui/character-editor.tsx index 9d57552..58689af 100644 --- a/components/ui/character-editor.tsx +++ b/components/ui/character-editor.tsx @@ -1,6 +1,6 @@ import React, { useState, useRef, useEffect, forwardRef } from "react"; import { motion } from "framer-motion"; -import { Sparkles, X, Plus, RefreshCw } from 'lucide-react'; +import { Sparkles, X, Plus, RefreshCw, Loader2 } from 'lucide-react'; import MainEditor from "./main-editor/MainEditor"; import { cn } from "@/public/lib/utils"; import { TextToShotAdapter } from "@/app/service/adapter/textToShot"; @@ -76,8 +76,8 @@ export const CharacterEditor = forwardRef(({ whileHover={{ scale: 1.05 }} whileTap={{ scale: 0.95 }} > - - {isOptimizing ? "优化中..." : "智能优化"} + {isOptimizing ? : } + {isOptimizing ? "Optimizing..." : "Optimization"} ); diff --git a/components/ui/edit-modal.tsx b/components/ui/edit-modal.tsx index 745cade..f13048f 100644 --- a/components/ui/edit-modal.tsx +++ b/components/ui/edit-modal.tsx @@ -34,7 +34,7 @@ interface EditModalProps { const tabs = [ { id: '0', label: 'Script', icon: FileText }, { id: '1', label: 'Character', icon: Users }, - { id: '2', label: 'Scene', icon: Image }, + // { id: '2', label: 'Scene', icon: Image }, { id: '3', label: 'Video', icon: Video }, { id: '4', label: 'Music', icon: Music }, // { id: '5', label: '剪辑', icon: Scissors }, diff --git a/components/ui/person-detection.tsx b/components/ui/person-detection.tsx index f1ef4fe..b2dcc04 100644 --- a/components/ui/person-detection.tsx +++ b/components/ui/person-detection.tsx @@ -109,6 +109,7 @@ export const PersonDetectionScene: React.FC = ({ // 处理外部失败状态 useEffect(() => { if (isScanFailed && scanStatus === 'scanning') { + console.log('roleRecognitionResponse---isScanFailed', isScanFailed); setScanStatus('failed'); } }, [isScanFailed, scanStatus]); @@ -268,12 +269,12 @@ export const PersonDetectionScene: React.FC = ({ >
{!isShowError ? ( - - 智能识别中 + + Intelligenting portrait recognition ) : ( - - {scanStatus === 'timeout' ? '识别超时,请重试' : '识别失败,请重试'} + + {scanStatus === 'timeout' ? 'Timeout, please try again' : 'Failed, please try again'} )}
@@ -379,7 +380,7 @@ export const PersonDetectionScene: React.FC = ({ {detections.length === 0 && triggerSuccess && (
- 未识别出人像 + No portrait detected
)} {detections.map((person, index) => { diff --git a/components/ui/replace-character-panel.tsx b/components/ui/replace-character-panel.tsx index bad1b0d..976f5c7 100644 --- a/components/ui/replace-character-panel.tsx +++ b/components/ui/replace-character-panel.tsx @@ -52,11 +52,11 @@ export function ReplaceCharacterPanel({ return ( -
+
- 该内容出现在 {shots.length} 个分镜中,替换后将影响如下分镜 + This role appears in {shots.length} shots, replacing it will affect the following shots.
{/*
-
生成中...
+
Generating...
)} @@ -235,13 +235,13 @@ export function ReplacePanel({ onClick={onClose} className="px-4 py-2 rounded-lg bg-white/10 text-white hover:bg-white/20 transition-colors" > - 取消 + Cancel
diff --git a/components/ui/shot-tab-content.tsx b/components/ui/shot-tab-content.tsx index bc8d199..a8a3f91 100644 --- a/components/ui/shot-tab-content.tsx +++ b/components/ui/shot-tab-content.tsx @@ -70,18 +70,22 @@ export function ShotTabContent({ } setScanState('scanning'); const containerElement = document.getElementById('person-detection-video') as HTMLVideoElement; - const roleRecognitionResponse = await filterRole(containerElement); - console.log('roleRecognitionResponse', roleRecognitionResponse); - if (roleRecognitionResponse && roleRecognitionResponse.recognition_result.code === 200) { - const recognitionBoxes = calculateRecognitionBoxes(containerElement, roleRecognitionResponse.recognition_result.data.matched_persons); - console.log('recognitionBoxes', recognitionBoxes); - setDetections(recognitionBoxes.map((person: any) => ({ - id: person.person_id, - name: person.person_id, - position: { top: person.top, left: person.left, width: person.width, height: person.height } - }))); + try { + const roleRecognitionResponse = await filterRole(containerElement); + console.log('roleRecognitionResponse', roleRecognitionResponse); + if (roleRecognitionResponse && roleRecognitionResponse.recognition_result.code === 200) { + const recognitionBoxes = calculateRecognitionBoxes(containerElement, roleRecognitionResponse.recognition_result.data.matched_persons); + console.log('recognitionBoxes', recognitionBoxes); + setDetections(recognitionBoxes.map((person: any) => ({ + id: person.person_id, + name: person.person_id, + position: { top: person.top, left: person.left, width: person.width, height: person.height } + }))); + } else { + setIsScanFailed(true); + } setScanState('detected'); - } else { + } catch (error) { setIsScanFailed(true); } };