Browse Source

fix:依图接口参数调整

lileilei 2 years ago
parent
commit
5c57ed6324

+ 2 - 2
src/main/java/com/rshy/project/hy/server/FaceRetrievaServer.java

@@ -52,7 +52,7 @@ public class FaceRetrievaServer {
     @Value("${face.retrieva.userInfo.password}")
     private String password;
     @Value("${face.retrieva.userInfo.threshold}")
-    private Double threshold;
+    private String threshold;
 
     /**
      * 创建缓存,默认15分钟过期
@@ -111,7 +111,7 @@ public class FaceRetrievaServer {
         }
 
         List<RepositoryVO> voList = Convert.toList(RepositoryVO.class, repository.getResults());
-        RetrievalRepositoryParam param = new RetrievalRepositoryParam().setExtra_fields(Lists.newArrayList("custom_field_1")).setOrder(new OrderDTO().setSimilarity("-1"))
+        RetrievalRepositoryParam param = new RetrievalRepositoryParam().setExtra_fields(Lists.newArrayList("custom_field_1")).setOrder(new OrderDTO().setSimilarity(-1))
                 .setStart(0).setLimit(1).setRetrieval_query_id("1").setRetrieval(new RetrievalDTO().setPicture_image_content_base64(photo).setFast(true).setThreshold(threshold)
                         .setRepository_ids(voList.stream().map(RepositoryVO::getId).collect(Collectors.toList())));
         log.info("依图调用参数: {}", JSON.toJSONString(param));

+ 1 - 1
src/main/java/com/rshy/project/hy/server/dto/OrderDTO.java

@@ -11,5 +11,5 @@ import lombok.experimental.Accessors;
 @Data
 @Accessors(chain = true)
 public class OrderDTO {
-    private String similarity;
+    private Integer similarity;
 }

+ 1 - 1
src/main/java/com/rshy/project/hy/server/dto/RetrievalDTO.java

@@ -26,7 +26,7 @@ public class RetrievalDTO {
     /**
      * 相似度分数线
      */
-    private Double threshold;
+    private String threshold;
 
     /**
      * 检索是否开启加速