-- app_model_main:模型主信息表
CREATE TABLE `app_model_main` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '模型名称',
  `mark` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '模型标识',
  `del_flag` int NOT NULL DEFAULT '0' COMMENT '删除标记',
  `create_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_id` int NOT NULL COMMENT '创建人ID',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `update_id` int DEFAULT NULL COMMENT '更新人ID',
  `dept_id` int DEFAULT NULL COMMENT '部门ID,用于数据权限',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='模型主信息表';


-- 添加version_num字段
ALTER TABLE`app_model_main` 
ADD COLUMN `version_num` int NOT NULL COMMENT '版本数量' AFTER `name`;


-- app_model: 新增字段   version basedOnVersion modelMainId

ALTER TABLE `app_model` 
ADD COLUMN `version` varchar(255) NULL COMMENT '版本' AFTER `remark`,
ADD COLUMN `based_on_version` varchar(255) NULL COMMENT '所基于版本' AFTER `version`,
ADD COLUMN `model_main_id` int NULL COMMENT '主模型ID' AFTER `based_on_version`;


ALTER TABLE `app_model` 
ADD COLUMN `version_create_rule` integer NULL DEFAULT 1 COMMENT '规则生成规则:1:主版本号 2:次版本号' AFTER `model_main_id`;

ALTER TABLE `app_model` 
ADD COLUMN `training_set_type` integer NULL DEFAULT 1 COMMENT '训练素材:1:当前训练集 2:新增数据集 3:基于当前模型 4:新增训练集' AFTER `version_create_rule`;

火焰:/usr/local/server/aicsp/uploadPath/ffmpeg/video/2023/08/23/630c661e-7dec-4917-b186-3aaae88cea44.mp4

nohup ffmpeg -re -stream_loop -1 -i /usr/local/server/aicsp/uploadPath/ffmpeg/video/2023/08/23/630c661e-7dec-4917-b186-3aaae88cea44.mp4 -c copy -f flv rtmp://192.168.1.20:1985/online/fire &

ffmpeg -f dshow -i video=“USB2.0 VGA UVC WebCam” -vcodec libx264 -acodec copy -preset:v ultrafast -tune:v zerolatency -f flv rtmp://39.97.214.170/live/livestream

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('确认参数,开始训练')"/>
    <th:block th:include="include :: bootstrap-fileinput-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-app_model-edit">
        <div class="form-group">
            <label class="col-sm-3 control-label"><h2>内存情况:</h2></label>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">内存使用情况:</label>
            <div class="col-sm-9">
                <textarea style="height: 100px;" name="label" th:text="${info}" class="form-control"
                          readonly></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><h2>高级配置:</h2></label>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">聚类训练迭代次数(30 ~ 50):</label>
            <div class="col-sm-3">
                <select name="clauculateK"
                        th:with="type=${@dict.getType('app_model_clauculate_k')}" class="form-control">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                            th:value="${dict.dictValue}"></option>
                </select>
            </div>
            <!--            <div class="col-sm-1">-->
            <!--                <input name="clauculateK" th:field="*{clauculateK}" class="form-control" type="text">-->
            <!--            </div>-->
            <label class="col-sm-3 control-label">迭代数据大小(1 ~ 128):</label>
            <div class="col-sm-3">
                <select name="batchSize" th:with="type=${@dict.getType('app_model_batch_size')}"
                        class="form-control">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                            th:value="${dict.dictValue}"></option>
                </select>
                <!--                <input name="batchSize" th:field="*{batchSize}" class="form-control" type="text">-->
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">模型训练轮数:</label>
            <div class="col-sm-3">
                <select name="epochs" th:with="type=${@dict.getType('app_model_epochs')}"
                        class="form-control">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                            th:value="${dict.dictValue}"></option>
                </select>
                <!--                <input name="epochs" th:field="*{epochs}" class="form-control" type="text">-->
            </div>
            <label class="col-sm-3 control-label">模型训练设备:</label>
            <div class="col-sm-3">
                <select id="trainDevice" name="trainDevice" class="form-control">
                    <option th:each="gpuInfo : ${gpuInfos}" th:text="${gpuInfo.name}"
                            th:value="${gpuInfo.id}"></option>
                </select>
                <!--                <input name="trainDevice" th:field="*{trainDevice}" class="form-control" type="text">-->
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">模型训练图片大小:</label>
            <div class="col-sm-3">
                <select name="imageSize" th:with="type=${@dict.getType('app_model_image_size')}"
                        class="form-control">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                            th:value="${dict.dictValue}"></option>
                </select>
                <!--                <input name="imageSize" th:field="*{imageSize}" class="form-control" type="text">-->
            </div>
            <div id="trainCreateVersion">
                <label class="col-sm-3 control-label">模型训练生成版本:</label>
                <div class="col-sm-3">
                    <select name="modelVersion" th:with="type=${@dict.getType('app_model_version')}" class="form-control">
                        <option value="0" selected >默认空版本</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}"></option>
                    </select>
                    <!--                <input name="modelVersion" th:field="*{modelVersion}" class="form-control" type="text">-->
                </div>
            </div>

        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">模型部署进程数:</label>
            <div class="col-sm-3">
                <select name="workers" th:with="type=${@dict.getType('app_model_workers')}"
                        class="form-control">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                            th:value="${dict.dictValue}"></option>
                </select>
                <!--                <input name="workers" th:field="*{workers}" class="form-control" type="text">-->
            </div>
            <label class="col-sm-3 control-label">模型部署设备:</label>
            <div class="col-sm-3">
                <select id="deployDevice" name="deployDevice" class="form-control">
                    <option th:each="gpuInfo : ${gpuInfos}" th:text="${gpuInfo.name}"
                            th:value="${gpuInfo.id}"></option>
                </select>
                <!--                <input name="deployDevice" th:field="*{deployDevice}" class="form-control" type="text">-->
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">训练基于版本:</label>
            <div class="col-sm-3">
                <select name="based_on_version" class="form-control" id="basedOnVersion">
                    <option selected="selected" value="-1">生成新版本</option>
                    <option th:each="appModelVersion : ${appModelVersions}" th:text="${appModelVersion.version}"
                            th:value="${appModelVersion.id}"></option>
                </select>
            </div>
            <label class="col-sm-3 control-label">版本号生成规则:</label>
            <div class="col-sm-3">
                <div class="radio check-box">
                    <label><input type="radio" value="1" name="version_create_rule"> <i></i> 更新主版本号</label>
                </div>
                <div class="radio check-box">
                    <label><input type="radio" value="2" name="version_create_rule"> <i></i> 更新次版本号</label>
                </div>
                <!--                <input name="deployDevice" th:field="*{deployDevice}" class="form-control" type="text">-->
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">训练集:</label>
            <div class="col-sm-3">
                <div class="radio check-box" id="currentDataSet">
                    <label><input type="radio" value="1" name="training_set_type"> <i></i> 当前训练集</label>
                </div>
                <div class="radio check-box" id="baseDataAdd">
                    <label><input type="radio" value="2" name="training_set_type"> <i></i> 基于数据集新增数据集</label>
                </div>
                <div class="radio check-box" id="addData">
                    <label><input type="radio" value="3" name="training_set_type"> <i></i> 新增数据集</label>
                </div>
            </div>
        </div>
        <div class="form-group" id="trainData">
            <label class="col-sm-3 control-label">上传数据集:</label>
            <div class="col-sm-3">
                <input name="path" class="form-control" type="hidden">
                <div class="file-loading">
                    <input class="form-control file-upload trainData" accept="*.zip" id="path" name="file" type="file">
                </div>
            </div>
        </div>


    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-fileinput-js"/>
