|
|
|
@ -31,32 +31,30 @@ public class HelloWorld {
|
|
|
|
|
public static void test() throws Exception {
|
|
|
|
|
Picture picture = new Picture();
|
|
|
|
|
TempleConfig templeConfig = new TempleConfig();
|
|
|
|
|
// templeConfig.setHavePosition(true);
|
|
|
|
|
//templeConfig.setHavePosition(true);
|
|
|
|
|
// Frame frame = new Frame();
|
|
|
|
|
// frame.setWidth(3024);
|
|
|
|
|
// frame.setHeight(4032);
|
|
|
|
|
// frame.setLengthHeight(100);
|
|
|
|
|
// frame.setLengthWidth(100);
|
|
|
|
|
// templeConfig.setFrame(frame);
|
|
|
|
|
//ModelParameter modelParameter1 = JSONObject.parseObject(ModelData.DATA, ModelParameter.class);
|
|
|
|
|
ModelParameter modelParameter = JSONObject.parseObject(ModelData.DATA, ModelParameter.class);
|
|
|
|
|
templeConfig.init(StudyPattern.Accuracy_Pattern, true, 1076, 1436, 1);
|
|
|
|
|
templeConfig.insertModel(modelParameter);
|
|
|
|
|
Operation operation = new Operation(templeConfig);
|
|
|
|
|
Matrix right = picture.getImageMatrixByLocal("/Users/lidapeng/Desktop/myDocment/s1.jpeg");
|
|
|
|
|
operation.learning(right, 1, false);
|
|
|
|
|
|
|
|
|
|
// for (int i = 1; i < 120; i++) {//faster rcnn神经网络学习
|
|
|
|
|
// System.out.println("study==" + i);
|
|
|
|
|
// //读取本地URL地址图片,并转化成矩阵
|
|
|
|
|
// Matrix right = picture.getImageMatrixByLocal("/Users/lidapeng/Desktop/myDocment/c/c" + i + ".png");
|
|
|
|
|
// Matrix wrong = picture.getImageMatrixByLocal("/Users/lidapeng/Desktop/myDocment/b/b" + i + ".png");
|
|
|
|
|
// //将图像矩阵和标注加入进行学习,Accuracy_Pattern 模式 进行第二次学习
|
|
|
|
|
// //第二次学习的时候,第三个参数必须是 true
|
|
|
|
|
// operation.learning(right, 1, true);
|
|
|
|
|
// operation.learning(wrong, 0, true);
|
|
|
|
|
// }
|
|
|
|
|
// templeConfig.boxStudy();//边框聚类
|
|
|
|
|
for (int i = 1; i < 100; i++) {//faster rcnn神经网络学习
|
|
|
|
|
System.out.println("study==" + i);
|
|
|
|
|
//读取本地URL地址图片,并转化成矩阵
|
|
|
|
|
Matrix right = picture.getImageMatrixByLocal("/Users/lidapeng/Desktop/myDocment/c/c" + i + ".png");
|
|
|
|
|
Matrix wrong = picture.getImageMatrixByLocal("/Users/lidapeng/Desktop/myDocment/b/b" + i + ".png");
|
|
|
|
|
//将图像矩阵和标注加入进行学习,Accuracy_Pattern 模式 进行第二次学习
|
|
|
|
|
//第二次学习的时候,第三个参数必须是 true
|
|
|
|
|
operation.learning(right, 1, true);
|
|
|
|
|
operation.learning(wrong, 0, true);
|
|
|
|
|
}
|
|
|
|
|
// //精准模式在全部学习结束的时候一定要使用此方法,速度模式不要调用此方法
|
|
|
|
|
// templeConfig.startLvq();//原型向量量化
|
|
|
|
|
templeConfig.startLvq();//原型向量量化
|
|
|
|
|
// templeConfig.boxStudy();//边框回归
|
|
|
|
|
// for (int j = 1; j < 2; j++) {
|
|
|
|
|
// Matrix right = picture.getImageMatrixByLocal("/Users/lidapeng/Desktop/myDocment/c/c" + j + ".png");
|
|
|
|
|