Skip to content

Instantly share code, notes, and snippets.

@det-peralta
Last active April 5, 2019 10:46
Show Gist options
  • Save det-peralta/1af23d6134afa2298c6dccae027df128 to your computer and use it in GitHub Desktop.
Save det-peralta/1af23d6134afa2298c6dccae027df128 to your computer and use it in GitHub Desktop.
CONFIG_DIR='/config'
apt update
apt upgrade -y
apt-get install unzip git nano -y
cd /tmp
git clone --depth 1 https://github.com/tensorflow/models.git tensorflow-models
curl -OL https://github.com/google/protobuf/releases/download/v3.7.1/protoc-3.7.1-linux-x86_64.zip
curl -OL http://download.tensorflow.org/models/object_detection/faster_rcnn_inception_v2_coco_2018_01_28.tar.gz
tar -xzvf faster_rcnn_inception_v2_coco_2018_01_28.tar.gz
mv faster_rcnn_inception_v2_coco_2018_01_28 ${CONFIG_DIR}/tensorflow/
mkdir -p ${CONFIG_DIR}/tensorflow/object_detection
cd /tensorflow-models/research
unzip -a protoc-3.7.1-linux-x86_64.zip -d protobuf
mv protobuf/bin tensorflow-models/research
cd tensorflow-models/research/
./bin/protoc object_detection/protos/*.proto --python_out=.
touch ${CONFIG_DIR}/tensorflow/object_detection/__init__.py
mv object_detection/data ${CONFIG_DIR}/tensorflow/object_detection
mv object_detection/utils ${CONFIG_DIR}/tensorflow/object_detection
mv object_detection/protos ${CONFIG_DIR}/tensorflow/object_detection
@det-peralta
Copy link
Author

det-peralta commented Apr 5, 2019

curl -L https://gist.githubusercontent.com/det-peralta/1af23d6134afa2298c6dccae027df128/raw/ddce721e8889187ca3218871f185a6536e88f5dc/tensorflow_ha.sh | bash

@det-peralta
Copy link
Author

image_processing:
  - platform: tensorflow
    source:
      - entity_id: camera.hikvision_entrance
    model:
      graph: /config/tensorflow/frozen_inference_graph.pb
      categories:
        - person
        - car
        - truck
camera:
  - platform: ffmpeg
    name: hikvision_entrance
    input: rtsp://user:pass@ip:554/Streaming/Channels/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment