项目作者: haosen9527

项目描述 :
About object detection(mobileNet-ssd) tensorflow/language:c++
高级语言: C++
项目地址: git://github.com/haosen9527/mobileNet-ssd.git
创建时间: 2019-04-11T00:45:53Z
项目社区:https://github.com/haosen9527/mobileNet-ssd

开源协议:

下载


mobileNet-ssd

ABOUT

  • mobilenet ssd
  • tensorflow /c++/python
  • catkin_make

    INSTALL

    1. cd mobileNet-ssd
    2. catkin_make

    RUN

  • tensorflow c++
    1. rosrun mobileNet mobileNet_pb
    2. or
    3. ./devel/lib/mobileNet/mobileNet_pb
  • opencv dnn
    1. rosrun mobileNet mobileNet_opencv
    2. or
    3. ./devel/lib/mobileNet/mobileNet_opencv
  • python
    1. python src/mobileNet/python/ssd-mobilenet.py

    tensorflow模型预测对比总结

    将通过以下的方法进行模型预测部分的实现

  • Tensorflow c++
  • Tensorflow python
  • Opencv dnn

    对比分析内容

  • 图片输入说明(图片加载)
    • Tensorflow c++ :
      1. tensorflow ops::ReadFile/DecodePng
    • Tensorflow python :
      1. load_image_into_numpy_array(numpy)
    • Opencv dnn :
      1. cv::imread(imagePath)
  • 模型加载说明
    • Tensorflow c++ :
      1. Status status = ReadBinaryProto(Env::Default(),MODEL_PATH,&graph_def);
    • Tensorflow python:
      1. with gfile.FastGFile(PATH_TO_PB) as f:
      2. graph_def = tf.GraphDef()
      3. graph_def.ParseFromString(f.read())
      4. sess.graph.as_default()
      5. tf.import_graph_def(graph_def,name='')
      6. or
      7. with open(PATH_TO_PB) as f:
      8. graph_def = tf.GraphDef()
      9. .......
    • opencv DNN :
      1. dnn::Net net = cv::dnn::readNetFromTensorflow(weights, prototxt);

      时间对比:

    • Opencvdnn :detection time: 618.522 ms
    • Tensorflow c++ :detection time:699.195 ms
    • Tensorflow python : detection time : 5916.458 ms

      效果展示

  • Tensorflow c++

    tensorflow-c++
  • Tensorflow python

    python
  • Opencv dnn

    opencv