tflite_object detection

  1. https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/running_on_mobile_tensorflowlite.md  
  2.   
  3. export CONFIG_FILE=PATH_TO_BE_CONFIGURED/pipeline.configexport CHECKPOINT_PATH=PATH_TO_BE_CONFIGURED/model.ckptexport OUTPUT_DIR=/tmp/tflite  
  4.   
  5. object_detection/export_tflite_ssd_graph.py \  
  6. --pipeline_config_path=$CONFIG_FILE \  
  7. --trained_checkpoint_prefix=$CHECKPOINT_PATH \  
  8. --output_directory=$OUTPUT_DIR \  
  9. --add_postprocessing_op=true  
  10.   
  11. bazel run --config=opt tensorflow/lite/toco:toco -- \  
  12. --input_file=$OUTPUT_DIR/tflite_graph.pb \  
  13. --output_file=$OUTPUT_DIR/detect.tflite \  
  14. --input_shapes=1,300,300,3 \  
  15. --input_arrays=normalized_input_image_tensor \  
  16. --output_arrays='TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1','TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3' \  
  17. --inference_type=QUANTIZED_UINT8 \  
  18. --mean_values=128 \  
  19. --std_values=128 \  
  20. --change_concat_input_ranges=false \  
  21. --allow_custom_ops  
  22.   
  23. bazel run --config=opt tensorflow/lite/toco:toco -- \  
  24. --input_file=$OUTPUT_DIR/tflite_graph.pb \  
  25. --output_file=$OUTPUT_DIR/detect.tflite \  
  26. --input_shapes=1,300,300,3 \  
  27. --input_arrays=normalized_input_image_tensor \  
  28. --output_arrays='TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1','TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3'  \  
  29. --inference_type=FLOAT \  
  30. --allow_custom_ops  
  31.   
  32. cp /tmp/tflite/detect.tflite \  
  33. //tensorflow/lite/examples/android/app/src/main/assets  

你可能感兴趣的:(tensorflow,深度学习,html5)