<th:block th:include="include :: select2-js"/>
<script th:inline="javascript">
    var prefix = ctx + "pc/app_model";
    $("#form-app_model-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-app_model-edit').serialize());
        }
    }
    $(".file-upload").fileinput({
        uploadUrl: prefix + '/uploadImage',
        showClose: false, //是否显示关闭按钮
        dropZoneEnabled: false,//是否显示拖拽区域
        showPreview: false, //是否显示预览区域
        maxFileCount: 1,
        allowedFileExtensions: ['zip'],
        autoReplace: true
    }).on('fileuploaded', function (event, data, previewId, index) {
        $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
    }).on('fileremoved', function (event, id, index) {
        $("input[name='" + event.currentTarget.id + "']").val('')
    })

    $(function () {
        //查看当前基于训练版本
        const basedOnVersion = $("#basedOnVersion option:selected").val();
        if (basedOnVersion === "-1") {
            $("#currentDataSet").hide();
            $("#baseDataAdd").hide();
            $("#addData").show();
            $("#addData").children().find("input").attr("checked", true);
            $("#addData").children().find("input").parent().addClass('checked');
        }

        $('select[name="based_on_version"]').on('change', function (event) {
            if ($(event.target).val() === "-1") {
                $("#currentDataSet").hide();
                $("#baseDataAdd").hide();
                $("#trainData").show();
                $("#addData").show();
                $("#addData").children().find("input").attr("checked", true);
                $("#addData").children().find("input").parent().addClass('checked');
                $("#trainCreateVersion").show()
            } else {
                $("#currentDataSet").show();
                $("#trainData").hide();
                $("#currentDataSet").children().find("input").attr("checked", true);
                $("#currentDataSet").children().find("input").parent().addClass('checked');
                $("#baseDataAdd").show();
                $("#addData").hide();
                $("#trainCreateVersion").hide()
            }
        })


        $('input[name="training_set_type"]').on('ifChecked', function (event) {
            const trainingSetType = $(event.target).val();
            console.log(trainingSetType)
            if (trainingSetType === "1") {
                console.log("hidden")
                $("#trainData").hide();
            } else {
                console.log("show")
                $("#trainData").show();
            }
        });
    });

</script>
</body>
</html>
{"taskId":"17","videoId":"4c974d444f454b23afcf46b07b3a0f9a","imagePath":"/usr/local/server/aicsp/uploadPath/streamrecord/17/4c974d444f454b23afcf46b07b3a0f9a/4450.jpg","modelName":"common","result":[{"category":"person","bbox":[630.0,0.0,771.0,435.0],"score":0.6740092039108276}]}
{"taskId":"17","videoId":"4c974d444f454b23afcf46b07b3a0f9a","imagePath":"/usr/local/server/aicsp/uploadPath/streamrecord/17/4c974d444f454b23afcf46b07b3a0f9a/4625.jpg","modelName":"common","result":[]}
{
    "taskId":"17",
    "videoId":"4c974d444f454b23afcf46b07b3a0f9a",
    "imagePath":"/usr/local/server/aicsp/uploadPath/streamrecord/17/4c974d444f454b23afcf46b07b3a0f9a/6975.jpg",
    "modelName":"common",
    "result":[
        {
            "category":"manhole_cover_open",
            "bbox":[
                603,
                266,
                697,
                321
            ],
            "score":0.9340547919273376
        },
        {
            "category":"person",
            "bbox":[
                946,
                0,
                1120,
                337
            ],
            "score":0.7641172409057617
        }
    ]
}

ffmpeg -rtsp_transport tcp -i “rtsp://admin:08021718.Tian@192.168.1.15:554/h264/ch1/main/av_stream_1” -vcodec libx264 -acodec aac -f flv -y “rtmp://192.168.1.11:1935/live/iiiiiiiii”

文档更新时间: 2023-12-18 03:25   作者:JeffreyCheung