-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa52df3
commit e977f66
Showing
73 changed files
with
5,044 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v1.5.2 | ||
v1.5.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
select_live555_video | ||
disable amqp-stats | ||
remove_orphans | ||
enable live555 | ||
enable mcp | ||
enable rabbitmq | ||
enable sio | ||
select_example sio live555 | ||
up live555 | ||
up rabbitmq | ||
up mcp | ||
test_rtsp_stream rtsp://localhost:7554/data/my-video.mkv 5 | ||
restart sio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
# Standalone Folder Watcher Deployment of SIO | ||
# Standalone SIO sample | ||
|
||
In this example, SIO is deployed in a stand-alone manner, without a RabbitMQ broker or client processing the results. | ||
Instead, a pipeline extension is used to process and report the pipeline output. | ||
|
||
Contact [[email protected]](mailto:[email protected]) with any questions, and visit our [Developer Portal](https://dev.sighthound.com) for more information. | ||
|
||
|
||
## Running the sample | ||
## General | ||
|
||
Before getting started, you must copy your `sighthound-license.json` into the `./StandaloneSIOWithExtension/config/` folder. If you do not have a license, please contact [[email protected]](mailto:[email protected]). | ||
|
||
## Running the folder watcher sample | ||
|
||
Ensure `./StandaloneSIOWithExtension/data/input` exists prior to starting the service. | ||
|
||
Next, open a terminal, `cd` into the `./StandaloneSIOWithExtension/` folder, and run the following command to start the services: | ||
|
@@ -26,3 +28,18 @@ SIO_DOCKER_RUNTIME=nvidia docker compose up -d | |
|
||
You can then deposit images and videos into `./StandaloneSIOWithExtension/data/input` and watch the output being printed as those are being procesed. | ||
|
||
## Running the RTSP sample | ||
|
||
RTSP sample will consume the video feed via specified URL. The sample is packaged with a video file streamed from `live555` service container. | ||
You can remove that service from `docker-compose-rtsp` if pointing the configuration in `config/analytics/pipelines-rtsp.json` to a different RTSP URL. | ||
|
||
You start the sample in a manner similar to folder watcher sample, using `docker compose -f docker-compose-rtsp.yml up -d` command to start the service. | ||
|
||
This configuration also demonstrates how to adapt the pipeline to a particular camera view. In this case, we see cars driving on the street, | ||
cars making the right turn from the right lane and cars making the left turn from the left lane. | ||
For the cars on the street we almost never see their license plates; thus it makes most sense to exclude those entirely. This is done by setting `lptSkipCarsWithoutLPs` | ||
to `true`. The cars in the left lane may be seen or not, depending on whether there are cars in the right lane to occlude them. We expect that no one would want a | ||
camera deployed in such non-deterministic way - thus assuming that monitoring the right turn lane is the purpose of this camera. Setting filters in `boxFilter-rtsp.json` | ||
ensures we're not going to analyze objects outside of the bottom right quadrant ROI (`lp_roiFilter` accomplishes that), and won't analyze objects below size threshold (`vehicle_SizeFilter` | ||
and `lp_SizeFilter` filters accomplish that). | ||
|
28 changes: 28 additions & 0 deletions
28
deployment-examples/StandaloneSIOWithExtension/config/analytics/boxFilter-rtsp.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[ | ||
{ | ||
"name": "lp_roiFilter", | ||
"type" : "roi", | ||
"region" : [ 0.5, 0.5, 0.99999, 0.99999 ], | ||
"behavior": "boxInRoi", | ||
"classes": ["licenseplate"], | ||
"debug": false | ||
}, | ||
{ | ||
"name": "lp_SizeFilter", | ||
"type": "size", | ||
"subtype": "dimension", | ||
"max": 0, | ||
"min": 30, | ||
"classes": ["licenseplate", "motorbike"], | ||
"debug": false | ||
}, | ||
{ | ||
"name": "vehicle_SizeFilter", | ||
"type": "size", | ||
"subtype": "dimension", | ||
"max": 0, | ||
"min": 40, | ||
"classes": ["car", "bus", "truck"], | ||
"debug": false | ||
} | ||
] |
26 changes: 26 additions & 0 deletions
26
deployment-examples/StandaloneSIOWithExtension/config/analytics/pipelines-rtsp.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"unifiedEU-US" : { | ||
"pipeline" : "./share/pipelines/VehicleAnalytics/VehicleAnalyticsRTSP.yaml", | ||
"restartPolicy" : "restart", | ||
"parameters" : { | ||
"VIDEO_IN" : "rtsp://live555_svc:554/Turn-02.mkv", | ||
"boxFilterConfig" : "/config/analytics/boxFilter-rtsp.json", | ||
"detectionModel" : "gen6es", | ||
"lptFilter" : "['us']", | ||
"mmcFilter" : "['us']", | ||
"lptMinConfidence" : "0.5", | ||
"sourceId" : "fw-1", | ||
"lptPreferAccuracyToSpeed" : "true", | ||
"extensionModules" : "/config/analytics/extension.py", | ||
"extensionConfigurations" : "/config/analytics/extensionConfig1.json", | ||
"useTracker" : "true", | ||
"updateOnlyOnChange" : "true", | ||
"lptStabilizationDelay" : "5", | ||
"updateOnImprovedScore" : "true", | ||
"debugSettings" : "log,json", | ||
"lptSkipCarsWithoutLPs" : "true" | ||
}, | ||
"disabledParameters" : { | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
deployment-examples/StandaloneSIOWithExtension/docker-compose-rtsp.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
version: "2.3" | ||
services: | ||
|
||
# By default pipelines.json will point to streams served by this container. | ||
# If you point to your own cameras or streams, this container has no other | ||
# function and can be disabled. | ||
live555_svc: | ||
image: us-central1-docker.pkg.dev/ext-edge-analytics/docker/live555:2.0.4-examples | ||
container_name: sample-live555 | ||
restart: unless-stopped | ||
ports: | ||
- "8554:554" | ||
|
||
|
||
analytics: | ||
image: us-central1-docker.pkg.dev/ext-edge-analytics/docker/sio:${SIO_RELEASE-r231120}${SIO_DOCKER_TAG_VARIANT} | ||
restart: unless-stopped | ||
environment: | ||
# Location where SIO will place generated model engine files | ||
- SIO_DATA_DIR=/data/sio-cache | ||
# We need this to see output from Python extension module | ||
- PYTHONUNBUFFERED=1 | ||
# Container runtime defaults to `runc` if SIO_DOCKER_RUNTIME not set. Use `nvidia` if GPU is installed. | ||
runtime: ${SIO_DOCKER_RUNTIME-runc} | ||
volumes: | ||
# Read-only shared folder for data exchange with host / other containers. | ||
# We'll use it for license, config files, etc. | ||
- ./config:/config:ro | ||
# Writable shared folder for data exchange with host | ||
# We'll use it for storing the generated model files, data exchange folder, etc. | ||
- ./data:/data | ||
entrypoint: | ||
- /sighthound/sio/bin/runPipelineSet | ||
# Pipeline configuration file | ||
- /config/analytics/pipelines-rtsp.json | ||
# License at the path accessible in the container | ||
- --license-path=/config/sighthound-license.json | ||
# Log level (info, debug, trace) | ||
- --log=${SIO_LOG_LEVEL-info} | ||
depends_on: | ||
# This dependency can be removed with live555 if no longer necessary. | ||
- live555_svc | ||
|
4 changes: 2 additions & 2 deletions
4
deployment-examples/StandaloneSIOWithExtension/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Use an official Python runtime as a parent image | ||
FROM python:3.8-slim-buster | ||
|
||
# Working directory | ||
WORKDIR /app | ||
|
||
# Install dependencies | ||
COPY requirements.txt /app/ | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the application into the container | ||
# COPY ../lib/ /app/lib | ||
COPY ./src/ /app/ | ||
|
||
# Make port 5000 available | ||
EXPOSE 5000 | ||
ENV PYTHONPATH=${PYTHONPATH}:/app/:/app/lib/ | ||
# TERM environment variable not set. | ||
ENV TERM=xterm-256color | ||
|
||
# Run app.py when the container launches | ||
CMD ["python", "app.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Aqueduct API | ||
|
||
This is a Flask-based API to manage video analytics pipelines. The API provides functionalities to start, stop, delete, and fetch the status of pipelines. | ||
|
||
## Features | ||
- Start Pipeline: Initialize a new pipeline with specified parameters. | ||
- Stop Pipeline: Terminate an existing pipeline. | ||
- Delete Pipeline: Remove an existing pipeline. | ||
- Fetch Status: Retrieve the status of all pipelines or a single pipeline. | ||
|
||
## How to run | ||
First start all the dependencies: | ||
```bash | ||
./scripts sh-services apply ./examples/AqueductAPI/aqueduct.conf | ||
cd ./examples/AqueductAPI | ||
``` | ||
|
||
And then build and run the Docker Compose: | ||
```bash | ||
docker compose build | ||
docker compose up | ||
``` | ||
|
||
Your API should now be accessible at http://localhost:8888. | ||
|
||
## API Endpoints | ||
- POST `/pipelines/start`: Starts a new pipeline. | ||
- POST `/pipelines/stop`: Stops an existing pipeline. | ||
- POST `/pipelines/delete`: Deletes an existing pipeline. | ||
- GET `/pipelines/status`: Gets the status of all pipelines. | ||
- GET `/pipelines/status/<string:sourceId>`: Gets the status of a specific pipeline. | ||
- GET `/health`: Health check. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
select_live555_video | ||
disable amqp-stats | ||
remove_orphans | ||
enable live555 | ||
enable mcp | ||
enable rabbitmq | ||
enable sio | ||
select_example sio aqueduct | ||
up live555 | ||
up rabbitmq | ||
up mcp | ||
test_rtsp_stream rtsp://localhost:7554/data/my-video.mkv 5 | ||
restart sio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: "2" | ||
|
||
services: | ||
aqueduct-api: | ||
build: . | ||
restart: unless-stopped | ||
volumes: | ||
- ../lib:/app/lib | ||
- ../../..:/data/sighthound | ||
- ./src:/app | ||
ports: | ||
- "8888:8888" | ||
networks: | ||
core_sighthound: | ||
aliases: | ||
- aqueduct-api | ||
|
||
networks: | ||
core_sighthound: | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Flask==1.1.2 | ||
flask-restx==1.1.0 | ||
flask-cors==3.0.10 | ||
pika==1.2.0 | ||
jinja2==2.11.2 | ||
markupsafe==1.1.1 | ||
itsdangerous==1.1.0 | ||
werkzeug==2.0.3 | ||
tabulate==0.8.9 |
Oops, something went wrong.