From f282756e0fa4cf91d45d03d9f9ab7ef52e6871ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20P=C4=99czek?= Date: Mon, 16 Sep 2024 13:27:50 +0200 Subject: [PATCH 1/5] Get rid of old backend --- .../stream_interface/create_dummy_streams.py | 80 --------- .../inference_pipeline_demo.py | 161 ------------------ development/stream_interface/stream_video.py | 58 ------- docker/dockerfiles/Dockerfile.device_manager | 1 - docker/dockerfiles/Dockerfile.onnx.cpu | 1 - .../dockerfiles/Dockerfile.onnx.cpu.parallel | 1 - docker/dockerfiles/Dockerfile.onnx.cpu.slim | 1 - .../Dockerfile.onnx.cpu.stream_manager | 1 - docker/dockerfiles/Dockerfile.onnx.gpu | 1 - .../dockerfiles/Dockerfile.onnx.gpu.parallel | 1 - docker/dockerfiles/Dockerfile.onnx.gpu.slim | 1 - .../Dockerfile.onnx.gpu.stream_manager | 1 - .../dockerfiles/Dockerfile.onnx.jetson.4.5.0 | 1 - .../dockerfiles/Dockerfile.onnx.jetson.4.6.1 | 1 - .../dockerfiles/Dockerfile.onnx.jetson.5.1.1 | 1 - ...ockerfile.onnx.jetson.5.1.1.stream_manager | 1 - docker/dockerfiles/Dockerfile.onnx.lambda | 1 - .../dockerfiles/Dockerfile.onnx.lambda.slim | 1 - docker/dockerfiles/Dockerfile.onnx.trt | 1 - docker/dockerfiles/Dockerfile.onnx.udp.gpu | 1 - .../Dockerfile.stream_management_api | 1 - 21 files changed, 317 deletions(-) delete mode 100644 development/stream_interface/create_dummy_streams.py delete mode 100644 development/stream_interface/inference_pipeline_demo.py delete mode 100644 development/stream_interface/stream_video.py diff --git a/development/stream_interface/create_dummy_streams.py b/development/stream_interface/create_dummy_streams.py deleted file mode 100644 index 83387f868..000000000 --- a/development/stream_interface/create_dummy_streams.py +++ /dev/null @@ -1,80 +0,0 @@ -import argparse -import os -import subprocess -import tempfile -from glob import glob -from threading import Thread -import yaml - - -CONFIG = {"protocols": ["tcp"], "paths": {"all": {"source": "publisher"}}} -BASE_STREAM_URL = "rtsp://localhost:8554/live" - - -def main(video_dir: str, n: int) -> None: - video_paths = glob(os.path.join(video_dir, "*.mp4")) + glob(os.path.join(video_dir, "*.webm")) - while len(video_paths) < n: - video_paths = video_paths * 2 - video_paths = video_paths[:n] - try: - with tempfile.TemporaryDirectory() as tmp_dir: - config_path = os.path.join(tmp_dir, "rtsp-simple-server.yml") - with open(config_path, "w") as f: - yaml.dump(CONFIG, f) - run_server(config_path=config_path) - threads = [] - for idx, video_path in enumerate(video_paths): - stream_url = f"{BASE_STREAM_URL}{idx}.stream" - print(f"Streaming {video_path} under {stream_url}") - threads.append( - stream_video(video_path=video_path, stream_url=stream_url) - ) - for t in threads: - t.join() - finally: - kill_server() - - -def run_server(config_path: str) -> None: - command = ( - f"docker run --rm --name rtsp_server -d -v {config_path}:/rtsp-simple-server.yml " - f"-p 8554:8554 aler9/rtsp-simple-server:v1.3.0" - ) - return_code = run_command(command=command.split()) - if return_code != 0: - raise RuntimeError("Could not run RTSP server!") - - -def kill_server() -> None: - run_command(command="docker kill rtsp_server".split()) - - -def stream_video(video_path: str, stream_url: str) -> Thread: - return run_command_in_thread( - command=f"ffmpeg -re -stream_loop -1 -i ".split() - + [f"{video_path}"] - + f"-f rtsp -rtsp_transport tcp {stream_url}".split() - ) - - -def run_command_in_thread(command: list) -> Thread: - thread = Thread(target=run_command, args=(command,)) - thread.start() - return thread - - -def run_command(command: list) -> int: - completed = subprocess.run(command) - return completed.returncode - - -if __name__ == "__main__": - parser = argparse.ArgumentParser("Script to run run dummy RTSP streams") - parser.add_argument( - "--video_dir", type=str, help="Directory with videos", required=True - ) - parser.add_argument( - "--n", type=int, help="Number of streams", required=False, default=6 - ) - args = parser.parse_args() - main(video_dir=args.video_dir, n=args.n) diff --git a/development/stream_interface/inference_pipeline_demo.py b/development/stream_interface/inference_pipeline_demo.py deleted file mode 100644 index a592a513b..000000000 --- a/development/stream_interface/inference_pipeline_demo.py +++ /dev/null @@ -1,161 +0,0 @@ -import argparse -import os -import subprocess -from datetime import datetime -from functools import partial -from threading import Thread -from typing import Optional, Union - -import cv2 -import numpy as np -import supervision as sv - -from inference.core.interfaces.camera.entities import VideoFrame -from inference.core.interfaces.stream.inference_pipeline import InferencePipeline -from inference.core.interfaces.stream.sinks import render_boxes, display_image, UDPSink, multi_sink -from inference.core.interfaces.stream.watchdog import ( - BasePipelineWatchDog, - PipelineWatchDog, -) -from inference.core.utils.environment import str2bool -from inference.core.utils.preprocess import letterbox_image - - -STOP = False - -MODELS = { - "a": "microsoft-coco/8", - "b": "microsoft-coco/9", - "c": "microsoft-coco/10", - "d": "microsoft-coco/11", - "e": "microsoft-coco/12", - "f": "eye-detection/39" -} - -STREAM_SERVER_URL = os.getenv("STREAM_SERVER", "rtsp://localhost:8554") -UDP_SERVER_HOST = os.getenv("UDP_SERVER_HOST", "127.0.0.1") -UDP_SERVER_PORT = int(os.getenv("UDP_SERVER_PORT", "9999")) - - -def main( - model_type: str, - stream_id: int, - max_fps: Optional[Union[int, float]], - enable_stats: bool, - output_type: str, -) -> None: - global STOP - watchdog = BasePipelineWatchDog() - ffmpeg_process = None - sinks = [] - if "video_stream" in output_type: - ffmpeg_process = open_ffmpeg_stream_process(stream_id=stream_id) - on_frame_rendered = partial(stream_prediction, ffmpeg_process=ffmpeg_process) - on_prediction = partial( - render_boxes, - display_statistics=enable_stats, - on_frame_rendered=on_frame_rendered, - ) - sinks.append(on_prediction) - if "udp_stream" in output_type: - udp_sink = UDPSink.init(ip_address=UDP_SERVER_HOST, port=UDP_SERVER_PORT) - on_prediction = udp_sink.send_predictions - sinks.append(on_prediction) - if "display" in output_type: - on_prediction = partial( - render_boxes, - display_statistics=enable_stats, - ) - sinks.append(on_prediction) - on_prediction = partial(multi_sink, sinks=sinks) - pipeline = InferencePipeline.init( - model_id=MODELS[model_type.lower()], - video_reference=f"{STREAM_SERVER_URL}/live{stream_id}.stream", - on_prediction=on_prediction, - max_fps=max_fps, - watchdog=watchdog, - ) - control_thread = Thread(target=command_thread, args=(pipeline, watchdog)) - control_thread.start() - pipeline.start() - STOP = True - pipeline.join() - if ffmpeg_process is not None: - ffmpeg_process.stdin.close() - ffmpeg_process.wait() - - -def stream_prediction(image: np.ndarray, ffmpeg_process: subprocess.Popen) -> None: - ffmpeg_process.stdin.write(image[:, :, ::-1].astype(np.uint8).tobytes()) - - -def open_ffmpeg_stream_process(stream_id: int) -> subprocess.Popen: - args = ( - "ffmpeg -re -stream_loop -1 -f rawvideo -pix_fmt " - "rgb24 -s 640x480 -i pipe:0 -pix_fmt yuv420p " - f"-f rtsp -rtsp_transport tcp {STREAM_SERVER_URL}/predictions{stream_id}.stream" - ).split() - return subprocess.Popen(args, stdin=subprocess.PIPE) - - -def command_thread(pipeline: InferencePipeline, watchdog: PipelineWatchDog) -> None: - global STOP - while not STOP: - key = input() - if key == "i": - print(watchdog.get_report()) - if key == "t": - pipeline.terminate() - STOP = True - elif key == "p": - pipeline.pause_stream() - elif key == "m": - pipeline.mute_stream() - elif key == "r": - pipeline.resume_stream() - - -if __name__ == "__main__": - parser = argparse.ArgumentParser("Inference pipeline demo") - parser.add_argument( - "--model_type", - help=f"Type of a model from {list(MODELS.keys())}", - required=False, - type=str, - default="a", - ) - parser.add_argument( - "--stream_id", - help=f"Id of a stream", - required=True, - type=int, - ) - parser.add_argument( - "--max_fps", - help=f"Limit on FPS", - required=False, - type=int, - default=None, - ) - parser.add_argument( - "--enable_stats", - help=f"Flag to decide if stats to be displayed - pass 0 to disable", - required=False, - type=str2bool, - default=True, - ) - parser.add_argument( - "--output_type", - help=f"Flag to decide if output to be streamed or displayed on screen", - required=False, - type=str, - default="display", - ) - args = parser.parse_args() - main( - model_type=args.model_type, - stream_id=args.stream_id, - max_fps=args.max_fps, - enable_stats=args.enable_stats, - output_type=args.output_type, - ) diff --git a/development/stream_interface/stream_video.py b/development/stream_interface/stream_video.py deleted file mode 100644 index 0c1a33023..000000000 --- a/development/stream_interface/stream_video.py +++ /dev/null @@ -1,58 +0,0 @@ -import argparse -import os -import subprocess -from glob import glob -from threading import Thread - -BASE_STREAM_URL = "rtsp://localhost:8554/live" - - -def main(video_dir: str, n: int, id_offset: int) -> None: - video_paths = glob(os.path.join(video_dir, "*.mp4")) + glob(os.path.join(video_dir, "*.webm")) - print(video_paths) - while len(video_paths) < n: - video_paths = video_paths * 2 - video_paths = video_paths[:n] - threads = [] - for idx, video_path in enumerate(video_paths): - stream_url = f"{BASE_STREAM_URL}{id_offset + idx}.stream" - print(f"Streaming {video_path} under {stream_url}") - threads.append( - stream_video(video_path=video_path, stream_url=stream_url) - ) - for t in threads: - t.join() - - -def stream_video(video_path: str, stream_url: str) -> Thread: - return run_command_in_thread( - command=f"ffmpeg -re -stream_loop -1 -i ".split() - + [f"{video_path}"] - + f"-f rtsp -rtsp_transport tcp {stream_url}".split() - ) - - -def run_command_in_thread(command: list) -> Thread: - thread = Thread(target=run_command, args=(command,)) - thread.start() - return thread - - -def run_command(command: list) -> int: - completed = subprocess.run(command) - return completed.returncode - - -if __name__ == "__main__": - parser = argparse.ArgumentParser("Script to emit RTSP streams to RTSP server") - parser.add_argument( - "--video_dir", type=str, help="Directory with videos", required=True - ) - parser.add_argument( - "--n", type=int, help="Number of streams", required=False, default=6 - ) - parser.add_argument( - "--id_offset", type=int, help="Offset of stream_id", required=False, default=0, - ) - args = parser.parse_args() - main(video_dir=args.video_dir, n=args.n, id_offset=args.id_offset) diff --git a/docker/dockerfiles/Dockerfile.device_manager b/docker/dockerfiles/Dockerfile.device_manager index 147c60487..d693113ec 100644 --- a/docker/dockerfiles/Dockerfile.device_manager +++ b/docker/dockerfiles/Dockerfile.device_manager @@ -7,7 +7,6 @@ ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 RUN apt update -y && apt install -y \ - ffmpeg \ libxext6 \ libsm6 \ && rm -rf /var/lib/apt/lists/* diff --git a/docker/dockerfiles/Dockerfile.onnx.cpu b/docker/dockerfiles/Dockerfile.onnx.cpu index 97839c2c4..c278b058f 100644 --- a/docker/dockerfiles/Dockerfile.onnx.cpu +++ b/docker/dockerfiles/Dockerfile.onnx.cpu @@ -3,7 +3,6 @@ FROM python:3.9 as base ARG DEBIAN_FRONTEND=noninteractive RUN apt update -y && apt install -y \ - ffmpeg \ libxext6 \ libopencv-dev \ uvicorn \ diff --git a/docker/dockerfiles/Dockerfile.onnx.cpu.parallel b/docker/dockerfiles/Dockerfile.onnx.cpu.parallel index 192b47146..63db663b1 100644 --- a/docker/dockerfiles/Dockerfile.onnx.cpu.parallel +++ b/docker/dockerfiles/Dockerfile.onnx.cpu.parallel @@ -6,7 +6,6 @@ ARG DEBIAN_FRONTEND=noninteractive ARG TARGETPLATFORM RUN apt update -y && apt install -y \ - ffmpeg \ libxext6 \ libopencv-dev \ uvicorn \ diff --git a/docker/dockerfiles/Dockerfile.onnx.cpu.slim b/docker/dockerfiles/Dockerfile.onnx.cpu.slim index 23dbdf6aa..e18484441 100644 --- a/docker/dockerfiles/Dockerfile.onnx.cpu.slim +++ b/docker/dockerfiles/Dockerfile.onnx.cpu.slim @@ -4,7 +4,6 @@ ARG DEBIAN_FRONTEND=noninteractive ARG TARGETPLATFORM RUN apt update -y && apt install -y \ - ffmpeg \ libxext6 \ libopencv-dev \ uvicorn \ diff --git a/docker/dockerfiles/Dockerfile.onnx.cpu.stream_manager b/docker/dockerfiles/Dockerfile.onnx.cpu.stream_manager index f6945c4b1..d1003dedf 100644 --- a/docker/dockerfiles/Dockerfile.onnx.cpu.stream_manager +++ b/docker/dockerfiles/Dockerfile.onnx.cpu.stream_manager @@ -5,7 +5,6 @@ WORKDIR /app ARG DEBIAN_FRONTEND=noninteractive RUN apt update -y && apt install -y \ - ffmpeg \ libxext6 \ libopencv-dev \ uvicorn \ diff --git a/docker/dockerfiles/Dockerfile.onnx.gpu b/docker/dockerfiles/Dockerfile.onnx.gpu index a33e168e9..0c12b469c 100644 --- a/docker/dockerfiles/Dockerfile.onnx.gpu +++ b/docker/dockerfiles/Dockerfile.onnx.gpu @@ -3,7 +3,6 @@ FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 as base WORKDIR /app RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - ffmpeg \ libxext6 \ libopencv-dev \ uvicorn \ diff --git a/docker/dockerfiles/Dockerfile.onnx.gpu.parallel b/docker/dockerfiles/Dockerfile.onnx.gpu.parallel index 18d4d63cf..e989ea2fb 100644 --- a/docker/dockerfiles/Dockerfile.onnx.gpu.parallel +++ b/docker/dockerfiles/Dockerfile.onnx.gpu.parallel @@ -3,7 +3,6 @@ FROM nvcr.io/nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu22.04 as base WORKDIR /app RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - ffmpeg \ libxext6 \ libopencv-dev \ uvicorn \ diff --git a/docker/dockerfiles/Dockerfile.onnx.gpu.slim b/docker/dockerfiles/Dockerfile.onnx.gpu.slim index 02a303d3e..8e5f3b097 100644 --- a/docker/dockerfiles/Dockerfile.onnx.gpu.slim +++ b/docker/dockerfiles/Dockerfile.onnx.gpu.slim @@ -3,7 +3,6 @@ FROM nvcr.io/nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu22.04 as base WORKDIR /app RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - ffmpeg \ libxext6 \ libopencv-dev \ uvicorn \ diff --git a/docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager b/docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager index ecdf9ee9a..561cc2aba 100644 --- a/docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager +++ b/docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager @@ -3,7 +3,6 @@ FROM nvcr.io/nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04 WORKDIR /app RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - ffmpeg \ libxext6 \ libopencv-dev \ uvicorn \ diff --git a/docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0 b/docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0 index 151a966c8..e00ea8e54 100644 --- a/docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0 +++ b/docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0 @@ -13,7 +13,6 @@ RUN apt-get update -y && apt-get upgrade -y && apt-get install -y \ gfortran \ build-essential \ libatlas-base-dev \ - ffmpeg \ libsm6 \ libxext6 \ wget \ diff --git a/docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1 b/docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1 index b08a22aeb..a478944db 100644 --- a/docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1 +++ b/docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1 @@ -28,7 +28,6 @@ RUN apt-get update -y && apt-get upgrade -y && apt-get install -y \ gfortran \ build-essential \ libatlas-base-dev \ - ffmpeg \ libsm6 \ libxext6 \ wget \ diff --git a/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1 b/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1 index f50b56679..10de2f909 100644 --- a/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1 +++ b/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1 @@ -13,7 +13,6 @@ RUN apt-get update -y && apt-get install -y \ gfortran \ build-essential \ libatlas-base-dev \ - ffmpeg \ libsm6 \ libxext6 \ wget \ diff --git a/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1.stream_manager b/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1.stream_manager index 8c592227a..744160f7b 100644 --- a/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1.stream_manager +++ b/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1.stream_manager @@ -11,7 +11,6 @@ RUN apt-get update -y && apt-get install -y \ gfortran \ build-essential \ libatlas-base-dev \ - ffmpeg \ libsm6 \ libxext6 \ wget \ diff --git a/docker/dockerfiles/Dockerfile.onnx.lambda b/docker/dockerfiles/Dockerfile.onnx.lambda index bcc36af3d..92136e146 100644 --- a/docker/dockerfiles/Dockerfile.onnx.lambda +++ b/docker/dockerfiles/Dockerfile.onnx.lambda @@ -6,7 +6,6 @@ ARG DEBIAN_FRONTEND=noninteractive ARG TARGETPLATFORM RUN yum update -y && yum install -y \ - ffmpeg \ libsm6 \ libxext6 \ python3-pip \ diff --git a/docker/dockerfiles/Dockerfile.onnx.lambda.slim b/docker/dockerfiles/Dockerfile.onnx.lambda.slim index 62be4233b..56e75f2b6 100644 --- a/docker/dockerfiles/Dockerfile.onnx.lambda.slim +++ b/docker/dockerfiles/Dockerfile.onnx.lambda.slim @@ -5,7 +5,6 @@ ARG DEBIAN_FRONTEND=noninteractive ARG TARGETPLATFORM RUN yum update -y && yum install -y \ - ffmpeg \ libsm6 \ libxext6 \ python3-pip \ diff --git a/docker/dockerfiles/Dockerfile.onnx.trt b/docker/dockerfiles/Dockerfile.onnx.trt index 347b70f0d..54f845017 100644 --- a/docker/dockerfiles/Dockerfile.onnx.trt +++ b/docker/dockerfiles/Dockerfile.onnx.trt @@ -2,7 +2,6 @@ FROM nvcr.io/nvidia/tensorrt:22.12-py3 WORKDIR /app RUN apt-get update -y && apt-get install -y \ - ffmpeg \ libsm6 \ libxext6 \ libopencv-dev \ diff --git a/docker/dockerfiles/Dockerfile.onnx.udp.gpu b/docker/dockerfiles/Dockerfile.onnx.udp.gpu index 2f0f58ada..8698bcbec 100644 --- a/docker/dockerfiles/Dockerfile.onnx.udp.gpu +++ b/docker/dockerfiles/Dockerfile.onnx.udp.gpu @@ -3,7 +3,6 @@ FROM nvcr.io/nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04 WORKDIR /app RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - ffmpeg \ libxext6 \ libopencv-dev \ uvicorn \ diff --git a/docker/dockerfiles/Dockerfile.stream_management_api b/docker/dockerfiles/Dockerfile.stream_management_api index b8c7c5e13..8ff63f0c1 100644 --- a/docker/dockerfiles/Dockerfile.stream_management_api +++ b/docker/dockerfiles/Dockerfile.stream_management_api @@ -5,7 +5,6 @@ WORKDIR /app ARG DEBIAN_FRONTEND=noninteractive RUN apt update -y && apt install -y \ - ffmpeg \ libxext6 \ libopencv-dev \ uvicorn \ From 1a9d9612aa24067f14906f8689dc7b3764d88b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20P=C4=99czek?= Date: Wed, 18 Sep 2024 11:18:23 +0200 Subject: [PATCH 2/5] Try to install gstreamer --- docker/dockerfiles/Dockerfile.onnx.cpu | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/dockerfiles/Dockerfile.onnx.cpu b/docker/dockerfiles/Dockerfile.onnx.cpu index c278b058f..10c5aa261 100644 --- a/docker/dockerfiles/Dockerfile.onnx.cpu +++ b/docker/dockerfiles/Dockerfile.onnx.cpu @@ -10,6 +10,7 @@ RUN apt update -y && apt install -y \ git \ libgdal-dev \ cmake \ + gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-tools gstreamer1.0-x \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.sam.txt \ From 91faf66087c31eaf4a55283d0cd4f944708265ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20P=C4=99czek?= Date: Wed, 18 Sep 2024 11:38:56 +0200 Subject: [PATCH 3/5] Install rtsp sink --- docker/dockerfiles/Dockerfile.onnx.cpu | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docker/dockerfiles/Dockerfile.onnx.cpu b/docker/dockerfiles/Dockerfile.onnx.cpu index 10c5aa261..53093c87a 100644 --- a/docker/dockerfiles/Dockerfile.onnx.cpu +++ b/docker/dockerfiles/Dockerfile.onnx.cpu @@ -10,7 +10,12 @@ RUN apt update -y && apt install -y \ git \ libgdal-dev \ cmake \ - gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-tools gstreamer1.0-x \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-tools gstreamer1.0-x \ + gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.sam.txt \ From 1ed66576a663c6fa78c53ba8a0cd56c05a337d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20P=C4=99czek?= Date: Tue, 24 Sep 2024 12:47:41 +0200 Subject: [PATCH 4/5] Apply gstreamer backend for docker builds used outside platform --- docker/dockerfiles/Dockerfile.onnx.cpu.parallel | 6 ++++++ docker/dockerfiles/Dockerfile.onnx.cpu.slim | 6 ++++++ docker/dockerfiles/Dockerfile.onnx.gpu | 6 ++++++ docker/dockerfiles/Dockerfile.onnx.gpu.dev | 6 ++++++ docker/dockerfiles/Dockerfile.onnx.gpu.parallel | 6 ++++++ docker/dockerfiles/Dockerfile.onnx.gpu.slim | 6 ++++++ docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager | 6 ++++++ docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0 | 6 ++++++ docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1 | 6 ++++++ docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1 | 6 ++++++ docker/dockerfiles/Dockerfile.onnx.trt | 6 ++++++ 11 files changed, 66 insertions(+) diff --git a/docker/dockerfiles/Dockerfile.onnx.cpu.parallel b/docker/dockerfiles/Dockerfile.onnx.cpu.parallel index bbfa70257..6dbb9ee04 100644 --- a/docker/dockerfiles/Dockerfile.onnx.cpu.parallel +++ b/docker/dockerfiles/Dockerfile.onnx.cpu.parallel @@ -12,6 +12,12 @@ RUN apt update -y && apt install -y \ python3-pip \ git \ libgdal-dev \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-tools gstreamer1.0-x \ + gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.sam.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.cpu.slim b/docker/dockerfiles/Dockerfile.onnx.cpu.slim index ddb5992be..960b83e36 100644 --- a/docker/dockerfiles/Dockerfile.onnx.cpu.slim +++ b/docker/dockerfiles/Dockerfile.onnx.cpu.slim @@ -11,6 +11,12 @@ RUN apt update -y && apt install -y \ git \ libgdal-dev \ cmake \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-tools gstreamer1.0-x \ + gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* diff --git a/docker/dockerfiles/Dockerfile.onnx.gpu b/docker/dockerfiles/Dockerfile.onnx.gpu index 83bede9f2..1db4897a2 100644 --- a/docker/dockerfiles/Dockerfile.onnx.gpu +++ b/docker/dockerfiles/Dockerfile.onnx.gpu @@ -10,6 +10,12 @@ RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_ git \ libgdal-dev \ wget \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-tools gstreamer1.0-x \ + gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.sam.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.gpu.dev b/docker/dockerfiles/Dockerfile.onnx.gpu.dev index e483abdff..12a44c9f6 100644 --- a/docker/dockerfiles/Dockerfile.onnx.gpu.dev +++ b/docker/dockerfiles/Dockerfile.onnx.gpu.dev @@ -11,6 +11,12 @@ RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_ git \ libgdal-dev \ wget \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-tools gstreamer1.0-x \ + gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.sam.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.gpu.parallel b/docker/dockerfiles/Dockerfile.onnx.gpu.parallel index f53b6622b..912903b47 100644 --- a/docker/dockerfiles/Dockerfile.onnx.gpu.parallel +++ b/docker/dockerfiles/Dockerfile.onnx.gpu.parallel @@ -8,6 +8,12 @@ RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_ uvicorn \ python3-pip \ git \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-tools gstreamer1.0-x \ + gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.sam.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.gpu.slim b/docker/dockerfiles/Dockerfile.onnx.gpu.slim index ac983cfdc..4723f0794 100644 --- a/docker/dockerfiles/Dockerfile.onnx.gpu.slim +++ b/docker/dockerfiles/Dockerfile.onnx.gpu.slim @@ -9,6 +9,12 @@ RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_ python3-pip \ git \ libgdal-dev \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-tools gstreamer1.0-x \ + gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.http.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager b/docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager index 561cc2aba..f432ff8ba 100644 --- a/docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager +++ b/docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager @@ -9,6 +9,12 @@ RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_ python3-pip \ git \ libgdal-dev \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-tools gstreamer1.0-x \ + gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.http.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0 b/docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0 index 3b6fa882c..32267b4b8 100644 --- a/docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0 +++ b/docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0 @@ -20,6 +20,12 @@ RUN apt-get update -y && apt-get upgrade -y && apt-get install -y \ gdal-bin \ libgdal-dev \ python3-setuptools \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-tools gstreamer1.0-x \ + gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.clip.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1 b/docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1 index a83a1ca2d..064f79576 100644 --- a/docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1 +++ b/docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1 @@ -14,6 +14,12 @@ RUN apt-get update -y && apt-get upgrade -y && apt-get install -y \ libffi-dev \ curl \ libbz2-dev \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-tools gstreamer1.0-x \ + gstreamer1.0-rtsp \ software-properties-common RUN wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz && tar -xf Python-3.9.0.tar.xz && rm Python-3.9.0.tar.xz diff --git a/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1 b/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1 index 877b30882..c26031951 100644 --- a/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1 +++ b/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1 @@ -19,6 +19,12 @@ RUN apt-get update -y && apt-get install -y \ python3-shapely \ gdal-bin \ libgdal-dev \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-tools gstreamer1.0-x \ + gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.clip.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.trt b/docker/dockerfiles/Dockerfile.onnx.trt index c12d51f64..96bfd178a 100644 --- a/docker/dockerfiles/Dockerfile.onnx.trt +++ b/docker/dockerfiles/Dockerfile.onnx.trt @@ -6,6 +6,12 @@ RUN apt-get update -y && apt-get install -y \ libxext6 \ libopencv-dev \ uvicorn \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-tools gstreamer1.0-x \ + gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.sam.txt \ From 715bbc31a74a79563f29285380aa231cf3074d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20P=C4=99czek?= Date: Tue, 24 Sep 2024 17:12:20 +0200 Subject: [PATCH 5/5] Remove gstreamer - not needed for now --- docker/dockerfiles/Dockerfile.onnx.cpu | 6 ------ docker/dockerfiles/Dockerfile.onnx.cpu.parallel | 6 ------ docker/dockerfiles/Dockerfile.onnx.cpu.slim | 6 ------ docker/dockerfiles/Dockerfile.onnx.gpu | 6 ------ docker/dockerfiles/Dockerfile.onnx.gpu.dev | 6 ------ docker/dockerfiles/Dockerfile.onnx.gpu.parallel | 6 ------ docker/dockerfiles/Dockerfile.onnx.gpu.slim | 6 ------ docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager | 6 ------ docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0 | 6 ------ docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1 | 6 ------ docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1 | 6 ------ docker/dockerfiles/Dockerfile.onnx.trt | 6 ------ 12 files changed, 72 deletions(-) diff --git a/docker/dockerfiles/Dockerfile.onnx.cpu b/docker/dockerfiles/Dockerfile.onnx.cpu index 9486955f6..23a88e297 100644 --- a/docker/dockerfiles/Dockerfile.onnx.cpu +++ b/docker/dockerfiles/Dockerfile.onnx.cpu @@ -10,12 +10,6 @@ RUN apt update -y && apt install -y \ git \ libgdal-dev \ cmake \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-tools gstreamer1.0-x \ - gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.sam.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.cpu.parallel b/docker/dockerfiles/Dockerfile.onnx.cpu.parallel index 6dbb9ee04..bbfa70257 100644 --- a/docker/dockerfiles/Dockerfile.onnx.cpu.parallel +++ b/docker/dockerfiles/Dockerfile.onnx.cpu.parallel @@ -12,12 +12,6 @@ RUN apt update -y && apt install -y \ python3-pip \ git \ libgdal-dev \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-tools gstreamer1.0-x \ - gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.sam.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.cpu.slim b/docker/dockerfiles/Dockerfile.onnx.cpu.slim index 960b83e36..ddb5992be 100644 --- a/docker/dockerfiles/Dockerfile.onnx.cpu.slim +++ b/docker/dockerfiles/Dockerfile.onnx.cpu.slim @@ -11,12 +11,6 @@ RUN apt update -y && apt install -y \ git \ libgdal-dev \ cmake \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-tools gstreamer1.0-x \ - gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* diff --git a/docker/dockerfiles/Dockerfile.onnx.gpu b/docker/dockerfiles/Dockerfile.onnx.gpu index 1db4897a2..83bede9f2 100644 --- a/docker/dockerfiles/Dockerfile.onnx.gpu +++ b/docker/dockerfiles/Dockerfile.onnx.gpu @@ -10,12 +10,6 @@ RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_ git \ libgdal-dev \ wget \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-tools gstreamer1.0-x \ - gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.sam.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.gpu.dev b/docker/dockerfiles/Dockerfile.onnx.gpu.dev index 12a44c9f6..e483abdff 100644 --- a/docker/dockerfiles/Dockerfile.onnx.gpu.dev +++ b/docker/dockerfiles/Dockerfile.onnx.gpu.dev @@ -11,12 +11,6 @@ RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_ git \ libgdal-dev \ wget \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-tools gstreamer1.0-x \ - gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.sam.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.gpu.parallel b/docker/dockerfiles/Dockerfile.onnx.gpu.parallel index 912903b47..f53b6622b 100644 --- a/docker/dockerfiles/Dockerfile.onnx.gpu.parallel +++ b/docker/dockerfiles/Dockerfile.onnx.gpu.parallel @@ -8,12 +8,6 @@ RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_ uvicorn \ python3-pip \ git \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-tools gstreamer1.0-x \ - gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.sam.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.gpu.slim b/docker/dockerfiles/Dockerfile.onnx.gpu.slim index 4723f0794..ac983cfdc 100644 --- a/docker/dockerfiles/Dockerfile.onnx.gpu.slim +++ b/docker/dockerfiles/Dockerfile.onnx.gpu.slim @@ -9,12 +9,6 @@ RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_ python3-pip \ git \ libgdal-dev \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-tools gstreamer1.0-x \ - gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.http.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager b/docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager index f432ff8ba..561cc2aba 100644 --- a/docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager +++ b/docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager @@ -9,12 +9,6 @@ RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update -y && DEBIAN_ python3-pip \ git \ libgdal-dev \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-tools gstreamer1.0-x \ - gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.http.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0 b/docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0 index 32267b4b8..3b6fa882c 100644 --- a/docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0 +++ b/docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0 @@ -20,12 +20,6 @@ RUN apt-get update -y && apt-get upgrade -y && apt-get install -y \ gdal-bin \ libgdal-dev \ python3-setuptools \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-tools gstreamer1.0-x \ - gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.clip.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1 b/docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1 index 064f79576..a83a1ca2d 100644 --- a/docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1 +++ b/docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1 @@ -14,12 +14,6 @@ RUN apt-get update -y && apt-get upgrade -y && apt-get install -y \ libffi-dev \ curl \ libbz2-dev \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-tools gstreamer1.0-x \ - gstreamer1.0-rtsp \ software-properties-common RUN wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz && tar -xf Python-3.9.0.tar.xz && rm Python-3.9.0.tar.xz diff --git a/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1 b/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1 index c26031951..877b30882 100644 --- a/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1 +++ b/docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1 @@ -19,12 +19,6 @@ RUN apt-get update -y && apt-get install -y \ python3-shapely \ gdal-bin \ libgdal-dev \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-tools gstreamer1.0-x \ - gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.clip.txt \ diff --git a/docker/dockerfiles/Dockerfile.onnx.trt b/docker/dockerfiles/Dockerfile.onnx.trt index 96bfd178a..c12d51f64 100644 --- a/docker/dockerfiles/Dockerfile.onnx.trt +++ b/docker/dockerfiles/Dockerfile.onnx.trt @@ -6,12 +6,6 @@ RUN apt-get update -y && apt-get install -y \ libxext6 \ libopencv-dev \ uvicorn \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-tools gstreamer1.0-x \ - gstreamer1.0-rtsp \ && rm -rf /var/lib/apt/lists/* COPY requirements/requirements.sam.txt \