Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #53 from intel/v0.4.1-beta-release
Browse files Browse the repository at this point in the history
V0.4.1 beta release
  • Loading branch information
tobiasmo1 committed Jan 23, 2021
2 parents e0d3dc2 + bf7a06b commit e949055
Show file tree
Hide file tree
Showing 61 changed files with 3,436 additions and 1,726 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ docker/Dockerfile.env
docker/final.env
models
tests/results/**/*
samples/lva_ai_extension/tests/results/**/*
40 changes: 10 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The sample microservice includes three media analytics pipelines.

| | |
|---------------------------------------------|---------|
| **object_detection** | Detect and label objects such as bottles and bicycles.
| **object_detection** | Detect and label objects such as bottles and bicycles.
| **emotion_recognition** | Detect the emotions of a person within a video stream.
| **audio_detection** | Analyze audio streams for events such as breaking glass or barking dogs.

Expand All @@ -54,11 +54,6 @@ Build the sample microservice with the following command:

The script will automatically include the sample models, pipelines and
required dependencies.
> **Note:** When running this command for the first time, the default
> base image for Video Analytics Serving will take a long time to
> build (likely over an hour). For instructions on how to re-use
> pre-built base images to speed up the build time please see the
> following [documentation](docs/building_video_analytics_serving.md#using-pre-built-media-analytics-base-images).

To verify the build succeeded execute the following command:

Expand All @@ -70,7 +65,7 @@ Expected output:

```bash
REPOSITORY TAG IMAGE ID CREATED SIZE
video-analytics-serving-gstreamer latest f51f2695639f 2 minutes ago 1.39GB
video-analytics-serving-gstreamer latest f51f2695639f 2 minutes ago 3.03GB
```

## Running the Microservice
Expand Down Expand Up @@ -104,7 +99,7 @@ Expected output:
{"levelname": "INFO", "asctime": "2020-08-06 12:37:13,333", "message": "Starting Tornado Server on port: 8080", "module": "__main__"}
```

## Detecting Objects in a Video <br/> <br/>
## Detecting Objects in a Video <br/> <br/>

### Example Request:

Expand Down Expand Up @@ -161,7 +156,7 @@ Start a new shell and execute the following command to issue an HTTP POST reques
```bash
curl localhost:8080/pipelines/object_detection/1 -X POST -H \
'Content-Type: application/json' -d \
'{
'{
"source": {
"uri": "https://github.com/intel-iot-devkit/sample-videos/blob/master/bottle-detection.mp4?raw=true",
"type": "uri"
Expand Down Expand Up @@ -285,7 +280,7 @@ Start a new shell and execute the following command to issue an HTTP POST reques
```bash
curl localhost:8080/pipelines/emotion_recognition/1 -X POST -H \
'Content-Type: application/json' -d \
'{
'{
"source": {
"uri": "https://github.com/intel-iot-devkit/sample-videos/blob/master/head-pose-face-detection-male.mp4?raw=true",
"type": "uri"
Expand Down Expand Up @@ -355,7 +350,7 @@ After pretty-printing:
<details>
<summary>Audio Event Detection</summary>

## Detecting Audio Events in an Audio Recording
## Detecting Audio Events in an Audio Recording

### Example Request:

Expand Down Expand Up @@ -411,7 +406,7 @@ Start a new shell and execute the following command to issue an HTTP POST reques
```bash
curl localhost:8080/pipelines/audio_detection/1 -X POST -H \
'Content-Type: application/json' -d \
'{
'{
"source": {
"uri": "https://github.com/opencv/gst-video-analytics/blob/preview/audio-detect/samples/gst_launch/audio_detect/how_are_you_doing.wav?raw=true",
"type": "uri"
Expand Down Expand Up @@ -477,24 +472,9 @@ After pretty-printing:
| ------------ | ------------------ | -----------------|
| **-** [GStreamer](https://gstreamer.freedesktop.org/documentation/?gi-language=c)* <br/> **-** [GStreamer* Overview](docs/gstreamer_overview.md) <br/> **-** [FFmpeg](https://ffmpeg.org/)* | **-** [OpenVINO<sup>&#8482;</sup> Toolkit](https://software.intel.com/content/www/us/en/develop/tools/openvino-toolkit.html) <br/> **-** [OpenVINO<sup>&#8482;</sup> Toolkit DL Streamer](https://github.com/opencv/gst-video-analytics) <br/> **-** [FFmpeg* Video Analytics](https://github.com/VCDP/FFmpeg-patch) | **-** [Open Visual Cloud Smart City Sample](https://github.com/OpenVisualCloud/Smart-City-Sample) <br/> **-** [Open Visual Cloud Ad-Insertion Sample](https://github.com/OpenVisualCloud/Ad-Insertion-Sample) <br/> **-** [Edge Insights for Retail](https://software.intel.com/content/www/us/en/develop/articles/real-time-sensor-fusion-for-loss-detection.html)

---
\* Other names and brands may be claimed as the property of others.

# Known Issues
## Default GStreamer Build Fails
If the build fails with the error `ModuleNotFoundError: No module named 'skbuild'`
follow instructions in this [github issue](https://github.com/intel/video-analytics-serving/issues/25) for a workaround.

## Service Will Not Start Due to Missing Audio Plugin
`GStreamer` framework base images are expected to include the
[audio detection inference](https://github.com/opencv/gst-video-analytics/wiki/gvaaudiodetect) plugin `libgstaudioanalytics.so`. If this plugin is missing the audio detection pipeline will not load, see error message below, and the Video Analytics Serving service will not start.
```
{"levelname": "ERROR", "asctime": "2020-08-26 01:49:40,114", "message": "Failed to Load Pipeline from: /home/video-analytics-serving/pipelines/audio_detection/1/pipeline.json", "module": "pipeline_manager"}
```
Currently this plugin is only present in the DL Streamer audio preview so will be not be in any base images obtained from dockerhub.
Thus GStreamer images based on Open Visual Cloud or OpenVINO<sup>&#8482;</sup> will exhibit this problem.
Known issues are tracked on [GitHub](https://github.com/intel/video-analytics-serving/issues)*

As a workaround you can configure the service to ignore initialization errors when you start it.
```bash
docker/run.sh -v /tmp:/tmp -e IGNORE_INIT_ERRORS=True
```
---
\* Other names and brands may be claimed as the property of others.
30 changes: 19 additions & 11 deletions docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ PIPELINES=
FRAMEWORK="gstreamer"
TAG=
RUN_PREFIX=
DRY_RUN=
CREATE_SERVICE=TRUE
ENVIRONMENT_FILES=()
DOCKER_RUN_ENVIRONMENT=$(env | cut -f1 -d= | grep -E '_(proxy)$' | sed 's/^/-e / ' | tr '\n' ' ')
Expand Down Expand Up @@ -109,7 +110,7 @@ get_options() {
;;
--models)
if [ "$2" ]; then
MODELS=$(realpath $2)
MODELS=$2
shift
else
error 'ERROR: "--models" requires an argument.'
Expand Down Expand Up @@ -192,6 +193,7 @@ get_options() {
;;
--dry-run)
RUN_PREFIX="echo"
DRY_RUN="--dry-run"
echo ""
echo "=============================="
echo "DRY RUN: COMMANDS PRINTED ONLY"
Expand All @@ -218,6 +220,8 @@ get_options() {

if [ "${MODELS^^}" == "NONE" ]; then
MODELS=
else
MODELS=$(realpath $MODELS)
fi

if [ $FRAMEWORK != 'gstreamer' ] && [ $FRAMEWORK != 'ffmpeg' ]; then
Expand All @@ -234,9 +238,6 @@ get_options() {
fi

if [ -f "$MODELS" ]; then
YML_DIR=$(dirname "${MODELS}")
YML_FILE_NAME=$(basename "${MODELS}")
VOLUME_MOUNT+="-v $SOURCE_DIR:/home/video-analytics-serving -v $YML_DIR:/models_yml"

if [[ ! " ${SUPPORTED_IMAGES[@]} " =~ " ${BASE_IMAGE} " ]]; then
if [ -z "$OPEN_MODEL_ZOO_VERSION" ]; then
Expand All @@ -245,16 +246,22 @@ get_options() {
else
OPEN_MODEL_ZOO_VERSION=2021.1
fi

$RUN_PREFIX docker run -t --rm $DOCKER_RUN_ENVIRONMENT --user "$UID" --entrypoint /bin/bash $VOLUME_MOUNT openvino/ubuntu18_data_dev:$OPEN_MODEL_ZOO_VERSION "-i" "-c" "pip3 install jsonschema==3.2.0; python3 /home/video-analytics-serving/tools/model_downloader --model-list /models_yml/$YML_FILE_NAME --output-dir /home/video-analytics-serving/ $FORCE_MODEL_DOWNLOAD"


if [ ! -d "$SOURCE_DIR/models" ]; then
$RUN_PREFIX mkdir $SOURCE_DIR/models
fi

$SOURCE_DIR/tools/model_downloader/model_downloader.sh --model-list $MODELS --output $SOURCE_DIR $FORCE_MODEL_DOWNLOAD --open-model-zoo-version $OPEN_MODEL_ZOO_VERSION $DRY_RUN

elif [ -d "$MODELS" ]; then
if [ ! -d "$SOURCE_DIR/models" ]; then
mkdir $SOURCE_DIR/models
$RUN_PREFIX mkdir $SOURCE_DIR/models
fi
cp -R $MODELS/. $SOURCE_DIR/models
$RUN_PREFIX cp -R $MODELS/. $SOURCE_DIR/models
else
error 'ERROR: "'$MODELS'" does not exist.'
if [ -n "$MODELS" ]; then
error 'ERROR: "'$MODELS'" does not exist.'
fi
fi

if [ -z "$PIPELINES" ]; then
Expand Down Expand Up @@ -367,7 +374,7 @@ if [ "$BASE" == "BUILD" ]; then
BASE_IMAGE=$BASE_BUILD_TAG
else
#Ensure image is latest from Docker Hub
launch "$RUN_PREFIX docker pull $BASE_IMAGE"
launch "$RUN_PREFIX docker pull ${CACHE_PREFIX}$BASE_IMAGE"
fi

# BUILD IMAGE
Expand Down Expand Up @@ -410,6 +417,7 @@ done

if [ ! -z "$ENVIRONMENT_FILE_LIST" ]; then
cat $ENVIRONMENT_FILE_LIST | grep -E '=' | tr '\n' ' ' | tr '\r' ' ' > $DOCKERFILE_DIR/final.env
echo " HOME=/home/video-analytics-serving " >> $DOCKERFILE_DIR/final.env
echo "ENV " | cat - $DOCKERFILE_DIR/final.env | tr -d '\n' >> $DOCKERFILE_DIR/Dockerfile.env
fi

Expand Down
Loading

0 comments on commit e949055

Please sign in to comment.