1
0
mirror of https://github.com/davpapp/PowerMiner synced 2024-12-22 07:58:48 -05:00

Fixed importFromTensorFlonsorFlow Issue

This commit is contained in:
davpapp 2018-02-15 07:46:02 -05:00
parent 1a03890095
commit b246df6083
9 changed files with 2174 additions and 11 deletions

View File

@ -11,6 +11,12 @@
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/OpenCV-3.4.0">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="/home/dpapp/opencv-3.4.0/build/lib"/>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="output" path="bin"/>
</classpath>

BIN
TensorFlow/frozen_graph.pb Normal file

Binary file not shown.

View File

@ -0,0 +1,4 @@
item {
id: 1
name: 'ironOre'
}

File diff suppressed because it is too large Load Diff

View File

BIN
bin/ObjectDetector.class Normal file

Binary file not shown.

Binary file not shown.

43
src/ObjectDetector.java Normal file
View File

@ -0,0 +1,43 @@
import java.io.File;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.dnn.Dnn;
import org.opencv.dnn.Net;
public class ObjectDetector {
String inputImagePath;
String inputModelPath;
public ObjectDetector() {
this.inputImagePath = "/home/dpapp/tensorflow-1.5.0/models/raccoon-dataset/test_images/ironOre_test_9.jpg";
this.inputModelPath = "/home/dpapp/eclipse-workspace/RunescapeAI/TensorFlow/frozen_graph.pb";
String inputModelArgumentsPath = "/home/dpapp/eclipse-workspace/RunescapeAI/TensorFlow/ssd_mobilenet_v1_coco.pbtxt";
File inputModelFile = new File(inputModelPath);
String correctFilePath = inputModelFile.toString();
File inputFile = new File(inputModelArgumentsPath);
System.out.println(inputModelFile.toString());
System.out.println(inputFile.toString());
Net net = Dnn.readNetFromTensorflow(correctFilePath, inputModelArgumentsPath);
}
public void setUp() {
//String
}
public static void main( String[] args ) {
System.out.println("Reading model from TensorFlow...");
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
//Mat mat = Mat.eye(3, 3, CvType.CV_8UC1);
//System.out.println("mat = " + mat.dump());
ObjectDetector objectDetector = new ObjectDetector();
System.out.println("Done...");
}
}

View File

@ -1,11 +0,0 @@
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
public class OpenCVTest {
public static void main( String[] args ) {
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
Mat mat = Mat.eye(3, 3, CvType.CV_8UC1);
System.out.println("mat = " + mat.dump());
}
}