Skip to content

Commit

Permalink
feat: spike for replicas docker-compose adding gst and capi ovms prof…
Browse files Browse the repository at this point in the history
…iles test cases (intel-retail#470)

* feat: spike for replicas docker-compose adding gst and capi ovms profiles test cases
* fix: update gstreamer scripts and docker-compose to work for replicas

Signed-off-by: Jim Wang <[email protected]>

* feat: add CAPI-yolov5 for replicas docker-compose

Signed-off-by: Jim Wang <[email protected]>

* feat: add and update capi_yolov5_ensemble replicas docker-compose

Signed-off-by: Jim Wang <[email protected]>

* feat: add capi-face-detection replicas docker-compose

Signed-off-by: Jim Wang <[email protected]>

---------

Signed-off-by: Jim Wang <[email protected]>
  • Loading branch information
jim-wang-intel authored Jan 30, 2024
1 parent 4967b7e commit 5b3ca4e
Show file tree
Hide file tree
Showing 18 changed files with 817 additions and 81 deletions.
3 changes: 3 additions & 0 deletions Dockerfile.dlstreamer
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ USER root

FROM base as build-default
COPY ./requirements.txt /requirements.txt
COPY ./configs/opencv-ovms/gst /opencv-ovms/gst
COPY ./configs/opencv-ovms/scripts/run_gst.sh /opencv-ovms/scripts/run_gst.sh
COPY ./configs/opencv-ovms/scripts/docker_compose_generic_entrypoint.sh /opencv-ovms/scripts/docker_compose_generic_entrypoint.sh
RUN pip3 install --upgrade pip --no-cache-dir -r /requirements.txt
WORKDIR /

Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

MKDOCS_IMAGE ?= asc-mkdocs
DGPU_TYPE ?= arc # arc|flex
DOCKER_COMPOSE ?= docker-compose.yml

build-dlstreamer:
docker build --no-cache --build-arg HTTPS_PROXY=${HTTPS_PROXY} --build-arg HTTP_PROXY=${HTTP_PROXY} --target build-default -t dlstreamer:dev -f Dockerfile.dlstreamer .
Expand All @@ -41,7 +42,7 @@ run-portainer:

run-pipelines:
@./scripts/gen_ovms_model_config_json.sh
docker compose -f docker-compose.yml up -d
docker compose -f $(DOCKER_COMPOSE) up -d

clean:
./clean-containers.sh automated-self-checkout
Expand Down Expand Up @@ -114,7 +115,7 @@ down-portainer:
docker compose -p portainer -f docker-compose-portainer.yml down

down-pipelines:
docker compose -f docker-compose.yml down
docker compose -f $(DOCKER_COMPOSE) down
@if [ -f ./configs/opencv-ovms/models/2022/config.json ]; then rm ./configs/opencv-ovms/models/2022/config.json; fi;

clean-all: clean clean-ovms clean-simulator clean-results clean-telegraf clean-webcam down-pipelines
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ then
fi

echo "Note: Pipeline log and results are available at location - ./results"
# generate unique container id based on the date with the precision upto nano-seconds
cid=$(date +%Y%m%d%H%M%S%N)
echo "cid: $cid"

python3 classification/python/classification_demo.py -m localhost:"$GRPC_PORT"/models/"$CLASSIFICATION_MODEL_NAME" \
--label classification/python/labels/"$CLASSIFICATION_LABEL_FILE" -i $INPUTSRC \
--adapter ovms --output_resolution "$CLASSIFICATION_OUTPUT_RESOLUTION" $mqttArgs 2>&1 | tee >/tmp/results/r$cid_count.jsonl >(stdbuf -oL sed -n -e 's/^.*fps: //p' | stdbuf -oL cut -d , -f 1 > /tmp/results/pipeline$cid_count.log)
--adapter ovms --output_resolution "$CLASSIFICATION_OUTPUT_RESOLUTION" $mqttArgs 2>&1 | tee >/tmp/results/r$cid"_classification".jsonl >(stdbuf -oL sed -n -e 's/^.*fps: //p' | stdbuf -oL cut -d , -f 1 > /tmp/results/pipeline$cid"_classification".log)
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ then
fi

echo "Note: Pipeline log and results are available at location - ./results"
# generate unique container id based on the date with the precision upto nano-seconds
cid=$(date +%Y%m%d%H%M%S%N)
echo "cid: $cid"

python3 object_detection/python/object_detection_demo.py -m localhost:"$GRPC_PORT"/models/"$DETECTION_MODEL_NAME" \
--label object_detection/python/labels/"$DETECTION_LABEL_FILE" -i "$INPUTSRC" \
--adapter ovms -t "$DETECTION_THRESHOLD" -at "$DETECTION_ARCHITECTURE_TYPE" --output_resolution "$DETECTION_OUTPUT_RESOLUTION" \
$mqttArgs 2>&1 | tee >/tmp/results/r$cid_count.jsonl >(stdbuf -oL sed -n -e 's/^.*fps: //p' | stdbuf -oL cut -d , -f 1 > /tmp/results/pipeline$cid_count.log)
$mqttArgs 2>&1 | tee >/tmp/results/r$cid"_object_detection".jsonl >(stdbuf -oL sed -n -e 's/^.*fps: //p' | stdbuf -oL cut -d , -f 1 > /tmp/results/pipeline$cid"_object_detection".log)
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ else
OUTPUT="${OUTPUT:="! fpsdisplaysink video-sink=fakesink sync=true --verbose"}"
fi

# generate unique container id based on the date with the precision upto nano-seconds
cid=$(date +%Y%m%d%H%M%S%N)
echo "cid: $cid"

echo "Run yolov5s pipeline"

gstLaunchCmd="GST_DEBUG=\"GST_TRACER:7\" GST_TRACERS=\"latency_tracer(flags=pipeline,interval=100)\" gst-launch-1.0 $inputsrc ! $DECODE ! gvadetect model-instance-id=odmodel name=detection model=models/yolov5s/FP16-INT8/1/yolov5s.xml model-proc=models/yolov5s/FP16-INT8/1/yolov5s.json threshold=.5 device=$DEVICE $PRE_PROCESS ! $AGGREGATE gvametaconvert name=metaconvert add-empty-results=true ! gvametapublish name=destination file-format=2 file-path=/tmp/results/r$cid_count.jsonl $OUTPUT 2>&1 | tee >/tmp/results/gst-launch_$cid_count.log >(stdbuf -oL sed -n -e 's/^.*current: //p' | stdbuf -oL cut -d , -f 1 > /tmp/results/pipeline$cid_count.log)"
gstLaunchCmd="GST_DEBUG=\"GST_TRACER:7\" GST_TRACERS=\"latency_tracer(flags=pipeline,interval=100)\" gst-launch-1.0 $inputsrc ! $DECODE ! gvadetect model-instance-id=odmodel name=detection model=models/yolov5s/FP16-INT8/1/yolov5s.xml model-proc=models/yolov5s/FP16-INT8/1/yolov5s.json threshold=.5 device=$DEVICE $PRE_PROCESS ! $AGGREGATE gvametaconvert name=metaconvert add-empty-results=true ! gvametapublish name=destination file-format=2 file-path=/tmp/results/r$cid\"_gst\".jsonl $OUTPUT 2>&1 | tee >/tmp/results/gst-launch_$cid\"_gst\".log >(stdbuf -oL sed -n -e 's/^.*current: //p' | stdbuf -oL cut -d , -f 1 > /tmp/results/pipeline$cid\"_gst\".log)"

echo "$gstLaunchCmd"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ else
OUTPUT="${OUTPUT:="! fpsdisplaysink video-sink=fakesink sync=true --verbose"}"
fi

# generate unique container id based on the date with the precision upto nano-seconds
cid=$(date +%Y%m%d%H%M%S%N)
echo "cid: $cid"

echo "Run run yolov5s with efficientnet classification pipeline"
gstLaunchCmd="gst-launch-1.0 $inputsrc ! $DECODE ! gvadetect model-instance-id=odmodel name=detection model=/home/pipeline-server/models/yolov5s/FP16-INT8/1/yolov5s.xml model-proc=/home/pipeline-server/models/yolov5s/FP16-INT8/1/yolov5s.json threshold=.5 device=$DEVICE $PRE_PROCESS $DETECTION_OPTIONS ! gvatrack name=tracking tracking-type=zero-term-imageless ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=0 ! gvaclassify model-instance-id=clasifier labels=/home/pipeline-server/models/efficientnet-b0/1/imagenet_2012.txt model=/home/pipeline-server/models/efficientnet-b0/FP32-INT8/1/efficientnet-b0.xml model-proc=/home/pipeline-server/models/efficientnet-b0/efficientnet-b0.json device=$DEVICE inference-region=roi-list name=classification $PRE_PROCESS $CLASSIFICATION_OPTIONS ! gvametaconvert name=metaconvert add-empty-results=true ! gvametapublish name=destination file-format=2 file-path=/tmp/results/r$cid_count.jsonl $OUTPUT 2>&1 | tee >/tmp/results/gst_launch$cid_count.log >(stdbuf -oL sed -n -e 's/^.*current: //p' | stdbuf -oL cut -d , -f 1 > /tmp/results/pipeline$cid_count.log)"
gstLaunchCmd="gst-launch-1.0 $inputsrc ! $DECODE ! gvadetect model-instance-id=odmodel name=detection model=/home/pipeline-server/models/yolov5s/FP16-INT8/1/yolov5s.xml model-proc=/home/pipeline-server/models/yolov5s/FP16-INT8/1/yolov5s.json threshold=.5 device=$DEVICE $PRE_PROCESS $DETECTION_OPTIONS ! gvatrack name=tracking tracking-type=zero-term-imageless ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=0 ! gvaclassify model-instance-id=clasifier labels=/home/pipeline-server/models/efficientnet-b0/1/imagenet_2012.txt model=/home/pipeline-server/models/efficientnet-b0/FP32-INT8/1/efficientnet-b0.xml model-proc=/home/pipeline-server/models/efficientnet-b0/efficientnet-b0.json device=$DEVICE inference-region=roi-list name=classification $PRE_PROCESS $CLASSIFICATION_OPTIONS ! gvametaconvert name=metaconvert add-empty-results=true ! gvametapublish name=destination file-format=2 file-path=/tmp/results/r$cid\"_gst\".jsonl $OUTPUT 2>&1 | tee >/tmp/results/gst_launch$cid\"_gst\".log >(stdbuf -oL sed -n -e 's/^.*current: //p' | stdbuf -oL cut -d , -f 1 > /tmp/results/pipeline$cid\"_gst\".log)"

echo "$gstLaunchCmd"

eval $gstLaunchCmd
eval $gstLaunchCmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ else
OUTPUT="${OUTPUT:="! fpsdisplaysink video-sink=fakesink sync=true --verbose"}"
fi

# generate unique container id based on the date with the precision upto nano-seconds
cid=$(date +%Y%m%d%H%M%S%N)
echo "cid: $cid"

echo "Run yolov5s with efficientnet classification, horizontal text detection, and barcode detection pipeline"
gstLaunchCmd="gst-launch-1.0 $inputsrc ! $DECODE $VA_SURFACE ! gvadetect model-instance-id=odmodel name=detection model=/home/pipeline-server/models/yolov5s/FP16-INT8/1/yolov5s.xml model-proc=/home/pipeline-server/models/yolov5s/FP16-INT8/1/yolov5s.json threshold=.5 device=$DEVICE $PRE_PROCESS $DETECTION_OPTIONS gpu-throughput-streams=4 nireq=4 batch-size=1 ! gvatrack name=tracking tracking-type=zero-term-imageless $PARALLEL_PIPELINE ! gvaclassify model-instance-id=clasifier labels=/home/pipeline-server/models/efficientnet-b0/1/imagenet_2012.txt model=/home/pipeline-server/models/efficientnet-b0/FP32-INT8/1/efficientnet-b0.xml model-proc=/home/pipeline-server/models/efficientnet-b0/efficientnet-b0.json reclassify-interval=1 device=$DEVICE inference-region=roi-list name=classification $PRE_PROCESS reclassify_interval=$OCR_RECLASSIFY_INTERVAL batch-size=8 nireq=4 gpu-throughput-streams=1 $PARALLEL_AGGRAGATE ! gvapython class=ObjectFilter module=/home/pipeline-server/extensions/tracked_object_filter.py kwarg=\"{\\\"reclassify_interval\\\": $OCR_RECLASSIFY_INTERVAL}\" name=tracked_object_filter ! gvadetect model-instance-id=ocr threshold=.2 model=/home/pipeline-server/models/horizontal-text-detection-0002/FP16-INT8/1/horizontal-text-detection-0002.xml model-proc=/home/pipeline-server/models/horizontal-text-detection-0002/FP16-INT8/1/horizontal-text-detection-0002.json name=text_detection device=$DEVICE inference-region=roi-list $PRE_PROCESS ! gvainference model-instance-id=ocr2 nireq=4 gpu-throughput-streams=2 batch-size=32 device=$DEVICE model=/home/pipeline-server/models/text-recognition-0012-mod/FP16-INT8/1/text-recognition-0012-mod.xml model-proc=/home/pipeline-server/models/text-recognition-0012-mod/FP16-INT8/1/text-recognition-0012-mod.json inference-region=roi-list name=text_recognition object-class=text ! gvapython class=OCR module=/home/pipeline-server/extensions/OCR_post_processing_0012.py name=ocr_postprocess $AGGREGATE ! gvapython name=barcode class=BarcodeDetection module=/home/pipeline-server/extensions/barcode_nv12_to_gray.py kwarg=\"{\\\"reclassify_interval\\\": $BARCODE_RECLASSIFY_INTERVAL}\" ! gvametaconvert name=metaconvert add-empty-results=true ! gvametapublish name=destination file-format=2 file-path=/tmp/results/r$cid_count.jsonl $OUTPUT 2>&1 | tee >/tmp/results/gst-launch_$cid_count.log >(stdbuf -oL sed -n -e 's/^.*current: //p' | stdbuf -oL cut -d , -f 1 > /tmp/results/pipeline$cid_count.log)"
gstLaunchCmd="gst-launch-1.0 $inputsrc ! $DECODE $VA_SURFACE ! gvadetect model-instance-id=odmodel name=detection model=/home/pipeline-server/models/yolov5s/FP16-INT8/1/yolov5s.xml model-proc=/home/pipeline-server/models/yolov5s/FP16-INT8/1/yolov5s.json threshold=.5 device=$DEVICE $PRE_PROCESS $DETECTION_OPTIONS gpu-throughput-streams=4 nireq=4 batch-size=1 ! gvatrack name=tracking tracking-type=zero-term-imageless $PARALLEL_PIPELINE ! gvaclassify model-instance-id=clasifier labels=/home/pipeline-server/models/efficientnet-b0/1/imagenet_2012.txt model=/home/pipeline-server/models/efficientnet-b0/FP32-INT8/1/efficientnet-b0.xml model-proc=/home/pipeline-server/models/efficientnet-b0/efficientnet-b0.json reclassify-interval=1 device=$DEVICE inference-region=roi-list name=classification $PRE_PROCESS reclassify_interval=$OCR_RECLASSIFY_INTERVAL batch-size=8 nireq=4 gpu-throughput-streams=1 $PARALLEL_AGGRAGATE ! gvapython class=ObjectFilter module=/home/pipeline-server/extensions/tracked_object_filter.py kwarg=\"{\\\"reclassify_interval\\\": $OCR_RECLASSIFY_INTERVAL}\" name=tracked_object_filter ! gvadetect model-instance-id=ocr threshold=.2 model=/home/pipeline-server/models/horizontal-text-detection-0002/FP16-INT8/1/horizontal-text-detection-0002.xml model-proc=/home/pipeline-server/models/horizontal-text-detection-0002/FP16-INT8/1/horizontal-text-detection-0002.json name=text_detection device=$DEVICE inference-region=roi-list $PRE_PROCESS ! gvainference model-instance-id=ocr2 nireq=4 gpu-throughput-streams=2 batch-size=32 device=$DEVICE model=/home/pipeline-server/models/text-recognition-0012-mod/FP16-INT8/1/text-recognition-0012-mod.xml model-proc=/home/pipeline-server/models/text-recognition-0012-mod/FP16-INT8/1/text-recognition-0012-mod.json inference-region=roi-list name=text_recognition object-class=text ! gvapython class=OCR module=/home/pipeline-server/extensions/OCR_post_processing_0012.py name=ocr_postprocess $AGGREGATE ! gvapython name=barcode class=BarcodeDetection module=/home/pipeline-server/extensions/barcode_nv12_to_gray.py kwarg=\"{\\\"reclassify_interval\\\": $BARCODE_RECLASSIFY_INTERVAL}\" ! gvametaconvert name=metaconvert add-empty-results=true ! gvametapublish name=destination file-format=2 file-path=/tmp/results/r$cid\"_gst\".jsonl $OUTPUT 2>&1 | tee >/tmp/results/gst-launch_$cid\"_gst\".log >(stdbuf -oL sed -n -e 's/^.*current: //p' | stdbuf -oL cut -d , -f 1 > /tmp/results/pipeline$cid\"_gst\".log)"

echo "$gstLaunchCmd"

Expand Down
30 changes: 30 additions & 0 deletions configs/opencv-ovms/gst/run_gst.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
#
# Copyright (C) 2024 Intel Corporation.
#
# SPDX-License-Identifier: Apache-2.0
#

cl_cache_dir="/home/pipeline-server/.cl-cache" \
DISPLAY="$DISPLAY" \
RESULT_DIR="/tmp/result" \
DECODE="$DECODE" \
DEVICE="$DEVICE" \
PRE_PROCESS="$PRE_PROCESS" \
AGGREGATE="$AGGREGATE" \
OUTPUTFORMAT="$OUTPUTFORMAT" \
BARCODE_RECLASSIFY_INTERVAL="$BARCODE_INTERVAL" \
OCR_RECLASSIFY_INTERVAL="$OCR_INTERVAL" \
OCR_DEVICE="$OCR_DEVICE" \
LOG_LEVEL="$LOG_LEVEL" \
GST_DEBUG="$GST_DEBUG" \
LOW_POWER="$LOW_POWER" \
cid_count="$cid_count" \
inputsrc="$inputsrc" \
RUN_MODE="$RUN_MODE" \
CPU_ONLY="$CPU_ONLY" \
OCR_RECLASSIFY_INTERVAL="$OCR_RECLASSIFY_INTERVAL" \
BARCODE_RECLASSIFY_INTERVAL="$BARCODE_RECLASSIFY_INTERVAL" \
AUTO_SCALE_FLEX_140="$AUTO_SCALE_FLEX_140" \
PIPELINE_SCRIPT="$PIPELINE_SCRPT" \
/opencv-ovms/scripts/run_gst.sh --pipeline_script_choice "$PIPELINE_SCRIPT"
2 changes: 1 addition & 1 deletion configs/opencv-ovms/gst_capi/launch-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ BARCODE=$9
# Obtaining codec_type (avc or hevc)
is_avc=`gst-discoverer-1.0 "$INPUTSRC" | grep -i h.264 | wc -l`

echo "./$PIPELINE_EXEC_PATH $INPUTSRC $USE_ONEVPL $RENDER_MODE $RENDER_PORTRAIT_MODE $is_avc $WINDOW_WIDTH $WINDOW_HEIGHT $DETECTION_THRESHOLD" "$BARCODE"
echo "inside launch-pipeline.sh and the command is ./$PIPELINE_EXEC_PATH $INPUTSRC $USE_ONEVPL $RENDER_MODE $RENDER_PORTRAIT_MODE $is_avc $WINDOW_WIDTH $WINDOW_HEIGHT $DETECTION_THRESHOLD" "$BARCODE"
./"$PIPELINE_EXEC_PATH" "$INPUTSRC" "$USE_ONEVPL" "$RENDER_MODE" "$RENDER_PORTRAIT_MODE" "$is_avc" "$WINDOW_WIDTH" "$WINDOW_HEIGHT" "$DETECTION_THRESHOLD" "$BARCODE"
93 changes: 68 additions & 25 deletions configs/opencv-ovms/gst_capi/pipelines/capi_yolov5/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//*****************************************************************************
// Copyright 2023 Intel Corporation
// Copyright 2024 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,6 +28,14 @@
#include <mutex>
#include <condition_variable>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

#include <signal.h>
#include <stdio.h>
#include <sstream>
Expand Down Expand Up @@ -738,12 +746,13 @@ bool loadOVMS()
OVMS_ServerSettingsSetLogLevel(_serverSettings, OVMS_LOG_ERROR);

char * ovmsCofigJsonFilePath = std::getenv("OVMS_MODEL_CONFIG_JSON");
std::cout << "ovmsCofigJsonFilePath: "<<ovmsCofigJsonFilePath<<std::endl;
if (ovmsCofigJsonFilePath == nullptr ) {
std::cout << "error: could not find env OVMS_MODEL_CONFIG_JSON, exiting"<<std::endl;
return false;
}

std::cout << "ovmsCofigJsonFilePath: "<<ovmsCofigJsonFilePath<<std::endl;

OVMS_ModelsSettingsSetConfigPath(_modelsSettings, ovmsCofigJsonFilePath);

if (!createModelServer()) {
Expand Down Expand Up @@ -1045,29 +1054,50 @@ void print_usage(const char* programName) {
<< "detection_threshold is confidence threshold value in floating point that needs to be between 0.0 to 1.0\n";
}

int get_running_servers() {
char buffer[128];
string cmd = "echo $cid_count";
std::string result = "";
FILE* pipe = popen(cmd.c_str(), "r");

if (!pipe)
throw std::runtime_error("popen() failed!");
int getFreePort(const int startingPort) {
struct sockaddr_in sin;
int gotSocket, gotPortNum = -1;

try
{
while (fgets(buffer, sizeof buffer, pipe) != NULL)
{
result += buffer;
gotSocket = socket(AF_INET, SOCK_STREAM, 0);
if(gotSocket == -1) {
std::cout << "ERROR: failed to get socket...." << std::endl;
return -1;
} else {
std::cout << "found socket handler: " << gotSocket << std::endl;
}

// use port 0 to let system chooses a random free port
sin.sin_port = htons(0);
sin.sin_addr.s_addr = 0;
sin.sin_addr.s_addr = INADDR_ANY;
sin.sin_family = AF_INET;

if (bind(gotSocket, (struct sockaddr *)&sin, sizeof(struct sockaddr_in)) == -1) {
std::cout << "ERROR: system unable to bind to find free port..." << std::endl;
return -1;
}

// retrieve the port number that system just bound
socklen_t len = sizeof(sin);
if (getsockname(gotSocket, (struct sockaddr *)&sin, &len) != -1) {
gotPortNum = ntohs(sin.sin_port);
if (gotPortNum >= startingPort) {
std::cout << "found a port number " << gotPortNum << " that is no less than the starting port number " << startingPort << std::endl;
} else {
// port number found still less than the starting port number: continue searching...
gotPortNum = getFreePort(startingPort);
}
}
catch (...)
{
pclose(pipe);
throw;
} else {
std::cout << "ERROR: failed to get socket name for socket handle " << gotSocket << std::endl;
gotPortNum = -1;
}

if (gotPortNum != -1) {
// ready to be used, close it so it is not in use anymore
close(gotSocket);
}
pclose(pipe);
return std::stoi(result.c_str());

return gotPortNum;
}

int main(int argc, char** argv) {
Expand All @@ -1077,9 +1107,21 @@ int main(int argc, char** argv) {
_mediaService = new GStreamerMediaPipelineService();

// get valid server port numbers
int running_servers = get_running_servers();
_server_grpc_port = 9178 + running_servers;
_server_http_port = 11338 + running_servers;
int grpcPort = getFreePort(9178);
if (grpcPort == -1) {
std::cout << "ERROR: failed to get free port number for GRPC port starting from 9178" << std::endl;
return 1;
}
std::cout << "got GRPC port number: " << grpcPort << std::endl;
_server_grpc_port = grpcPort;

int httpPort = getFreePort(11338);
if (httpPort == -1) {
std::cout << "ERROR: failed to get free port number for HTTP port starting from 11338" << std::endl;
return 1;
}
std::cout << "got HTTP port number: " << httpPort << std::endl;
_server_http_port = httpPort;

_videoStreamPipeline = "people-detection.mp4";

Expand Down Expand Up @@ -1124,6 +1166,7 @@ int main(int argc, char** argv) {
GstElement *appsink;
ObjectDetectionInterface* objDet;
getMAPipeline(_videoStreamPipeline, &pipeline, &appsink, &objDet);

running_streams.emplace_back(run_stream, _videoStreamPipeline, pipeline, appsink, objDet);

if (!loadOVMS())
Expand Down
Loading

0 comments on commit 5b3ca4e

Please sign in to comment.