mirror of
https://github.com/davpapp/PowerMiner
synced 2024-12-21 23:48:49 -05:00
Fixed importFromTensorFlonsorFlow Issue
This commit is contained in:
parent
1a03890095
commit
b246df6083
@ -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
BIN
TensorFlow/frozen_graph.pb
Normal file
Binary file not shown.
4
TensorFlow/object-detection.pbtxt
Normal file
4
TensorFlow/object-detection.pbtxt
Normal file
@ -0,0 +1,4 @@
|
||||
item {
|
||||
id: 1
|
||||
name: 'ironOre'
|
||||
}
|
2121
TensorFlow/ssd_mobilenet_v1_coco.pbtxt
Normal file
2121
TensorFlow/ssd_mobilenet_v1_coco.pbtxt
Normal file
File diff suppressed because it is too large
Load Diff
0
TensorFlow/ssd_mobilenet_v1_coco.pbtxt~
Normal file
0
TensorFlow/ssd_mobilenet_v1_coco.pbtxt~
Normal file
BIN
bin/ObjectDetector.class
Normal file
BIN
bin/ObjectDetector.class
Normal file
Binary file not shown.
Binary file not shown.
43
src/ObjectDetector.java
Normal file
43
src/ObjectDetector.java
Normal 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...");
|
||||
}
|
||||
}
|
@ -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());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user