|
@@ -1,5 +1,6 @@
|
|
|
package com.fdkankan.common.util;
|
|
|
|
|
|
+import cn.hutool.core.exceptions.ExceptionUtil;
|
|
|
import com.fdkankan.common.constant.ConstantFileName;
|
|
|
import com.fdkankan.common.constant.ConstantFilePath;
|
|
|
import com.fdkankan.common.proto.BigSceneProto;
|
|
@@ -7,6 +8,16 @@ import com.fdkankan.common.proto.Common;
|
|
|
import com.fdkankan.common.proto.Visionmodeldata;
|
|
|
import com.fdkankan.common.proto.format.JsonFormat;
|
|
|
import com.google.protobuf.TextFormat;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Base64;
|
|
|
+import java.util.List;
|
|
|
+import java.util.concurrent.Callable;
|
|
|
+import java.util.concurrent.CountDownLatch;
|
|
|
+import java.util.concurrent.ExecutorService;
|
|
|
+import java.util.concurrent.Executors;
|
|
|
+import java.util.concurrent.Future;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.util.StopWatch;
|
|
@@ -15,9 +26,10 @@ import java.io.*;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+@Slf4j
|
|
|
public class CreateObjUtil {
|
|
|
|
|
|
- private static Logger log = LoggerFactory.getLogger(CreateObjUtil.class);
|
|
|
+// private static Logger log = LoggerFactory.getLogger(CreateObjUtil.class);
|
|
|
|
|
|
public void saveuploadImgs(String folderName) throws IOException, Exception
|
|
|
{
|
|
@@ -310,8 +322,8 @@ public class CreateObjUtil {
|
|
|
catch(Exception e)
|
|
|
{
|
|
|
StringWriter trace=new StringWriter();
|
|
|
- e.printStackTrace(new PrintWriter(trace));
|
|
|
- log.error(trace.toString());
|
|
|
+ e.printStackTrace(new PrintWriter(trace));
|
|
|
+ log.error(trace.toString());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -601,8 +613,46 @@ public class CreateObjUtil {
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) throws Exception{
|
|
|
- CreateObjUtil.convertTxtToVisionmodeldata("F:\\visiontest\\KJ-44g3CBuvof(1).txt", "F:\\visiontest\\vision.modeldata");
|
|
|
+// CreateObjUtil.convertTxtToVisionmodeldata("F:\\visiontest\\KJ-HXMNTDYs1E.txt", "F:\\visiontest\\vision.modeldata");
|
|
|
// CreateObjUtil.convertTxtToDam("F:\\visiontest\\modeldata.txt", "F:\\visiontest\\dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
|
|
|
+
|
|
|
+// String text = "web:web";
|
|
|
+// byte[] data = text.getBytes("UTF-8");
|
|
|
+// String s = Base64.getEncoder().encodeToString(data);
|
|
|
+// System.out.println(s);
|
|
|
+
|
|
|
+// org.apache.commons.lang3.time.StopWatch stopWatch = new org.apache.commons.lang3.time.StopWatch();
|
|
|
+// stopWatch.start();
|
|
|
+// Thread.sleep(2000);
|
|
|
+// stopWatch.stop();
|
|
|
+// System.out.println(stopWatch.getTime(TimeUnit.SECONDS));
|
|
|
+ ExecutorService executorService = Executors.newFixedThreadPool(1);
|
|
|
+ Future<String> future = executorService.submit(()->{
|
|
|
+ return CreateObjUtil.test();
|
|
|
+ });
|
|
|
+
|
|
|
+ try {
|
|
|
+ String s = future.get();
|
|
|
+ }catch (Exception e){
|
|
|
+
|
|
|
+ System.out.println(ExceptionUtil.stacktraceToString(e));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private static String test() throws Exception{
|
|
|
+ try {
|
|
|
+ String test = null;
|
|
|
+ test.equals("123");
|
|
|
+ }catch (Exception e){
|
|
|
+ throw e;
|
|
|
+ }finally {
|
|
|
+
|
|
|
+ }
|
|
|
+ return "123";
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|