Hello, instead of importing a darknet model(works) i want to try out a tensor flow model. Importing the model works - but the mat with the detection results is always empty. Is maybe my data corrupt(was hard to get the pbtxt file as the tensorflow zoo dont includes them and other way to generate failed for me)? Here my code:
String basePath = "C:\\development\\models\\opencv_tensor\\ssd_mobilenet_v1_coco_11_06_2017\\";
String model = basePath + "frozen_inference_graph.pb";
String config = basePath + "ssd_mobilenet_v1_coco.pbtxt";
String classes = basePath + "mscoco_label_map.txt";
try {
classNames = Files.readAllLines(Paths.get(classes));
} catch (IOException e) {
throw new RuntimeException(e);
}
Mat img = imread("car.png");
Mat blob = blobFromImage(img);
net = readNetFromTensorflow(model, config);
net.setInput(blob);
Mat detectionMat = net.forward();
System.err.println("detectionMat rows: " + detectionMat.rows());
System.err.println("detectionMat: " + detectionMat.cols());
Any help is highly welcome. Greetings, Holger