mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-06-06 08:00:13 +08:00
feat(background): add face recognition functionality- Implement face recognition task type and processing
This commit is contained in:
@@ -188,6 +188,29 @@ const ConfigTabs: React.FC<ConfigTabsProps> = ({
|
||||
</div>
|
||||
</ConfigSection>
|
||||
</TabPane>
|
||||
<TabPane tab="人脸识别" key="facerecognition">
|
||||
<ConfigSection
|
||||
title="人脸识别服务配置"
|
||||
icon={<ApiOutlined />}
|
||||
description="配置人脸识别API服务的基本参数"
|
||||
isMobile={isMobile}
|
||||
>
|
||||
<Form form={formsMap.FaceRecognition} layout="vertical" size={isMobile ? "middle" : "large"}>
|
||||
{renderConfigFormItems(formsMap.FaceRecognition, "FaceRecognition", ['ApiEndpoint', 'ApiKey'])}
|
||||
<Divider style={{ margin: '12px 0 20px' }} />
|
||||
<Form.Item style={{ marginBottom: 0, textAlign: 'center' }}>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<SaveOutlined />}
|
||||
onClick={() => onSaveAllForGroup(formsMap.FaceRecognition, "FaceRecognition", ['ApiEndpoint', 'ApiKey'])}
|
||||
style={{ width: isMobile ? '100%' : '240px' }}
|
||||
>
|
||||
保存所有人脸识别配置
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</ConfigSection>
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
)
|
||||
},
|
||||
|
||||
@@ -28,6 +28,10 @@ const allDescriptions: Record<string, Record<string, string>> = {
|
||||
TagGenerationPrompt: '用于从图片内容生成标签的提示词。请确保提示词包含返回JSON格式的指示,并且要求返回tags数组字段。',
|
||||
TagMatchingPrompt: '用于将描述内容与已有标签进行匹配的提示词。请确保提示词包含{\'{tagsText}\'}和{\'{description}\'}占位符,系统将会用实际的标签列表和描述内容替换这些占位符。'
|
||||
},
|
||||
FaceRecognition: {
|
||||
ApiEndpoint: '人脸识别服务的API端点地址',
|
||||
ApiKey: '人脸识别服务的API密钥'
|
||||
},
|
||||
Jwt: {
|
||||
SecretKey: 'JWT 加密密钥',
|
||||
Issuer: 'JWT 签发者',
|
||||
@@ -75,9 +79,11 @@ const System: React.FC = () => {
|
||||
const [authForm] = Form.useForm();
|
||||
const [appSettingsForm] = Form.useForm();
|
||||
const [uploadForm] = Form.useForm();
|
||||
const [faceRecognitionForm] = Form.useForm();
|
||||
|
||||
const formsMap: Record<string, any> = {
|
||||
AI: aiForm,
|
||||
FaceRecognition: faceRecognitionForm,
|
||||
Jwt: jwtForm,
|
||||
Authentication: authForm,
|
||||
AppSettings: appSettingsForm,
|
||||
|
||||
@@ -13,7 +13,8 @@ const { Title, Text } = Typography;
|
||||
// 定义任务类型映射
|
||||
const taskTypeDisplayMapping: { [key: number]: string } = {
|
||||
0: '图片处理',
|
||||
1: '视觉识别', // 新增视觉识别任务类型
|
||||
1: '视觉识别',
|
||||
2: '人脸识别', // 新增人脸识别任务类型
|
||||
};
|
||||
|
||||
const BackgroundTasks: React.FC = () => {
|
||||
@@ -127,7 +128,7 @@ const BackgroundTasks: React.FC = () => {
|
||||
dataIndex: 'taskName', // Changed dataIndex
|
||||
key: 'taskName',
|
||||
render: (text: string, record: TaskDetailsViewModel) => ( // Updated type and logic
|
||||
(record.taskType === 0 || record.taskType === 1) && record.relatedEntityId // 检查是否为图片处理或视觉识别任务
|
||||
(record.taskType === 0 || record.taskType === 1 || record.taskType === 2) && record.relatedEntityId // 检查是否为图片处理、视觉识别或人脸识别任务
|
||||
? <Link to={`/pictures/${record.relatedEntityId}`}>{text}</Link>
|
||||
: text
|
||||
),
|
||||
@@ -155,6 +156,7 @@ const BackgroundTasks: React.FC = () => {
|
||||
filters: [ // 可以为任务类型添加筛选器
|
||||
{ text: '图片处理', value: 0 },
|
||||
{ text: '视觉识别', value: 1 },
|
||||
{ text: '人脸识别', value: 2 }, // 新增人脸识别筛选器
|
||||
],
|
||||
onFilter: (value, record: TaskDetailsViewModel) => record.taskType === (value as number),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user