Browse Source

feat: 创建视频分类

pull/211/head
zhaowei 9 months ago
parent
commit
8a7c584f02
6 changed files with 332 additions and 6 deletions
  1. +2
    -2
      react-ui/src/pages/ActiveLearn/components/CreateForm/ExecuteConfig.tsx
  2. +6
    -1
      react-ui/src/pages/AutoML/Create/index.tsx
  3. +48
    -1
      react-ui/src/pages/AutoML/components/AutoMLBasic/index.tsx
  4. +2
    -2
      react-ui/src/pages/AutoML/components/CreateForm/TextExecuteConfig.tsx
  5. +260
    -0
      react-ui/src/pages/AutoML/components/CreateForm/VideoExecuteConfig.tsx
  6. +14
    -0
      react-ui/src/pages/AutoML/types.ts

+ 2
- 2
react-ui/src/pages/ActiveLearn/components/CreateForm/ExecuteConfig.tsx View File

@@ -251,11 +251,11 @@ function ExecuteConfig() {
rules={[
{
required: true,
message: '请输入epochs',
message: '请输入 epochs',
},
]}
>
<InputNumber placeholder="请输入epochs" min={0} precision={0} />
<InputNumber placeholder="请输入 epochs" min={0} precision={0} />
</Form.Item>
</Col>
</Row>


+ 6
- 1
react-ui/src/pages/AutoML/Create/index.tsx View File

@@ -18,6 +18,7 @@ import DatasetConfig from '../components/CreateForm/DatasetConfig';
import ExecuteConfig from '../components/CreateForm/ExecuteConfig';
import TextExecuteConfig from '../components/CreateForm/TextExecuteConfig';
import TrialConfig from '../components/CreateForm/TrialConfig';
import VideoExecuteConfig from '../components/CreateForm/VideoExecuteConfig';
import { AutoMLData, FormData } from '../types';
import styles from './index.less';

@@ -200,6 +201,8 @@ function CreateAutoML() {
test_size: 0.25,
train_size: 0.67,
seed: 1,
is_validate: false,
is_test: false,
}}
>
<BasicConfig />
@@ -212,7 +215,9 @@ function CreateAutoML() {
</>
) : type === AutoMLType.Text ? (
<TextExecuteConfig />
) : null}
) : (
<VideoExecuteConfig />
)}

<Form.Item wrapperCol={{ offset: 0, span: 16 }} style={{ marginTop: '40px' }}>
<Button type="primary" htmlType="submit">


+ 48
- 1
react-ui/src/pages/AutoML/components/AutoMLBasic/index.tsx View File

@@ -206,7 +206,54 @@ function AutoMLBasic({ info, className, runStatus, isInstance = false }: AutoMLB
},
];
} else {
return [];
return [
{
label: '数据集',
value: info.dataset,
format: formatDataset,
},
{
label: '类别数量',
value: info.num_classes,
},
{
label: 'batch_size',
value: info.batch_size,
},
{
label: 'epochs',
value: info.epochs,
},
{
label: '学习率',
value: info.lr,
},
{
label: '是否验证',
value: info.is_validate,
format: formatBoolean,
},
{
label: '训练集路径',
value: info.train_data_prefix,
},
{
label: '训练集标注文件',
value: info.train_file_path,
},
...(info.is_validate
? [
{
label: '验证集路径',
value: info.valid_data_prefix,
},
{
label: '验证集标注文件',
value: info.valid_file_path,
},
]
: []),
];
}
}, [info, getResourceDescription]);



+ 2
- 2
react-ui/src/pages/AutoML/components/CreateForm/TextExecuteConfig.tsx View File

