|
il y a 6 ans | |
---|---|---|
config | il y a 6 ans | |
frigate | il y a 6 ans | |
.dockerignore | il y a 6 ans | |
.gitignore | il y a 6 ans | |
Dockerfile | il y a 6 ans | |
LICENSE | il y a 6 ans | |
README.md | il y a 6 ans | |
detect_objects.py | il y a 6 ans |
This results in a MJPEG stream with objects identified that has a lower latency than directly viewing the RTSP feed with VLC.
Build the container with
docker build -t realtime-od .
Download a model from the zoo.
Download the cooresponding label map from here.
Run the container with
docker run --rm \
-v <path_to_frozen_detection_graph.pb>:/frozen_inference_graph.pb:ro \
-v <path_to_labelmap.pbtext>:/label_map.pbtext:ro \
-p 5000:5000 \
-e RTSP_URL='<rtsp_url>' \
-e REGIONS='<box_size_1>,<x_offset_1>,<y_offset_1>,<min_person_size_1>,<min_motion_size_1>,<mask_file_1>:<box_size_2>,<x_offset_2>,<y_offset_2>,<min_person_size_2>,<min_motion_size_2>,<mask_file_2>' \
-e MQTT_HOST='your.mqtthost.com' \
-e MQTT_MOTION_TOPIC='cameras/1/motion' \
-e MQTT_OBJECT_TOPIC='cameras/1/objects' \
-e MQTT_OBJECT_CLASSES='person,car,truck' \
realtime-od:latest
Access the mjpeg stream at http://localhost:5000
https://www.tensorflow.org/install/source#docker_linux_builds
used tensorflow/tensorflow:1.12.0-devel-py3
docker run -it -v ${PWD}:/lab -v ${PWD}/../back_camera_model/models/ssd_mobilenet_v2_coco_2018_03_29/frozen_inference_graph.pb:/frozen_inference_graph.pb:ro tensorflow/tensorflow:1.12.0-devel-py3 bash
bazel build tensorflow/tools/graph_transforms:transform_graph
bazel-bin/tensorflow/tools/graph_transforms/transform_graph \
--in_graph=/frozen_inference_graph.pb \
--out_graph=/lab/optimized_inception_graph.pb \
--inputs='image_tensor' \
--outputs='num_detections,detection_scores,detection_boxes,detection_classes' \
--transforms='
strip_unused_nodes(type=float, shape="1,300,300,3")
remove_nodes(op=Identity, op=CheckNumerics)
fold_constants(ignore_errors=true)
fold_batch_norms
fold_old_batch_norms'