private unsafe void button2_Click(object sender, EventArgs e) { CC.TraindEventCallback func = new CC.TraindEventCallback(trainCallback); CC.setTraindEventCallback(func); Thread t = new Thread(new ThreadStart(run)); t.Start(); }
private void button1_Click(object sender, EventArgs e) { IntPtr model = CC.createClassifier("deploy.prototxt", "nin_iter_16000.caffemodel"); byte[] img = readFile("测试图片.png"); IntPtr softmax = CC.predictSoftmax(model, img, img.Length); int[] label = new int[4]; CC.getMultiLabel(softmax, label); MessageBox.Show("识别结果是: " + getLabelString(label)); CC.releaseSoftmaxResult(softmax); CC.releaseClassifier(model); }
public unsafe void convertImageSet() { CC.convert_imageset("./ label-train.txt train_lmdb --shuffle=true --resize_width=224 --resize_height=224", new CC.ConvertImageSetEventCallback(convertImageSetCallback)); }
public void run() { CC.train_network("train --solver=solver.prototxt"); }