@@ -105,11 +105,11 @@ function TextExecuteConfig() {
rules={[
{
required: true,
message: '请输入epochs',
message: '请输入 epochs',
},
]}
>
<InputNumber placeholder="请输入epochs" min={0} precision={0} />
<InputNumber placeholder="请输入 epochs" min={0} precision={0} />
</Form.Item>
</Col>
</Row>


+ 260
- 0
react-ui/src/pages/AutoML/components/CreateForm/VideoExecuteConfig.tsx View File

@@ -0,0 +1,260 @@
import ResourceSelect, {
ResourceSelectorType,
requiredValidator,
} from '@/components/ResourceSelect';
import SubAreaTitle from '@/components/SubAreaTitle';
import { Col, Form, Input, InputNumber, Row, Switch } from 'antd';

function VideoExecuteConfig() {
return (
<>
<SubAreaTitle
title="执行配置"
image={require('@/assets/img/model-deployment.png')}
style={{ marginTop: '20px', marginBottom: '24px' }}
></SubAreaTitle>

<Row gutter={8}>
<Col span={10}>
<Form.Item
label="数据集"
name="dataset"
rules={[
{
validator: requiredValidator,
message: '请选择数据集',
},
]}
required
>
<ResourceSelect
type={ResourceSelectorType.Dataset}
placeholder="请选择数据集"
canInput={false}
/>
</Form.Item>
</Col>
</Row>

<Row gutter={8}>
<Col span={10}>
<Form.Item
label="类别数量"
name="num_classes"
rules={[
{
required: true,
message: '请输入类别数量',
},
]}
>
<InputNumber placeholder="请输入类别数量" min={0} precision={0} />
</Form.Item>
</Col>
</Row>

<Row gutter={8}>
<Col span={10}>
<Form.Item
label="batch_size"
name="batch_size"
rules={[
{
required: true,
message: '请输入 batch_size',
},
]}
>
<InputNumber placeholder="请输入 batch_size" min={0} precision={0} />
</Form.Item>
</Col>
</Row>

<Row gutter={8}>
<Col span={10}>
<Form.Item
label="epochs"
name="epochs"
rules={[
{
required: true,
message: '请输入 epochs',
},
]}
>
<InputNumber placeholder="请输入 epochs" min={0} precision={0} />
</Form.Item>
</Col>
</Row>

<Row gutter={8}>
<Col span={10}>
<Form.Item
label="学习率"
name="lr"
rules={[
{
required: true,
message: '请输入学习率',
},
]}
>
<InputNumber placeholder="请输入学习率" min={0} />
</Form.Item>
</Col>
</Row>

<Row gutter={8}>
<Col span={10}>
<Form.Item label="是否验证" name="is_validate" valuePropName="checked">
<Switch />
</Form.Item>
</Col>
</Row>

{/* <Row gutter={8}>
<Col span={10}>
<Form.Item label="是否测试" name="is_test" valuePropName="checked">
<Switch />
</Form.Item>
</Col>
</Row> */}

<Row gutter={8}>
<Col span={10}>
<Form.Item
label="训练集路径"
name="train_data_prefix"
rules={[
{
required: true,
message: '请输入训练集路径',
},
]}
>
<Input placeholder="请输入训练集路径" maxLength={64} showCount allowClear />
</Form.Item>
</Col>
</Row>

<Row gutter={8}>
<Col span={10}>
<Form.Item
label="训练集标注文件"
name="train_file_path"
rules={[
{
required: true,
message: '请输入训练集标注文件',
},
]}
>
<Input placeholder="请输入训练集标注文件" maxLength={64} showCount allowClear />
</Form.Item>
</Col>
</Row>

<Form.Item dependencies={['is_validate']} noStyle>
{({ getFieldValue }) => {
const is_validate = getFieldValue('is_validate');
if (is_validate) {
return (
<>
<Row gutter={8}>
<Col span={10}>
<Form.Item
label="验证集路径"
name="valid_data_prefix"
rules={[
{
required: true,
message: '请输入验证集路径',
},
]}
>
<Input placeholder="请输入验证集路径" maxLength={64} showCount allowClear />
</Form.Item>
</Col>
</Row>

<Row gutter={8}>
<Col span={10}>
<Form.Item
label="验证集标注文件"
name="valid_file_path"
rules={[
{
required: true,
message: '请输入验证集标注文件',
},
]}
>
<Input
placeholder="请输入验证集标注文件"
maxLength={64}
showCount
allowClear
/>
</Form.Item>
</Col>
</Row>
</>
);
}
}}
</Form.Item>

{/* <Form.Item dependencies={['is_test']} noStyle>
{({ getFieldValue }) => {
const is_test = getFieldValue('is_test');
if (is_test) {
return (
<>
<Row gutter={8}>
<Col span={10}>
<Form.Item
label="测试集路径"
name="test_data_prefix"
rules={[
{
required: true,
message: '请输入测试集路径',
},
]}
>
<Input placeholder="请输入测试集路径" maxLength={64} showCount allowClear />
</Form.Item>
</Col>
</Row>

<Row gutter={8}>
<Col span={10}>
<Form.Item
label="测试集标注文件"
name="test_file_path"
rules={[
{
required: true,
message: '请输入测试集标注文件',
},
]}
>
<Input
placeholder="请输入测试集标注文件"
maxLength={64}
showCount
allowClear
/>
</Form.Item>
</Col>
</Row>
</>
);
}
}}
</Form.Item> */}
</>
);
}

export default VideoExecuteConfig;

+ 14
- 0
react-ui/src/pages/AutoML/types.ts View File

@@ -1,3 +1,11 @@
/*
* @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
* @Date: 2025-04-17 10:22:05
* @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
* @LastEditTime: 2025-04-27 11:43:19
* @FilePath: \ci4s\react-ui\src\pages\AutoML\types.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { type ParameterInputObject } from '@/components/ResourceSelect';
import { type NodeStatus } from '@/types';

@@ -43,6 +51,12 @@ export type FormData = {
batch_size?: number;
epochs?: number;
lr?: number;
num_classes?: number;
is_validate?: boolean;
train_data_prefix?: string;
valid_data_prefix?: string;
train_file_path?: string;
valid_file_path?: string;
};

export type AutoMLData = {


Loading…
Cancel
Save