meta-digi/meta-digi-dey/dynamic-layers/x-linux-ai/recipes-samples/image-classification/files/patches/0001-image-classification-r...

60 lines
2.7 KiB
Diff

From: David Escalona <david.escalona@digi.com>
Date: Mon, 16 Sep 2024 18:42:29 +0200
Subject: [PATCH 1/3] image-classification: remove weston user check from
launch
Signed-off-by: David Escalona <david.escalona@digi.com>
---
.../files/stai-mpu/launch_python_image_classification.sh | 8 +-------
.../launch_python_image_classification_testdata.sh | 8 +-------
2 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/stai-mpu/launch_python_image_classification.sh b/stai-mpu/launch_python_image_classification.sh
index 3cb5259..afbedf8 100755
--- a/stai-mpu/launch_python_image_classification.sh
+++ b/stai-mpu/launch_python_image_classification.sh
@@ -5,18 +5,12 @@
#
# This software is licensed under terms that can be found in the LICENSE file
# in the root directory of this software component.
# If no LICENSE file comes with this software, it is provided AS-IS.
-weston_user=$(ps aux | grep '/usr/bin/weston '|grep -v 'grep'|awk '{print $1}')
FRAMEWORK=$1
echo "stai wrapper used : "$FRAMEWORK
CONFIG=$(find /usr/local/x-linux-ai -name "config_board_*.sh")
source $CONFIG
cmd="python3 /usr/local/x-linux-ai/image-classification/stai_mpu_image_classification.py -m /usr/local/x-linux-ai/image-classification/models/$IMAGE_CLASSIFICATION_MODEL -l /usr/local/x-linux-ai/image-classification/models/$IMAGE_CLASSIFICATION_LABEL.txt --framerate $DFPS --frame_width $DWIDTH --frame_height $DHEIGHT $OPTIONS"
-if [ "$weston_user" != "root" ]; then
- echo "user : "$weston_user
- script -qc "su -l $weston_user -c '$cmd'"
-else
- $cmd
-fi
+$cmd
diff --git a/stai-mpu/launch_python_image_classification_testdata.sh b/stai-mpu/launch_python_image_classification_testdata.sh
index 25388cd..9d68e90 100755
--- a/stai-mpu/launch_python_image_classification_testdata.sh
+++ b/stai-mpu/launch_python_image_classification_testdata.sh
@@ -5,18 +5,12 @@
#
# This software is licensed under terms that can be found in the LICENSE file
# in the root directory of this software component.
# If no LICENSE file comes with this software, it is provided AS-IS.
-weston_user=$(ps aux | grep '/usr/bin/weston '|grep -v 'grep'|awk '{print $1}')
FRAMEWORK=$1
echo "stai wrapper used : "$FRAMEWORK
CONFIG=$(find /usr/local/x-linux-ai -name "config_board_*.sh")
source $CONFIG
cmd="python3 /usr/local/x-linux-ai/image-classification/stai_mpu_image_classification.py -m /usr/local/x-linux-ai/image-classification/models/$IMAGE_CLASSIFICATION_MODEL -l /usr/local/x-linux-ai/image-classification/models/$IMAGE_CLASSIFICATION_LABEL.txt -i /usr/local/x-linux-ai/image-classification/models/$IMAGE_CLASSIF_DATA"
-if [ "$weston_user" != "root" ]; then
- echo "user : "$weston_user
- script -qc "su -l $weston_user -c '$cmd'"
-else
- $cmd
-fi
+$cmd