瀏覽代碼

增加 场景图片标注信息存储,修改,获取 接口

xiewj 2 年之前
父節點
當前提交
906cac8941

+ 18 - 0
src/main/java/com/fdkankan/openApi/controller/BaseController.java

@@ -5,7 +5,10 @@ import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.common.util.DateEditor;
 import com.fdkankan.openApi.entity.system.UserAuthInfo;
+import com.fdkankan.openApi.entity.www.ScenePlus;
 import com.fdkankan.openApi.service.system.IUserAuthInfoService;
+import com.fdkankan.openApi.service.www.ISceneCooperationService;
+import com.fdkankan.openApi.service.www.IScenePlusService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.propertyeditors.StringTrimmerEditor;
 import org.springframework.web.bind.WebDataBinder;
@@ -26,6 +29,11 @@ public class BaseController {
     @Autowired
     protected IUserAuthInfoService userAuthService;
 
+    @Autowired
+    protected IScenePlusService scenePlusService;
+    @Autowired
+    protected ISceneCooperationService sceneCooperationService;
+
     @InitBinder
     protected void initBinder(WebDataBinder webDataBinder) {
         webDataBinder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
@@ -56,4 +64,14 @@ public class BaseController {
         return this.getEffectUserAuthInfo().getUserId();
     }
 
+    protected ScenePlus checkScene(String num){
+        ScenePlus scenePlus = scenePlusService.getByNumAndUserId(this.getUserId(),num);
+        if(Objects.isNull(scenePlus)){
+            scenePlus = sceneCooperationService.getCooperaSceneByUserIdAndNum(this.getUserId(), num);
+            if(Objects.isNull(scenePlus)){
+                throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
+            }
+        }
+        return scenePlus;
+    }
 }

+ 58 - 0
src/main/java/com/fdkankan/openApi/controller/www/SceneMarkShapeController.java

@@ -0,0 +1,58 @@
+package com.fdkankan.openApi.controller.www;
+
+import cn.dev33.satoken.annotation.SaIgnore;
+import com.fdkankan.openApi.aop.RedisLimit;
+import com.fdkankan.openApi.aop.ValidateApi;
+import com.fdkankan.openApi.controller.BaseController;
+import com.fdkankan.openApi.service.www.ISceneMarkShapeService;
+import com.fdkankan.openApi.vo.www.SceneMarkShapeParamVO;
+import com.fdkankan.openApi.vo.www.SceneMarkShapeVO;
+import com.fdkankan.web.response.ResultData;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+/**
+ * <p>
+ *  标注信息前端控制器
+ * </p>
+ *
+ * @author
+ * @since 2023-02-15
+ */
+@RestController
+@RequestMapping("/scene/sceneMarkShape")
+@Slf4j
+public class SceneMarkShapeController extends BaseController
+{
+    @Autowired
+    private ISceneMarkShapeService sceneMarkShapeService;
+
+    /**
+     * 根据场景码和图片名称获取数据
+     */
+    @SaIgnore
+    @PostMapping("/getShapesInfo")
+    @RedisLimit(limitCount = 100, period = 1)
+    @ValidateApi(method = "scene:getShapesInfo")
+    public ResultData getShapesInfo(@RequestBody @Validated  SceneMarkShapeParamVO param) {
+        this.checkScene(param.getNum());
+        return sceneMarkShapeService.getShapesInfo(param);
+
+    }
+    /**
+     * 保存或者修改JSON
+     */
+    @SaIgnore
+    @PostMapping("/saveOrEdit")
+    @RedisLimit(limitCount = 100, period = 1)
+    @ValidateApi(method = "scene:saveOrEdit")
+    public ResultData saveOrEdit(@RequestBody SceneMarkShapeVO param) {
+        this.checkScene(param.getNum());
+        return sceneMarkShapeService.saveOrEdit(param);
+    }
+
+}

+ 70 - 0
src/main/java/com/fdkankan/openApi/entity/www/SceneMarkShape.java

@@ -0,0 +1,70 @@
+package com.fdkankan.openApi.entity.www;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ * 场景标记多边形识别数据
+ * </p>
+ *
+ * @author Xiewj
+ * @date 2023/3/30
+ */
+@Data
+@TableName(value = "t_scene_mark_shape",autoResultMap = true)
+@Accessors(chain = true)
+public class SceneMarkShape implements Serializable {
+
+      /**
+       * 主键
+       */
+      @TableId(value = "id", type = IdType.AUTO)
+      private Long id;
+
+      @TableField("version")
+      private String version;
+
+      @TableField(typeHandler = FastjsonTypeHandler.class, value = "shapes")
+      private List<JSONObject> shapes;
+
+      @TableField("image_path")
+      private String imagePath;
+      @TableField("image_height")
+      private Integer imageHeight;
+      @TableField("image_width")
+      private Integer imageWidth;
+      @TableField("num")
+      private String num;
+      /**
+       * 0不需要 1需要
+       */
+      @TableField("re_train")
+      private Integer reTrain;
+      /**
+       * 0需要训练 1已经训练过
+       */
+      @TableField("to_train")
+      private Integer toTrain;
+
+      @TableField("create_time")
+      private Date createTime;
+
+      @TableField("update_time")
+      private Date updateTime;
+
+      /**
+       * 记录的状态,A: 生效,I: 禁用
+       */
+      @TableField("rec_status")
+      @TableLogic(value = "A", delval = "I")
+      private String recStatus;
+
+}

+ 16 - 0
src/main/java/com/fdkankan/openApi/mapper/www/IMarkShapeMapper.java

@@ -0,0 +1,16 @@
+package com.fdkankan.openApi.mapper.www;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fdkankan.openApi.entity.www.SceneMarkShape;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author Xiewj
+ * @date 2021/11/22
+ */
+@Mapper
+@Component("MarkShapeMapper")
+public interface IMarkShapeMapper extends BaseMapper<SceneMarkShape> {
+}
+

+ 35 - 0
src/main/java/com/fdkankan/openApi/service/www/ISceneMarkShapeService.java

@@ -0,0 +1,35 @@
+package com.fdkankan.openApi.service.www;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.openApi.entity.www.SceneMarkShape;
+import com.fdkankan.openApi.vo.www.SceneMarkShapeParamVO;
+import com.fdkankan.openApi.vo.www.SceneMarkShapeReDetectParamVO;
+import com.fdkankan.openApi.vo.www.SceneMarkShapeVO;
+import com.fdkankan.web.response.ResultData;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Created by Xiewj on 2021/11/23 0026 10:14
+ */
+public interface ISceneMarkShapeService extends IService<SceneMarkShape> {
+    void saveFileToDB(MultipartFile inPath, String num) throws IOException;
+
+    SceneMarkShape findByNumAndImagePath(String num, String imagePath);
+
+    ResultData editLabelByFile(String num, String imgPath, MultipartFile file) throws IOException;
+
+    void trainScene(SceneMarkShapeReDetectParamVO param);
+
+    List<SceneMarkShape> findByReTrainStatus(Integer reTrain);
+    List<SceneMarkShape> findByToTrainStatus(Integer toTrain);
+
+    void editTrainStatus(SceneMarkShapeParamVO param);
+
+    ResultData saveOrEdit(SceneMarkShapeVO param);
+
+    ResultData getShapesInfo(SceneMarkShapeParamVO param);
+}

+ 218 - 0
src/main/java/com/fdkankan/openApi/service/www/impl/SceneMarkShapeServiceImpl.java

@@ -0,0 +1,218 @@
+package com.fdkankan.openApi.service.www.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.lang.UUID;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.model.constants.ConstantFilePath;
+import com.fdkankan.openApi.entity.www.SceneMarkShape;
+import com.fdkankan.openApi.mapper.www.IMarkShapeMapper;
+import com.fdkankan.openApi.service.www.ISceneMarkShapeService;
+import com.fdkankan.openApi.util.ConverxyUtil;
+import com.fdkankan.openApi.vo.www.SceneMarkShapeParamVO;
+import com.fdkankan.openApi.vo.www.SceneMarkShapeReDetectParamVO;
+import com.fdkankan.openApi.vo.www.SceneMarkShapeVO;
+import com.fdkankan.rabbitmq.util.RabbitMqProducer;
+import com.fdkankan.web.response.ResultData;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+
+/**
+ * Created by Xiewj on 2021/11/23 0026 10:14
+ */
+@Slf4j
+@Service
+@DS("www")
+public class SceneMarkShapeServiceImpl extends ServiceImpl<IMarkShapeMapper, SceneMarkShape> implements ISceneMarkShapeService {
+    @Autowired
+    private RabbitMqProducer rabbitMqProducer;
+    @Value("${queue.scene.yolov5-train-queue}")
+    private String yolov5TrainQueue;
+    @Value("${main.url}")
+    private String mainUrl;
+    @Autowired
+    private ISceneMarkShapeService sceneMarkShapeService;
+
+    @Override
+    public ResultData saveOrEdit(SceneMarkShapeVO param) {
+        if (Objects.isNull(param.getShapes())) {
+            throw new BusinessException(ErrorCode.PARAM_REQUIRED,"shapes 为空");
+        }
+        log.info("标注数据保存或修改-场景码:{},场景图片:{},",param.getNum(),param.getImagePath());
+        SceneMarkShape shape = this.findByNumAndImagePath(param.getNum(), param.getImagePath());
+        SceneMarkShape sceneMarkShape=new SceneMarkShape();
+        BeanUtil.copyProperties(param,sceneMarkShape);
+        if (ObjectUtil.isNotNull(shape)){
+            log.info("修改成功-修改id--{}",shape.getId());
+            sceneMarkShape.setId(shape.getId());
+            sceneMarkShape.setUpdateTime(new Date());
+            return ResultData.ok(this.updateById(sceneMarkShape));
+        }else {
+            log.info("保存成功");
+            sceneMarkShape.setCreateTime(new Date());
+            return ResultData.ok(this.save(sceneMarkShape));
+        }
+    }
+
+    @Override
+    public ResultData getShapesInfo(SceneMarkShapeParamVO param) {
+        SceneMarkShape res=  findByNumAndImagePath(param.getNum(),param.getImagePath());
+        SceneMarkShapeVO vo=new SceneMarkShapeVO();
+        BeanUtil.copyProperties(res,vo);
+        return ResultData.ok(vo);
+    }
+
+    @Override
+    public void editTrainStatus(SceneMarkShapeParamVO param) {
+        SceneMarkShape byNumAndImagePath = findByNumAndImagePath(param.getNum(), param.getImagePath());
+        if (ObjectUtil.isNotNull(byNumAndImagePath)){
+            byNumAndImagePath.setReTrain(0);
+            byNumAndImagePath.setToTrain(1);
+            updateById(byNumAndImagePath);
+        }
+    }
+
+    @Override
+    public List<SceneMarkShape> findByReTrainStatus(Integer reTrain){
+        LambdaQueryWrapper<SceneMarkShape> wrapper = Wrappers.lambdaQuery();
+        wrapper.eq(SceneMarkShape::getReTrain,reTrain);
+        return list(wrapper);
+    }
+
+    @Override
+    public List<SceneMarkShape> findByToTrainStatus(Integer toTrain) {
+        QueryWrapper queryWrapper = new QueryWrapper();
+        queryWrapper.select("DISTINCT num")
+                .eq("to_train",toTrain) ;
+        return getBaseMapper().selectList(queryWrapper);
+    }
+
+    @Override
+    public void trainScene(SceneMarkShapeReDetectParamVO param) {
+        //查询需要重新训练的图片
+        List<SceneMarkShape> reDetectStatuList = findByReTrainStatus(1);
+        for (SceneMarkShape shape : reDetectStatuList) {
+            SceneMarkShapeReDetectParamVO paramVO=new SceneMarkShapeReDetectParamVO();
+            paramVO.setWebSite(mainUrl);
+            if (StrUtil.isNotEmpty(param.getSaveDir())){
+                paramVO.setSaveDir(param.getSaveDir());
+            }
+            paramVO.setNum(shape.getNum());
+            paramVO.setImagePath(shape.getImagePath());
+            paramVO.setDetectType(1);
+            rabbitMqProducer.sendByWorkQueue(yolov5TrainQueue,paramVO);
+        }
+        //查询需要进入训练的场景
+        List<SceneMarkShape> byToDetectStatus = findByToTrainStatus(0);
+        for (SceneMarkShape shape : byToDetectStatus) {
+            SceneMarkShapeReDetectParamVO paramVO=new SceneMarkShapeReDetectParamVO();
+            paramVO.setWebSite(mainUrl);
+            if (StrUtil.isNotEmpty(param.getSaveDir())){
+                paramVO.setSaveDir(param.getSaveDir());
+            }
+            paramVO.setNum(shape.getNum());
+            paramVO.setDetectType(2);
+            rabbitMqProducer.sendByWorkQueue(yolov5TrainQueue,paramVO);
+        }
+    }
+
+    @Override
+    public ResultData editLabelByFile(String num, String imgPath, MultipartFile file) throws IOException {
+
+        SceneMarkShape shape = findByNumAndImagePath(num, imgPath);
+        if (ObjectUtil.isNotNull(shape)){
+            String uuid = UUID.randomUUID().toString();
+            String fileName = file.getOriginalFilename();
+            String extName = FileUtil.extName(fileName);
+            String tempFileName = uuid + "." + extName;
+            String srcPath = ConstantFilePath.SCENE_V4_PATH + num + "/markShapes/" + tempFileName;
+            File tempFile = new File(srcPath);
+            if(!tempFile.getParentFile().exists()){
+                tempFile.getParentFile().mkdirs();
+            }
+            file.transferTo(tempFile);
+
+            List<String> s = FileUtil.readUtf8Lines(tempFile);
+            List<JSONObject> shapeJsons=new ArrayList<>();
+            //转换labelimg标注处理的结果
+            log.info("转换labelimg标注处理的结果开始");
+            for (String s1 : s) {
+                int[] ints = ConverxyUtil.centerWh2xyxy(s1, 4096,2048);
+                String[] s2 = s1.split(" ");
+                JSONObject shapeJson=new JSONObject();
+                shapeJson.put("bbox",ints);
+                shapeJson.put("color",ConverxyUtil.getColor(s2[0]));
+                shapeJson.put("label",s1);
+                shapeJson.put("category", ConverxyUtil.getLabelVal(s2[0]));
+                shapeJson.put("score",0);
+                shapeJsons.add(shapeJson);
+            }
+            log.info("转换labelimg标注处理的结果结束,{}",shapeJsons);
+            shape.setShapes(shapeJsons);
+            shape.setReTrain(1);
+            shape.setUpdateTime(new Date());
+            updateById(shape);
+            return ResultData.ok(shape);
+        }else {
+            return ResultData.error(ErrorCode.NOT_RECORD);
+        }
+    }
+
+    @Override
+    public SceneMarkShape findByNumAndImagePath(String num, String imagePath) {
+        LambdaQueryWrapper<SceneMarkShape> wrapper = Wrappers.lambdaQuery();
+        wrapper.eq(SceneMarkShape::getNum,num);
+        wrapper.eq(SceneMarkShape::getImagePath,imagePath);
+        return getOne(wrapper);
+    }
+
+    @Override
+    public void saveFileToDB(MultipartFile file, String num) throws IOException {
+        String uuid = UUID.randomUUID().toString();
+        String fileName = file.getOriginalFilename();
+        String extName = FileUtil.extName(fileName);
+        String tempFileName = uuid + "." + extName;
+        String srcPath = ConstantFilePath.SCENE_V4_PATH + num + "/markShapes/" + tempFileName;
+        File tempFile = new File(srcPath);
+        if(!tempFile.getParentFile().exists()){
+            tempFile.getParentFile().mkdirs();
+        }
+        file.transferTo(tempFile);
+        String s = FileUtil.readUtf8String(tempFile);
+        JSONObject jsonObject = JSONObject.parseObject(s);
+        tempFile.delete();
+        SceneMarkShape sceneMarkShape= JSON.toJavaObject(jsonObject,SceneMarkShape.class);
+        sceneMarkShape.setNum(num);
+        SceneMarkShape shape = findByNumAndImagePath(sceneMarkShape.getNum(), sceneMarkShape.getImagePath());
+        if (ObjectUtil.isNotNull(shape)){
+            log.info("shape-替换id修改---{}",sceneMarkShape);
+            sceneMarkShape.setId(shape.getId());
+            updateById(sceneMarkShape);
+        }else {
+            log.info("新增-替换id修改---{}",sceneMarkShape);
+            log.info("MarkShapeMapper---{}",sceneMarkShape);
+            save(sceneMarkShape);
+        }
+    }
+}

+ 120 - 0
src/main/java/com/fdkankan/openApi/util/ConverxyUtil.java

@@ -0,0 +1,120 @@
+package com.fdkankan.openApi.util;
+
+import cn.hutool.core.io.FileUtil;
+import com.alibaba.fastjson.JSONObject;
+
+import java.io.File;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Xiewj
+ * @date 2023/4/11
+ */
+public class ConverxyUtil {
+   static Map<String,String> label=new HashMap<>();
+   static Map<String,int[]> color=new HashMap<>();
+
+   static void init() {
+      label.put("0","cabinet");
+      label.put("1","air");
+      label.put("2","battery");
+
+      color.put("0",new int[]{56,56,255});
+      color.put("1",new int[]{151,157,255});
+      color.put("2",new int[]{31,112,255});
+   }
+   public static String getLabelVal(String key) {
+      if (label.size()==0){
+         init();
+      }
+      //标签类型初始化
+     return label.get(key);
+   }
+   public static int[] getColor(String key) {
+      if (color.size()==0){
+         init();
+      }
+      //标签类型初始化
+      return color.get(key);
+   }
+      // 将中心宽高格式转换为左上角点和右下角点格式
+   /**
+    * 将xywh格式的目标框转换为xyxy格式
+    * @param xywh xywh格式的目标框,格式为"x,y,w,h"
+    * @return xyxy格式的目标框,格式为"x1,y1,x2,y2"
+    */
+   public static int[] centerWh2xyxy(String xywh,int w1,int h1){
+      String[] values = xywh.split(" ");
+      if (values.length<4){
+         return null;
+      }
+      float x = Float.parseFloat(values[1]);
+      float y = Float.parseFloat(values[2]);
+      float w = Float.parseFloat(values[3]);
+      float h = Float.parseFloat(values[4]);
+      int[] xyxy = new int[4];
+      xyxy[0] = (int) ((x - w / 2) * w1); // x1
+      xyxy[1] = (int) ((y - h / 2)* h1); // y1
+      xyxy[2] = (int) ((x + w / 2)* w1); // x2
+      xyxy[3] = (int) ((y+ h / 2)* h1); // y2
+      return xyxy;
+   }
+
+   // 将左上角点和右下角点格式转换为中心宽高格式
+   public static double[] xyxy2centerWh(int x1, int y1, int x2, int y2,int w1,int h1){
+
+      double[] centerWh = new double[4];
+      BigDecimal dx1=BigDecimal.valueOf(x1);
+      BigDecimal  dy1=BigDecimal.valueOf(y1);
+      BigDecimal  dx2=BigDecimal.valueOf(x2);
+      BigDecimal dy2= BigDecimal.valueOf(y2);
+      BigDecimal  dw1=BigDecimal.valueOf(w1);
+      BigDecimal  dh1=BigDecimal.valueOf(h1);
+
+
+      centerWh[0] =((dx1.add(dx2)).divide(BigDecimal.valueOf(2))).divide(dw1).doubleValue(); // centerX
+      centerWh[1] = ((dy1.add(dy2)).divide(BigDecimal.valueOf(2))).divide(dh1).doubleValue(); // centerX
+      centerWh[2] = dx2.subtract(dx1).divide(dw1).doubleValue(); // width
+      centerWh[3] =  dy2.subtract(dy1).divide(dh1).doubleValue(); // width
+
+      return centerWh;
+   }
+   public static void main(String[] args) {
+      // 中心宽高格式转换为左上角点和右下角点格式
+//      int[] xyxy = ConverxyUtil.centerWh2xyxy("0.215149 0.557373 0.067749 0.329590",8192,4096);
+//
+//      System.out.println("x1=" + xyxy[0] + ", y1=" + xyxy[1] + ", x2=" + xyxy[2] + ", y2=" + xyxy[3]);
+//
+//      // 左上角点和右下角点格式转换为中心宽高格式
+//      double[] centerWh = ConverxyUtil.xyxy2centerWh(xyxy[0], xyxy[1], xyxy[2], xyxy[3],8192,4096);
+//      System.out.println("centerX=" + centerWh[0] + ", centerY=" + centerWh[1] + ", width=" + centerWh[2] + ", height=" + centerWh[3]);
+//      int[] xyxy1 = ConverxyUtil.centerWh2xyxy("0.21514892578125 0.5572509765625 0.0677490234375 0.329833984375",8192,4096);
+//      System.out.println("x1=" + xyxy1[0] + ", y1=" + xyxy1[1] + ", x2=" + xyxy1[2] + ", y2=" + xyxy1[3]);
+//
+////      Object labelVal = ConverxyUtil.getLabelVal("1");
+////      System.out.println(labelVal);
+
+      File tempFile=new File("C:\\Users\\4DAGE\\Downloads\\KK-UR4UGMSHEK3\\images\\0.txt");
+      List<String> s = FileUtil.readUtf8Lines(tempFile);
+
+
+      List<JSONObject> shapeJsons=new ArrayList<>();
+      //转换labelimg标注处理的结果
+      for (String s1 : s) {
+         int[] ints = ConverxyUtil.centerWh2xyxy(s1, 4096,2048);
+         String[] s2 = s1.split(" ");
+         JSONObject shapeJson=new JSONObject();
+         shapeJson.put("bbox",ints);
+         shapeJson.put("color",ConverxyUtil.getColor(s2[0]));
+         shapeJson.put("label",s1);
+         shapeJson.put("category",ConverxyUtil.getLabelVal(s2[0]));
+         shapeJson.put("score",0);
+         shapeJsons.add(shapeJson);
+      }
+      System.out.println(shapeJsons);
+   }
+}

+ 39 - 0
src/main/java/com/fdkankan/openApi/vo/www/SceneMarkShapeDetectParamVO.java

@@ -0,0 +1,39 @@
+package com.fdkankan.openApi.vo.www;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * <p>
+ * TODO
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/1/19
+ **/
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SceneMarkShapeDetectParamVO {
+
+    /**
+     * 场景码
+     */
+    @NotBlank(message = "场景码不能为空")
+    private String num;
+
+    /**
+     *  推送域名
+     */
+    private String webSite;
+
+    /**
+     *  保存路径。可以为空,不为空可以查看结果
+     */
+    private String saveDir="";
+}

+ 37 - 0
src/main/java/com/fdkankan/openApi/vo/www/SceneMarkShapeParamVO.java

@@ -0,0 +1,37 @@
+package com.fdkankan.openApi.vo.www;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * <p>
+ * TODO
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/1/19
+ **/
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SceneMarkShapeParamVO {
+
+    /**
+     * 场景码
+     */
+    @NotBlank(message = "场景码不能为空")
+    private String num;
+
+    /**
+     * 图片名称路径
+     */
+    @NotBlank(message = "图片路径名称不能为空")
+    private String imagePath;
+
+
+}

+ 46 - 0
src/main/java/com/fdkankan/openApi/vo/www/SceneMarkShapeReDetectParamVO.java

@@ -0,0 +1,46 @@
+package com.fdkankan.openApi.vo.www;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * <p>
+ * TODO
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/1/19
+ **/
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SceneMarkShapeReDetectParamVO {
+
+    /**
+     * 场景码
+     */
+    private String num;
+
+    /**
+     *  推送域名
+     */
+    private String webSite;
+    /**
+     *  图片名称
+     */
+    private String imagePath;
+
+    /**
+     *  保存路径。可以为空,不为空可以查看结果
+     */
+    private String saveDir="";
+
+    /**
+     *  1,场景的单张图片重新进入训练  2,整个场景的推理进入训练
+     */
+    private Integer detectType;
+
+}

+ 47 - 0
src/main/java/com/fdkankan/openApi/vo/www/SceneMarkShapeVO.java

@@ -0,0 +1,47 @@
+package com.fdkankan.openApi.vo.www;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ * 场景标记多边形识别数据
+ * </p>
+ *
+ * @author Xiewj
+ * @date 2023/3/30
+ */
+@Data
+public class SceneMarkShapeVO   {
+
+      /**
+       * 主键
+       */
+      private Long id;
+
+      @NotNull(message = "版本号不能为空")
+      private String version;
+
+      @NotNull(message = "标注数据不能为空")
+      private List<JSONObject> shapes;
+
+      @NotBlank(message = "场景路径图片名称不能为空")
+      private String imagePath;
+      @NotNull(message = "图片尺寸不能为空")
+      private Integer imageHeight;
+      @NotNull(message = "图片尺寸不能为空")
+      private Integer imageWidth;
+      @NotNull(message = "场景码不能为空")
+      private String num;
+
+      private Date createTime;
+
+      private Date updateTime;
+
+
+}