From 754cc00eddf25fa16c178a7b38ec7bc1fdcc1919 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Tue, 15 Nov 2022 00:53:36 -0800 Subject: [PATCH] tensorflow-lite: fix pipeline to not queue and lag on buffers --- plugins/tensorflow-lite/package-lock.json | 4 ++-- plugins/tensorflow-lite/package.json | 2 +- plugins/tensorflow-lite/src/pipeline/__init__.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/tensorflow-lite/package-lock.json b/plugins/tensorflow-lite/package-lock.json index fd97a2209..a0a000e6e 100644 --- a/plugins/tensorflow-lite/package-lock.json +++ b/plugins/tensorflow-lite/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/tensorflow-lite", - "version": "0.0.58", + "version": "0.0.59", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/tensorflow-lite", - "version": "0.0.58", + "version": "0.0.59", "hasInstallScript": true, "devDependencies": { "@scrypted/sdk": "file:../../sdk" diff --git a/plugins/tensorflow-lite/package.json b/plugins/tensorflow-lite/package.json index 2fedbd07f..ed1b52961 100644 --- a/plugins/tensorflow-lite/package.json +++ b/plugins/tensorflow-lite/package.json @@ -44,5 +44,5 @@ "devDependencies": { "@scrypted/sdk": "file:../../sdk" }, - "version": "0.0.58" + "version": "0.0.59" } diff --git a/plugins/tensorflow-lite/src/pipeline/__init__.py b/plugins/tensorflow-lite/src/pipeline/__init__.py index 70294e869..c47a4892a 100644 --- a/plugins/tensorflow-lite/src/pipeline/__init__.py +++ b/plugins/tensorflow-lite/src/pipeline/__init__.py @@ -214,7 +214,7 @@ def create_pipeline_sink( appsink_size, pixel_format, crop=False): - SINK_ELEMENT = 'appsink name={appsink_name} emit-signals=true max-buffers=0 drop=true sync=false'.format( + SINK_ELEMENT = 'appsink name={appsink_name} emit-signals=true max-buffers=-1 drop=true sync=false'.format( appsink_name=appsink_name) (width, height) = appsink_size @@ -249,11 +249,11 @@ def create_pipeline( sink = create_pipeline_sink( appsink_name, appsink_size, pixel_format, crop=crop) if crop: - PIPELINE = """ {video_input} ! videoconvert name=videoconvert ! aspectratiocrop aspect-ratio=1/1 ! videoscale name=videoscale ! queue leaky=downstream max-size-buffers=0 + PIPELINE = """ {video_input} ! queue leaky=downstream max-size-buffers=0 ! videoconvert name=videoconvert ! aspectratiocrop aspect-ratio=1/1 ! videoscale name=videoscale ! {sink} """ else: - PIPELINE = """ {video_input} ! videoconvert name=videoconvert ! videoscale name=videoscale ! queue leaky=downstream max-size-buffers=0 + PIPELINE = """ {video_input} ! queue leaky=downstream max-size-buffers=0 ! videoconvert name=videoconvert ! videoscale name=videoscale ! {sink} """ pipeline = PIPELINE.format(video_input=video_input, sink=sink)