How do I pass an OpenCV Mat into a C++ Tensorflow graph?

前端 未结 4 1867
天涯浪人
天涯浪人 2020-12-14 10:08

In Tensorflow C++ I can load an image file into the graph using

tensorflow::Node* file_reader =  tensorflow::ops::ReadFile(tensorflow::ops::Const(IMAGE_FILE_         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-14 10:20

    I had tried to run inception model on the opencv Mat file and following code worked for me https://gist.github.com/kyrs/9adf86366e9e4f04addb. Although there are some issue with integration of opencv and tensorflow. Code worked without any issue for .png files but failed to load .jpg and .jpeg. You can follow this for more info https://github.com/tensorflow/tensorflow/issues/1924

提交回复
热议问题