memo / ofxMSATensorFlow

C++ openframeworks addon and examples integrating Google's TensorFlow numerical computation and machine learning library
Apache License 2.0
456 stars 87 forks source link

Object Detection example, help #35

Open ThomasLengeling opened 6 years ago

ThomasLengeling commented 6 years ago

I am trying to use the image classifier class for object detection (https://github.com/tensorflow/models/tree/master/research/object_detection)

But I am having problems loading the model, I am not quite sure how to change the image classifier to be able to detect objects. I am using the pertained models from https://github.com/GoogleCloudPlatform/tensorflow-object-detection-example and modifying the code from the ImageClasigierr example.

I am trying to follow this code which computes a tensorflow object detection model. https://github.com/tensorflow/models/issues/1741

but I am getting an error when loading the model and this part of the code https://github.com/memo/ofxMSATensorFlow/blob/512a6e9a929e397c0bddf8bf86ea7521a22dd593/src/ofxMSATFImageClassifier.cpp#L168

[ error ] ofxMSATensorFlow: Error during running. Check console for details.
  settings.image_dims = {299, 299, 3};
  settings.itensor_dims = {1, 299, 299, 3};
  settings.model_path = "models/frozen_inference_graph.pb";
  settings.labels_path = "models/tensorflow_apple.txt";

  settings.input_layer_name = "image_tensor:0";
  settings.output_layer_name = {"detection_boxes:0", "detection_scores:0",
                                "detection_classes:0", "num_detections:0"};
  settings.dropout_layer_name = "";
  settings.varconst_layer_suffix = "";
  settings.norm_mean = 0.0f;
  settings.norm_stddev = 255.0f;

any suggestions?

I very much appreciate your time for this great addon.