Commit 4f063055 by xmh

修改包名

1 parent 22551b25
Showing 24 changed files with 57 additions and 46 deletions
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
</dependencies> </dependencies>
<build> <build>
<finalName>es-match</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
package com.xmh.es.match; package com.viontech.match;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication @SpringBootApplication
@ComponentScan(basePackages = {"com.viontech.keliu", "com.xmh.es"}) @ComponentScan(basePackages = {"com.viontech"})
public class XmhTestApplication { public class XmhTestApplication {
public static void main(String[] args) { public static void main(String[] args) {
......
package com.xmh.es.match.config; package com.viontech.match.config;
import com.viontech.keliu.websocket.AlgApiClient; import com.viontech.keliu.websocket.AlgApiClient;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
......
package com.xmh.es.match.controller; package com.viontech.match.controller;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.viontech.keliu.storage.Storage; import com.viontech.keliu.storage.Storage;
import com.viontech.keliu.util.DateUtil; import com.viontech.keliu.util.DateUtil;
import com.xmh.es.match.PoolEnum; import com.viontech.match.PoolEnum;
import com.xmh.es.match.entity.*; import com.viontech.match.entity.*;
import com.xmh.es.match.entity.vo.RequestData; import com.viontech.match.entity.vo.RequestData;
import com.xmh.es.match.repository.FaceRecognitionRepository; import com.viontech.match.repository.FaceRecognitionRepository;
import com.xmh.es.match.service.AlgService; import com.viontech.match.service.AlgService;
import com.xmh.es.match.service.MatchService; import com.viontech.match.service.MatchService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -113,10 +113,9 @@ public class MainController { ...@@ -113,10 +113,9 @@ public class MainController {
pool = PoolEnum.POOL_200W; pool = PoolEnum.POOL_200W;
break; break;
default: default:
return "请输入[2000,5000,20000,100000,500000,1000000,2000000]"; throw new RuntimeException("请输入[2000,5000,20000,100000,500000,1000000,2000000]");
} }
algService.deletePool(pool.name); algService.deletePool(pool.name);
algService.createPool(pool.name); algService.createPool(pool.name);
...@@ -151,9 +150,9 @@ public class MainController { ...@@ -151,9 +150,9 @@ public class MainController {
if (integer.get() > pool.num) { if (integer.get() > pool.num) {
return "success"; return "success";
} }
while (poolExecutor.getQueue().size() > 1000) { while (poolExecutor.getQueue().size() > 10000) {
System.out.println(poolExecutor.getQueue().size()); System.out.println(poolExecutor.getQueue().size());
TimeUnit.SECONDS.sleep(10); TimeUnit.SECONDS.sleep(4);
} }
if (integer.get() > pool.num) { if (integer.get() > pool.num) {
return "success"; return "success";
......
package com.xmh.es.match.entity; package com.viontech.match.entity;
import lombok.Getter; import lombok.Getter;
......
package com.xmh.es.match.entity; package com.viontech.match.entity;
import com.viontech.keliu.base.BaseModel; import com.viontech.keliu.base.BaseModel;
import com.viontech.keliu.util.DateUtil; import com.viontech.keliu.util.DateUtil;
......
package com.xmh.es.match.entity; package com.viontech.match.entity;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
......
package com.xmh.es.match.entity; package com.viontech.match.entity;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
......
package com.xmh.es.match.entity; package com.viontech.match.entity;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
......
package com.xmh.es.match.entity.vo; package com.viontech.match.entity.vo;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
......
package com.xmh.es.match.repository; package com.viontech.match.repository;
import com.xmh.es.match.entity.FaceRecognition; import com.viontech.match.entity.FaceRecognition;
import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
......
package com.xmh.es.match.service; package com.viontech.match.service;
import com.xmh.es.match.entity.MatchResult; import com.viontech.match.entity.Person;
import com.xmh.es.match.entity.Person; import com.viontech.match.entity.MatchResult;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.delete.DeleteRequest; import org.elasticsearch.action.delete.DeleteRequest;
...@@ -109,7 +109,7 @@ public class AlgService { ...@@ -109,7 +109,7 @@ public class AlgService {
* 查询特征库列表 * 查询特征库列表
*/ */
public String[] queryPoolList() throws IOException { public String[] queryPoolList() throws IOException {
GetIndexResponse response = client.indices().get(new GetIndexRequest("*pool*"), RequestOptions.DEFAULT); GetIndexResponse response = client.indices().get(new GetIndexRequest("*"), RequestOptions.DEFAULT);
return response.getIndices(); return response.getIndices();
} }
...@@ -132,7 +132,7 @@ public class AlgService { ...@@ -132,7 +132,7 @@ public class AlgService {
params.put("data", feature); params.put("data", feature);
Script script = new Script( Script script = new Script(
ScriptType.INLINE, Script.DEFAULT_SCRIPT_LANG, ScriptType.INLINE, Script.DEFAULT_SCRIPT_LANG,
"cosineSimilarity(params.data, 'data') + 1", params); "(cosineSimilarity(params.data, 'data') + 1) / 2 * 100", params);
ScriptScoreQueryBuilder queryBuilder = QueryBuilders.scriptScoreQuery(QueryBuilders.matchAllQuery(), script); ScriptScoreQueryBuilder queryBuilder = QueryBuilders.scriptScoreQuery(QueryBuilders.matchAllQuery(), script);
builder.query(queryBuilder); builder.query(queryBuilder);
......
package com.xmh.es.match.service; package com.viontech.match.service;
import com.viontech.keliu.i18n.util.LocalMessageUtil; import com.viontech.keliu.i18n.util.LocalMessageUtil;
import com.viontech.keliu.websocket.AlgApiClient; import com.viontech.keliu.websocket.AlgApiClient;
import com.xmh.es.match.entity.MatchResult; import com.viontech.match.entity.MatchResult;
import com.xmh.es.match.entity.Person; import com.viontech.match.entity.Person;
import com.xmh.es.match.entity.vo.RequestData; import com.viontech.match.entity.vo.RequestData;
import com.xmh.es.match.util.Utils; import com.viontech.match.util.Utils;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
......
package com.xmh.es.match.test; package com.viontech.match.test;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.viontech.keliu.model.Person; import com.viontech.keliu.model.Person;
......
package com.xmh.es.match.test; package com.viontech.match.test;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
......
package com.xmh.es.match.util; package com.viontech.match.util;
import java.awt.*; import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
......
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>hello</title><link href=/static/css/app.e7c2112962ef9f4a39d379467a4bcf3c.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.8d9ad72abf44221abb05.js></script><script type=text/javascript src=/static/js/app.975f2cc40df4e4cd82a5.js></script></body></html>
\ No newline at end of file \ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>hello</title><link href=/static/css/app.e7c2112962ef9f4a39d379467a4bcf3c.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.8d9ad72abf44221abb05.js></script><script type=text/javascript src=/static/js/app.c0f11caa495df4c4d340.js></script></body></html>
\ No newline at end of file \ No newline at end of file
webpackJsonp([1],{NHnr:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=a("7+uW"),l={name:"HelloWorld",data:function(){return{formData:new FormData,imageUrl:null,form:{poolId:null,file:null},poolIds:[],poolIdSelected:null,input:null,faceList:null,matchTime:null}},methods:{getSrc:function(t){return"https://vion-retail.oss-cn-beijing.aliyuncs.com/picture/"+t.facePath+t.facePic},beforeupload:function(t){return this.form.file=t,!1},onChange:function(t){this.imageUrl=URL.createObjectURL(t.raw)},onSubmit:function(){var t=this;this.$refs.upload.submit(),this.formData.set("poolId",this.form.poolId),this.formData.set("file",this.form.file),console.log(this.formData),this.axios.post("http://127.0.0.1:12000/alg/match",this.formData,{headers:{"Content-Type":"multipart/form-data"}}).then(function(e){var a=e.data.result;if(null!=a){t.faceList=[];for(var o=a.length/5,l=0;l<o;l++){var n=a.slice(5*l,5*l+5);t.faceList.push(n)}}t.matchTime=e.data.time}).catch(function(t){console.error(t)}),this.formData=new FormData},getPoolIds:function(){var t=this;this.axios({method:"get",url:"http://127.0.0.1:12000/alg/poolIds"}).then(function(e){t.poolIds=e.data,t.poolIds.length>0&&(t.form.poolId=t.poolIds[0])}).catch(function(t){console.log(t)})}},mounted:function(){this.getPoolIds()}},n={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"hello",staticStyle:{margin:"auto auto"}},[a("el-form",{ref:"form",staticStyle:{width:"400px",margin:"auto auto"},attrs:{model:t.form}},[a("el-form-item",{attrs:{label:"特征库"}},[a("el-select",{attrs:{placeholder:"请选择特征库"},model:{value:t.form.poolId,callback:function(e){t.$set(t.form,"poolId",e)},expression:"form.poolId"}},t._l(t.poolIds,function(t){return a("el-option",{key:t,attrs:{label:t,value:t}})}),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"人脸图片"}},[a("el-upload",{ref:"upload",staticClass:"avatar-uploader",attrs:{action:"http://127.0.0.1:12000/","show-file-list":!1,"auto-upload":!1,"on-change":t.onChange,"before-upload":t.beforeupload}},[t.imageUrl?a("img",{staticClass:"avatar",attrs:{src:t.imageUrl}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1),t._v(" "),a("el-form-item",[a("el-button",{staticStyle:{width:"100%"},attrs:{type:"primary"},on:{click:t.onSubmit}},[t._v("比对")])],1)],1),t._v(" "),null!=t.matchTime?a("p",[t._v("匹配耗时:"+t._s(t.matchTime))]):t._e(),t._v(" "),t._l(t.faceList,function(e,o){return a("el-row",{key:o,staticClass:"row-bg",staticStyle:{width:"80%",margin:"auto"},attrs:{type:"flex",justify:"space-around"}},t._l(t.faceList[o],function(e){return a("el-col",{key:e.unid,attrs:{span:4}},[a("el-card",{staticStyle:{margin:"20px",width:"200px"},attrs:{"body-style":{padding:"0px"}}},[a("img",{staticClass:"image",attrs:{src:t.getSrc(e)}}),t._v(" "),a("div",{staticStyle:{padding:"15px"}},[a("p",{staticStyle:{"font-size":"12px"}},[t._v("匹配分数:"+t._s(e.matchScore))]),t._v(" "),a("p",{staticStyle:{"font-size":"12px"}},[t._v("性别:"+t._s(0==e.gender?"女":1==e.gender?"男":"未知"))]),t._v(" "),a("p",{staticStyle:{"font-size":"12px"}},[t._v("年龄:"+t._s(e.age))]),t._v(" "),a("p",{staticStyle:{"font-size":"12px"}},[t._v("时间:"+t._s(e.counttime))])])])],1)}),1)})],2)},staticRenderFns:[]};var i={name:"App",components:{HelloWorld:a("VU/8")(l,n,!1,function(t){a("fKca")},null,null).exports}},s={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{attrs:{id:"app"}},[e("HelloWorld")],1)},staticRenderFns:[]};var r=a("VU/8")(i,s,!1,function(t){a("m71c")},null,null).exports,c=a("mtWM"),u=a.n(c),f=a("zL8q"),p=a.n(f);a("tvR6");o.default.use(p.a),o.default.config.productionTip=!1,o.default.prototype.axios=u.a,new o.default({el:"#app",components:{App:r},template:"<App/>"})},fKca:function(t,e){},m71c:function(t,e){},tvR6:function(t,e){}},["NHnr"]);
//# sourceMappingURL=app.975f2cc40df4e4cd82a5.js.map
\ No newline at end of file \ No newline at end of file
webpackJsonp([1],{IHzv:function(t,e){},NHnr:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=a("7+uW"),l={name:"HelloWorld",data:function(){return{formData:new FormData,imageUrl:null,form:{poolId:null,file:null},poolIds:[],poolIdSelected:null,input:null,faceList:null,matchTime:null}},methods:{getSrc:function(t){return"https://vion-retail.oss-cn-beijing.aliyuncs.com/picture/"+t.facePath+t.facePic},beforeupload:function(t){return this.form.file=t,!1},onChange:function(t){this.imageUrl=URL.createObjectURL(t.raw)},onSubmit:function(){var t=this;this.$refs.upload.submit(),this.formData.set("poolId",this.form.poolId),this.formData.set("file",this.form.file),console.log(this.formData),this.axios.post("/alg/match",this.formData,{headers:{"Content-Type":"multipart/form-data"}}).then(function(e){var a=e.data.result;if(null!=a){t.faceList=[];for(var o=a.length/5,l=0;l<o;l++){var n=a.slice(5*l,5*l+5);t.faceList.push(n)}}t.matchTime=e.data.time}).catch(function(t){console.error(t)}),this.formData=new FormData},getPoolIds:function(){var t=this;this.axios({method:"get",url:"/alg/poolIds"}).then(function(e){t.poolIds=e.data,t.poolIds.length>0&&(t.form.poolId=t.poolIds[0])}).catch(function(t){console.log(t)})}},mounted:function(){this.getPoolIds()}},n={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"hello",staticStyle:{margin:"auto auto"}},[a("el-form",{ref:"form",staticStyle:{width:"400px",margin:"auto auto"},attrs:{model:t.form}},[a("el-form-item",{attrs:{label:"特征库"}},[a("el-select",{attrs:{placeholder:"请选择特征库"},model:{value:t.form.poolId,callback:function(e){t.$set(t.form,"poolId",e)},expression:"form.poolId"}},t._l(t.poolIds,function(t){return a("el-option",{key:t,attrs:{label:t,value:t}})}),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"人脸图片"}},[a("el-upload",{ref:"upload",staticClass:"avatar-uploader",attrs:{action:"http://127.0.0.1:12000/","show-file-list":!1,"auto-upload":!1,"on-change":t.onChange,"before-upload":t.beforeupload}},[t.imageUrl?a("img",{staticClass:"avatar",attrs:{src:t.imageUrl}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1),t._v(" "),a("el-form-item",[a("el-button",{staticStyle:{width:"100%"},attrs:{type:"primary"},on:{click:t.onSubmit}},[t._v("比对")])],1)],1),t._v(" "),null!=t.matchTime?a("p",[t._v("匹配耗时:"+t._s(t.matchTime))]):t._e(),t._v(" "),t._l(t.faceList,function(e,o){return a("el-row",{key:o,staticClass:"row-bg",staticStyle:{width:"80%",margin:"auto"},attrs:{type:"flex",justify:"space-around"}},t._l(t.faceList[o],function(e){return a("el-col",{key:e.unid,attrs:{span:4}},[a("el-card",{staticStyle:{margin:"20px",width:"200px"},attrs:{"body-style":{padding:"0px"}}},[a("img",{staticClass:"image",attrs:{src:t.getSrc(e)}}),t._v(" "),a("div",{staticStyle:{padding:"15px"}},[a("p",{staticStyle:{"font-size":"12px"}},[t._v("匹配分数:"+t._s(e.matchScore))]),t._v(" "),a("p",{staticStyle:{"font-size":"12px"}},[t._v("性别:"+t._s(0==e.gender?"女":1==e.gender?"男":"未知"))]),t._v(" "),a("p",{staticStyle:{"font-size":"12px"}},[t._v("年龄:"+t._s(e.age))]),t._v(" "),a("p",{staticStyle:{"font-size":"12px"}},[t._v("时间:"+t._s(e.counttime))])])])],1)}),1)})],2)},staticRenderFns:[]};var i={name:"App",components:{HelloWorld:a("VU/8")(l,n,!1,function(t){a("IHzv")},null,null).exports}},s={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{attrs:{id:"app"}},[e("HelloWorld")],1)},staticRenderFns:[]};var r=a("VU/8")(i,s,!1,function(t){a("m71c")},null,null).exports,c=a("mtWM"),u=a.n(c),f=a("zL8q"),p=a.n(f);a("tvR6");o.default.use(p.a),o.default.config.productionTip=!1,o.default.prototype.axios=u.a,new o.default({el:"#app",components:{App:r},template:"<App/>"})},m71c:function(t,e){},tvR6:function(t,e){}},["NHnr"]);
//# sourceMappingURL=app.c0f11caa495df4c4d340.js.map
\ No newline at end of file \ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap d2d68e467296ba9c478b"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,IAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.2ae2e69a05c33dfc65f8.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap d2d68e467296ba9c478b"],"sourceRoot":""}
\ No newline at end of file \ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap 9660bad579d1459e2fa1"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,IAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.2ae2e69a05c33dfc65f8.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 9660bad579d1459e2fa1"],"sourceRoot":""}
\ No newline at end of file \ No newline at end of file
package com.xmh.es.match; package com.viontech.match;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.viontech.keliu.storage.Storage; import com.viontech.keliu.storage.Storage;
import com.viontech.keliu.util.DateUtil; import com.viontech.keliu.util.DateUtil;
import com.xmh.es.match.entity.*; import com.viontech.match.entity.*;
import com.xmh.es.match.repository.FaceRecognitionRepository; import com.viontech.match.repository.FaceRecognitionRepository;
import com.xmh.es.match.service.AlgService; import com.viontech.match.service.AlgService;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.core.CountRequest;
import org.elasticsearch.client.core.CountResponse;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
...@@ -19,6 +23,7 @@ import java.nio.file.Path; ...@@ -19,6 +23,7 @@ import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.text.ParseException; import java.text.ParseException;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
...@@ -48,6 +53,8 @@ public class Test0 { ...@@ -48,6 +53,8 @@ public class Test0 {
private FaceRecognitionRepository faceRecognitionRepository; private FaceRecognitionRepository faceRecognitionRepository;
@Resource @Resource
private Storage featureStorage; private Storage featureStorage;
@Resource
private RestHighLevelClient client;
@Test @Test
public void createPoolTest() throws IOException { public void createPoolTest() throws IOException {
...@@ -64,9 +71,13 @@ public class Test0 { ...@@ -64,9 +71,13 @@ public class Test0 {
@Test @Test
public void queryIndex() throws IOException { public void queryIndex() throws IOException {
String[] strings = algService.queryPoolList(); String[] strings = algService.queryPoolList();
for (String string : strings) { HashMap<String, Object> result = new HashMap<>();
System.out.println(string); for (String item : strings) {
CountResponse count = client.count(new CountRequest(item), RequestOptions.DEFAULT);
long count1 = count.getCount();
result.put(item, count1);
} }
System.out.println(result.toString());
} }
@Test @Test
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!