ccimx93: update ML/AI packages for NXP release 6.1.55-2.2.0

As part of the integration of the new ML package, also update the
ethos-u-firmware binary built from Stash:

Repo: emp/ethos_u_firmware.git
Revision: bd5506ddba364ad04602d5009b77077f78450b97
Source: NXP's MCUXpresso SDK_2.14.2_MIMX9352xxxxM

Co-authored-by: Javier Viguera <javier.viguera@digi.com>

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Isaac Hermida 2024-01-11 14:40:52 +01:00 committed by Javier Viguera
parent 952edde975
commit 02d1523591
27 changed files with 649 additions and 158 deletions

View File

@ -278,22 +278,23 @@ PREFERRED_VERSION_optee-client:mx9-nxp-bsp ??= "4.0.0.imx"
PREFERRED_VERSION_optee-test:mx8-nxp-bsp ??= "3.19.0.imx"
PREFERRED_VERSION_optee-test:mx9-nxp-bsp ??= "4.0.0.imx"
# Machine learning backports from NXP's lf-6.1.36-2.1.0 release
PREFERRED_VERSION_ethos-u-vela:ccimx93 = "3.8.0"
# Machine learning backports from NXP's lf-6.1.55-2.2.0 release
PREFERRED_VERSION_ethos-u-driver-stack:ccimx93 = "23.08"
PREFERRED_VERSION_ethos-u-firmware:ccimx93 = "23.08"
PREFERRED_VERSION_ethos-u-vela:ccimx93 = "3.9.0"
PREFERRED_VERSION_flatbuffers:ccimx93 = "2.0.7"
PREFERRED_VERSION_flatbuffers-native:ccimx93 = "2.0.7"
PREFERRED_VERSION_onnxruntime:ccimx93 = "1.13.1"
PREFERRED_VERSION_onnxruntime-native:ccimx93 = "1.13.1"
PREFERRED_VERSION_tensorflow-lite:ccimx93 = "2.11.1"
PREFERRED_VERSION_tensorflow-lite-host-tools:ccimx93 = "2.11.1"
PREFERRED_VERSION_tensorflow-lite-host-tools-native:ccimx93 = "2.11.1"
PREFERRED_VERSION_onnxruntime:ccimx93 = "1.16.1"
PREFERRED_VERSION_tensorflow-lite:ccimx93 = "2.12.1"
PREFERRED_VERSION_tensorflow-lite-host-tools:ccimx93 = "2.12.1"
PREFERRED_VERSION_tensorflow-lite-host-tools-native:ccimx93 = "2.12.1"
# Optee runtime packages to install
OPTEE_PKGS ??= "optee-client optee-os"
# Use i.MX opencv Version
PREFERRED_VERSION_opencv:mx8-nxp-bsp ??= "4.6.0.imx"
PREFERRED_VERSION_opencv:mx9-nxp-bsp ??= "4.6.0.imx"
PREFERRED_VERSION_opencv:mx9-nxp-bsp ??= "4.7.0.imx"
EXTRA_IMAGEDEPENDS += "u-boot"

View File

@ -0,0 +1,36 @@
From 9b4959b97d2e95d4b49cf6ca2a3fce3cdb484f2d Mon Sep 17 00:00:00 2001
From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Date: Thu, 31 Mar 2016 00:20:15 +0200
Subject: [PATCH] 3rdparty/ippicv: Use pre-downloaded ipp
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
---
3rdparty/ippicv/ippicv.cmake | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/3rdparty/ippicv/ippicv.cmake b/3rdparty/ippicv/ippicv.cmake
index 257af6fcc6..f88460450f 100644
--- a/3rdparty/ippicv/ippicv.cmake
+++ b/3rdparty/ippicv/ippicv.cmake
@@ -34,18 +34,5 @@ function(download_ippicv root_var)
endif()
set(THE_ROOT "${OpenCV_BINARY_DIR}/3rdparty/ippicv")
- ocv_download(FILENAME ${OPENCV_ICV_NAME}
- HASH ${OPENCV_ICV_HASH}
- URL
- "${OPENCV_IPPICV_URL}"
- "$ENV{OPENCV_IPPICV_URL}"
- "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_COMMIT}/ippicv/"
- DESTINATION_DIR "${THE_ROOT}"
- ID IPPICV
- STATUS res
- UNPACK RELATIVE_URL)
-
- if(res)
- set(${root_var} "${THE_ROOT}/${OPENCV_ICV_PACKAGE_SUBDIR}" PARENT_SCOPE)
- endif()
+ set(${root_var} "${THE_ROOT}/${OPENCV_ICV_PACKAGE_SUBDIR}" PARENT_SCOPE)
endfunction()

View File

@ -0,0 +1,179 @@
From fca4d9eec289f22c081daa2c61a1110e3f268f92 Mon Sep 17 00:00:00 2001
From: Tom Hochstein <tom.hochstein@nxp.com>
Date: Tue, 1 Sep 2020 14:57:07 -0500
Subject: [PATCH] Add smaller version of download_models.py
Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
---
testdata/dnn/download_models_basic.py | 159 ++++++++++++++++++++++++++
1 file changed, 159 insertions(+)
create mode 100644 testdata/dnn/download_models_basic.py
diff --git a/testdata/dnn/download_models_basic.py b/testdata/dnn/download_models_basic.py
new file mode 100644
index 0000000..5c8a616
--- /dev/null
+++ b/testdata/dnn/download_models_basic.py
@@ -0,0 +1,159 @@
+#!/usr/bin/env python
+
+from __future__ import print_function
+import hashlib
+import sys
+import tarfile
+if sys.version_info[0] < 3:
+ from urllib2 import urlopen
+else:
+ from urllib.request import urlopen
+
+
+class Model:
+ MB = 1024*1024
+ BUFSIZE = 10*MB
+
+ def __init__(self, **kwargs):
+ self.name = kwargs.pop('name')
+ self.url = kwargs.pop('url', None)
+ self.filename = kwargs.pop('filename')
+ self.sha = kwargs.pop('sha', None)
+ self.archive = kwargs.pop('archive', None)
+ self.member = kwargs.pop('member', None)
+
+ def __str__(self):
+ return 'Model <{}>'.format(self.name)
+
+ def printRequest(self, r):
+ def getMB(r):
+ d = dict(r.info())
+ for c in ['content-length', 'Content-Length']:
+ if c in d:
+ return int(d[c]) / self.MB
+ return '<unknown>'
+ print(' {} {} [{} Mb]'.format(r.getcode(), r.msg, getMB(r)))
+
+ def verify(self):
+ if not self.sha:
+ return False
+ print(' expect {}'.format(self.sha))
+ sha = hashlib.sha1()
+ try:
+ with open(self.filename, 'rb') as f:
+ while True:
+ buf = f.read(self.BUFSIZE)
+ if not buf:
+ break
+ sha.update(buf)
+ print(' actual {}'.format(sha.hexdigest()))
+ return self.sha == sha.hexdigest()
+ except Exception as e:
+ print(' catch {}'.format(e))
+
+ def get(self):
+ if self.verify():
+ print(' hash match - skipping')
+ return True
+
+ if self.archive or self.member:
+ assert(self.archive and self.member)
+ print(' hash check failed - extracting')
+ print(' get {}'.format(self.member))
+ self.extract()
+ else:
+ assert(self.url)
+ print(' hash check failed - downloading')
+ print(' get {}'.format(self.url))
+ self.download()
+
+ print(' done')
+ print(' file {}'.format(self.filename))
+ return self.verify()
+
+ def download(self):
+ try:
+ r = urlopen(self.url, timeout=60)
+ self.printRequest(r)
+ self.save(r)
+ except Exception as e:
+ print(' catch {}'.format(e))
+
+ def extract(self):
+ try:
+ with tarfile.open(self.archive) as f:
+ assert self.member in f.getnames()
+ self.save(f.extractfile(self.member))
+ except Exception as e:
+ print(' catch {}'.format(e))
+
+ def save(self, r):
+ with open(self.filename, 'wb') as f:
+ print(' progress ', end='')
+ sys.stdout.flush()
+ while True:
+ buf = r.read(self.BUFSIZE)
+ if not buf:
+ break
+ f.write(buf)
+ print('>', end='')
+ sys.stdout.flush()
+
+models = [
+ Model(
+ name='Fcn',
+ url='http://dl.caffe.berkeleyvision.org/fcn8s-heavy-pascal.caffemodel',
+ sha='c449ea74dd7d83751d1357d6a8c323fcf4038962',
+ filename='fcn8s-heavy-pascal.caffemodel'),
+ Model(
+ name='SqueezeNet_v1.1',
+ url='https://raw.githubusercontent.com/DeepScale/SqueezeNet/b5c3f1a23713c8b3fd7b801d229f6b04c64374a5/SqueezeNet_v1.1/squeezenet_v1.1.caffemodel',
+ sha='3397f026368a45ae236403ccc81cfcbe8ebe1bd0',
+ filename='squeezenet_v1.1.caffemodel'),
+ Model(
+ name='Colorization',
+ url='https://raw.githubusercontent.com/richzhang/colorization/master/models/colorization_deploy_v2.prototxt',
+ sha='f528334e386a69cbaaf237a7611d833bef8e5219',
+ filename='colorization_deploy_v2.prototxt'),
+ Model(
+ name='Colorization',
+ url='http://eecs.berkeley.edu/~rich.zhang/projects/2016_colorization/files/demo_v2/colorization_release_v2.caffemodel',
+ sha='21e61293a3fa6747308171c11b6dd18a68a26e7f',
+ filename='colorization_release_v2.caffemodel'),
+ Model(
+ name='OpenPose/pose/coco', # https://github.com/CMU-Perceptual-Computing-Lab/openpose
+ url='http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/coco/pose_iter_440000.caffemodel',
+ sha='ac7e97da66f3ab8169af2e601384c144e23a95c1',
+ filename='openpose_pose_coco.caffemodel'),
+ Model(
+ name='YOLOv3', # https://pjreddie.com/darknet/yolo/
+ url='https://pjreddie.com/media/files/yolov3.weights',
+ sha='520878f12e97cf820529daea502acca380f1cb8e',
+ filename='yolov3.weights'),
+ Model(
+ name='EAST', # https://github.com/argman/EAST (a TensorFlow model), https://arxiv.org/abs/1704.03155v2 (a paper)
+ url='https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1',
+ sha='3ca8233d6edd748f7ed23246c8ca24cbf696bb94',
+ filename='frozen_east_text_detection.tar.gz'),
+ Model(
+ name='EAST',
+ archive='frozen_east_text_detection.tar.gz',
+ member='frozen_east_text_detection.pb',
+ sha='fffabf5ac36f37bddf68e34e84b45f5c4247ed06',
+ filename='frozen_east_text_detection.pb'),
+]
+
+# Note: models will be downloaded to current working directory
+# expected working directory is opencv_extra/testdata/dnn
+if __name__ == '__main__':
+ failedModels = []
+ for m in models:
+ print(m)
+ if not m.get():
+ failedModels.append(m.filename)
+
+ if failedModels:
+ print("Following models have not been downloaded:")
+ for f in failedModels:
+ print("* {}".format(f))
+ exit(15)
--
2.17.1

View File

@ -0,0 +1,28 @@
From 66e50ee69fa9ee2469d349100e70d8b296c4b4dc Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 11 Sep 2018 00:21:18 -0700
Subject: [PATCH] Dont use isystem
clang really does not like it
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
cmake/OpenCVPCHSupport.cmake | 2 ++
1 file changed, 2 insertions(+)
diff --git a/cmake/OpenCVPCHSupport.cmake b/cmake/OpenCVPCHSupport.cmake
index 08cd06def4..46c9c02da3 100644
--- a/cmake/OpenCVPCHSupport.cmake
+++ b/cmake/OpenCVPCHSupport.cmake
@@ -18,6 +18,8 @@ IF(CV_GCC)
SET(PCHSupport_FOUND TRUE)
ENDIF()
+ SET(CMAKE_INCLUDE_SYSTEM_FLAG_C "-I")
+ SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-I")
SET(_PCH_include_prefix "-I")
SET(_PCH_isystem_prefix "-isystem")
SET(_PCH_define_prefix "-D")

View File

@ -0,0 +1,42 @@
From 11bbf909e08594628bd757d989ae34cf1bfe200b Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Thu, 18 Jun 2020 05:51:38 +0000
Subject: [PATCH] Make ts module external
Make ts module external
Reference: https://github.com/qbonnard/opencv/commit/6b229c5834cb9a0930425e762a6c7b03244d7abb
Upstream-Status: Submitted [https://github.com/opencv/opencv/issues/8408]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
modules/ts/CMakeLists.txt | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/modules/ts/CMakeLists.txt b/modules/ts/CMakeLists.txt
index f95bed0793..66f315bcca 100644
--- a/modules/ts/CMakeLists.txt
+++ b/modules/ts/CMakeLists.txt
@@ -4,9 +4,6 @@ if(NOT BUILD_opencv_ts AND NOT BUILD_TESTS AND NOT BUILD_PERF_TESTS)
ocv_module_disable(ts)
endif()
-set(OPENCV_MODULE_TYPE STATIC)
-set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE)
-
if(WINRT)
# WINRT doesn't have access to environment variables
# so adding corresponding macros during CMake run
@@ -16,7 +13,7 @@ endif()
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
-ocv_add_module(ts INTERNAL opencv_core opencv_imgproc opencv_imgcodecs opencv_videoio opencv_highgui)
+ocv_add_module(ts opencv_core opencv_imgproc opencv_imgcodecs opencv_videoio opencv_highgui)
ocv_glob_module_sources()
ocv_module_include_directories()
--
2.24.1

View File

@ -0,0 +1,31 @@
From e4ec6cea72da9e9ae5ba57140fa2f5c63f1f8295 Mon Sep 17 00:00:00 2001
From: Jason Wessel <jason.wessel@windriver.com>
Date: Wed, 9 May 2018 13:33:59 -0700
Subject: [PATCH] Temporarliy work around deprecated ffmpeg RAW function
compile failure until next uprev
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
modules/videoio/src/cap_ffmpeg_impl.hpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp
index 6dca724a89..ae55dd4555 100644
--- a/modules/videoio/src/cap_ffmpeg_impl.hpp
+++ b/modules/videoio/src/cap_ffmpeg_impl.hpp
@@ -774,6 +774,14 @@ struct ImplMutex::Impl
#endif
+/* NOTE This is deprecated in ffmpeg and the code should be removed */
+#ifndef AVFMT_RAWPICTURE
+#define AVFMT_RAWPICTURE 0x0020
+#endif /* AVFMT_RAWPICTURE */
+#ifndef CODEC_FLAG_GLOBAL_HEADER
+#define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
+#endif
+
void ImplMutex::init()
{
impl = new Impl();

View File

@ -0,0 +1,70 @@
From f42c9b8c7bafcadc7e95fb25a391707f970eb426 Mon Sep 17 00:00:00 2001
From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
Date: Fri, 19 May 2017 04:27:50 +0900
Subject: [PATCH] To fix errors as following:
"test_main.cpp:45: undefined reference to `parseCustomOptions(int, char**)'"
"perf_abs.cpp:13: undefined reference to `cvtest::param_seed'"
"test_superres.cpp:270: undefined reference to `checkIppStatus()'"
Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
Also add the visibility changes for certain OpenCL-related functions in
ts module.
Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
---
modules/ts/include/opencv2/ts.hpp | 4 ++--
modules/ts/include/opencv2/ts/ocl_test.hpp | 2 +-
modules/ts/include/opencv2/ts/ts_ext.hpp | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/ts/include/opencv2/ts.hpp b/modules/ts/include/opencv2/ts.hpp
index ed7491a89a..80919d13ee 100644
--- a/modules/ts/include/opencv2/ts.hpp
+++ b/modules/ts/include/opencv2/ts.hpp
@@ -728,7 +728,7 @@ protected:
}
};
-extern uint64 param_seed;
+CV_EXPORTS extern uint64 param_seed;
struct DefaultRngAuto
{
@@ -791,7 +791,7 @@ private:
#endif
#endif
-void parseCustomOptions(int argc, char **argv);
+CV_EXPORTS void parseCustomOptions(int argc, char **argv);
#define CV_TEST_INIT0_NOOP (void)0
diff --git a/modules/ts/include/opencv2/ts/ocl_test.hpp b/modules/ts/include/opencv2/ts/ocl_test.hpp
index 11572e9f48..438112e2aa 100644
--- a/modules/ts/include/opencv2/ts/ocl_test.hpp
+++ b/modules/ts/include/opencv2/ts/ocl_test.hpp
@@ -82,7 +82,7 @@ inline UMat ToUMat(InputArray src)
return dst;
}
-extern int test_loop_times;
+CV_EXPORTS extern int test_loop_times;
#define MAX_VALUE 357
diff --git a/modules/ts/include/opencv2/ts/ts_ext.hpp b/modules/ts/include/opencv2/ts/ts_ext.hpp
index b2a4cac241..b94c681c0c 100644
--- a/modules/ts/include/opencv2/ts/ts_ext.hpp
+++ b/modules/ts/include/opencv2/ts/ts_ext.hpp
@@ -9,7 +9,7 @@
#define OPENCV_TS_EXT_HPP
namespace cvtest {
-void checkIppStatus();
+CV_EXPORTS void checkIppStatus();
extern bool skipUnstableTests;
extern bool runBigDataTests;
extern int testThreads;

View File

@ -0,0 +1,141 @@
From 3c4daafb54f961e376104a461ca7ec114ff0331a Mon Sep 17 00:00:00 2001
From: Ludek Slosarcik <ludek.slosarcik@nxp.com>
Date: Fri, 14 Feb 2020 15:46:50 +0100
Subject: [PATCH] opencv_dnn: added video device for 2 examples, and change text labels
Signed-off-by: Ludek Slosarcik <ludek.slosarcik@nxp.com>
Upstream-Status: Pending
---
samples/cpp/logistic_regression.cpp | 2 +-
samples/dnn/classification.cpp | 7 ++++---
samples/dnn/object_detection.cpp | 10 +++++-----
samples/dnn/segmentation.cpp | 2 +-
samples/dnn/text_detection.cpp | 5 +++--
5 files changed, 14 insertions(+), 12 deletions(-)
Index: git/samples/cpp/logistic_regression.cpp
===================================================================
--- git.orig/samples/cpp/logistic_regression.cpp
+++ git/samples/cpp/logistic_regression.cpp
@@ -28,7 +28,7 @@ static float calculateAccuracyPercent(co
int main()
{
- const String filename = samples::findFile("data01.xml");
+ const String filename = samples::findFile("../data/data01.xml");
cout << "**********************************************************************" << endl;
cout << filename
<< " contains digits 0 and 1 of 20 samples each, collected on an Android device" << endl;
Index: git/samples/dnn/classification.cpp
===================================================================
--- git.orig/samples/dnn/classification.cpp
+++ git/samples/dnn/classification.cpp
@@ -12,6 +12,7 @@ std::string keys =
"{ help h | | Print help message. }"
"{ @alias | | An alias name of model to extract preprocessing parameters from models.yml file. }"
"{ zoo | models.yml | An optional path to file with preprocessing parameters }"
+ "{ device | 0 | camera device number. }"
"{ input i | | Path to input image or video file. Skip this argument to capture frames from a camera.}"
"{ initial_width | 0 | Preprocess input image by initial resizing to a specific width.}"
"{ initial_height | 0 | Preprocess input image by initial resizing to a specific height.}"
@@ -113,7 +114,7 @@ int main(int argc, char** argv)
if (parser.has("input"))
cap.open(parser.get<String>("input"));
else
- cap.open(0);
+ cap.open(parser.get<int>("device"));
//! [Open a video file or an image file or a camera stream]
// Process frames.
@@ -195,14 +196,14 @@ int main(int argc, char** argv)
}
std::string label = format("Inference time of 1 round: %.2f ms", t1);
std::string label2 = format("Average time of 200 rounds: %.2f ms", timeRecorder.getTimeMilli()/200);
- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0));
- putText(frame, label2, Point(0, 35), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0));
+ putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false);
+ putText(frame, label2, Point(0, 45), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false);
// Print predicted class.
label = format("%s: %.4f", (classes.empty() ? format("Class #%d", classId).c_str() :
classes[classId].c_str()),
confidence);
- putText(frame, label, Point(0, 55), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0));
+ putText(frame, label, Point(0, 70), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false);
imshow(kWinName, frame);
}
Index: git/samples/dnn/object_detection.cpp
===================================================================
--- git.orig/samples/dnn/object_detection.cpp
+++ git/samples/dnn/object_detection.cpp
@@ -260,13 +260,13 @@ int main(int argc, char** argv)
if (predictionsQueue.counter > 1)
{
std::string label = format("Camera: %.2f FPS", framesQueue.getFPS());
- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0));
+ putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false);
label = format("Network: %.2f FPS", predictionsQueue.getFPS());
- putText(frame, label, Point(0, 30), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0));
+ putText(frame, label, Point(0, 45), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false);
label = format("Skipped frames: %d", framesQueue.counter - predictionsQueue.counter);
- putText(frame, label, Point(0, 45), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0));
+ putText(frame, label, Point(0, 70), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false);
}
imshow(kWinName, frame);
}
@@ -302,7 +302,7 @@ int main(int argc, char** argv)
double freq = getTickFrequency() / 1000;
double t = net.getPerfProfile(layersTimes) / freq;
std::string label = format("Inference time: %.2f ms", t);
- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0));
+ putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false);
imshow(kWinName, frame);
}
@@ -471,7 +471,7 @@ void drawPred(int classId, float conf, i
top = max(top, labelSize.height);
rectangle(frame, Point(left, top - labelSize.height),
Point(left + labelSize.width, top + baseLine), Scalar::all(255), FILLED);
- putText(frame, label, Point(left, top), FONT_HERSHEY_SIMPLEX, 0.5, Scalar());
+ putText(frame, label, Point(left, top), FONT_HERSHEY_SIMPLEX, 0.8, Scalar());
}
void callback(int pos, void*)
Index: git/samples/dnn/segmentation.cpp
===================================================================
--- git.orig/samples/dnn/segmentation.cpp
+++ git/samples/dnn/segmentation.cpp
@@ -162,7 +162,7 @@ int main(int argc, char** argv)
double freq = getTickFrequency() / 1000;
double t = net.getPerfProfile(layersTimes) / freq;
std::string label = format("Inference time: %.2f ms", t);
- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0));
+ putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false);
imshow(kWinName, frame);
if (!classes.empty())
Index: git/samples/dnn/text_detection.cpp
===================================================================
--- git.orig/samples/dnn/text_detection.cpp
+++ git/samples/dnn/text_detection.cpp
@@ -30,6 +30,7 @@ using namespace cv::dnn;
const char* keys =
"{ help h | | Print help message. }"
"{ input i | | Path to input image or video file. Skip this argument to capture frames from a camera.}"
+ "{ device | 0 | camera device number. }"
"{ detModel dmp | | Path to a binary .pb file contains trained detector network.}"
"{ width | 320 | Preprocess input image by resizing to a specific width. It should be multiple by 32. }"
"{ height | 320 | Preprocess input image by resizing to a specific height. It should be multiple by 32. }"
@@ -106,7 +107,7 @@ int main(int argc, char** argv)
// Open a video file or an image file or a camera stream.
VideoCapture cap;
- bool openSuccess = parser.has("input") ? cap.open(parser.get<String>("input")) : cap.open(0);
+ bool openSuccess = parser.has("input") ? cap.open(parser.get<String>("input")) : cap.open(parser.get<int>("device"));
CV_Assert(openSuccess);
static const std::string kWinName = "EAST: An Efficient and Accurate Scene Text Detector";

View File

@ -0,0 +1,41 @@
From b18a280fab06a680d9f831bf8b462647f3cb6214 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@intel.com>
Date: Thu, 9 Jan 2020 16:24:24 +0000
Subject: [PATCH] opencv: abort configure if we need to download
This CMake module will download files during do_configure. This is bad as it
means we can't do offline builds.
Add an option to disallow downloads by emitting a fatal error.
Upstream-Status: Pending
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
cmake/OpenCVDownload.cmake | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake
index 63cf6d3238..4acf477f70 100644
--- a/cmake/OpenCVDownload.cmake
+++ b/cmake/OpenCVDownload.cmake
@@ -14,6 +14,7 @@
# RELATIVE_URL - if set, then URL is treated as a base, and FILENAME will be appended to it
# Note: uses OPENCV_DOWNLOAD_PATH folder as cache, default is <opencv>/.cache
+set(OPENCV_ALLOW_DOWNLOADS ON CACHE BOOL "Allow downloads")
set(HELP_OPENCV_DOWNLOAD_PATH "Cache directory for downloaded files")
if(DEFINED ENV{OPENCV_DOWNLOAD_PATH})
set(OPENCV_DOWNLOAD_PATH "$ENV{OPENCV_DOWNLOAD_PATH}" CACHE PATH "${HELP_OPENCV_DOWNLOAD_PATH}")
@@ -156,6 +157,11 @@ function(ocv_download)
# Download
if(NOT EXISTS "${CACHE_CANDIDATE}")
+ if(NOT OPENCV_ALLOW_DOWNLOADS)
+ message(FATAL_ERROR "Not going to download ${DL_FILENAME}")
+ return()
+ endif()
+
ocv_download_log("#cmake_download \"${CACHE_CANDIDATE}\" \"${DL_URL}\"")
foreach(try ${OPENCV_DOWNLOAD_TRIES_LIST})
ocv_download_log("#try ${try}")

View File

@ -0,0 +1,23 @@
# Copyright 2024 Digi International Inc.
#
# Reuse meta-freescale's opencv_4.6.0.imx.bb
#
require recipes-support/opencv/opencv_4.6.0.imx.bb
SRC_URI:remove = "file://0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch"
SRCBRANCH = "4.7.0_imx"
SRCREV_opencv = "3acf6a50fcb4f774728d2338553ad646ccc14b14"
# Update opencv_contrib
SRC_URI:remove = "git://github.com/opencv/opencv_contrib.git;destsuffix=git/contrib;name=contrib;branch=master;protocol=https"
SRC_URI += "git://github.com/opencv/opencv_contrib.git;destsuffix=git/contrib;name=contrib;branch=4.x;protocol=https"
SRCREV_contrib = "e247b680a6bd396f110274b6c214406a93171350"
SRC_URI:remove = "git://github.com/opencv/opencv_extra.git;destsuffix=extra;name=extra;branch=master;protocol=https"
SRC_URI =+ "git://github.com/opencv/opencv_extra.git;destsuffix=extra;name=extra;branch=4.x;protocol=https"
SRCREV_extra = "5abbd7e0546bbb34ae7487170383d3e571fb1dd1"
COMPATIBLE_MACHINE = "(mx9-nxp-bsp)"

View File

@ -1,9 +1,8 @@
# Copyright 2023 Digi International Inc.
# Copyright 2023,2024 Digi International Inc.
ML_NNSTREAMER_PKGS_LIST:remove = "nnstreamer-deepview-rt"
ML_PKGS:mx9-nxp-bsp:remove = "deepview-rt-examples"
ML_PKGS:mx9-nxp-bsp:append = " modelrunner"
# ARM ethos-u package
ETHOS_U_PKGS:append:mx93-nxp-bsp = " \

View File

@ -1,6 +1,6 @@
# Copyright 2023 Digi International Inc.
# Copyright 2023,2024 Digi International Inc.
SRCBRANCH = "lf-6.1.36_2.1.0"
SRCREV = "b956e65221fca7dadfd8bdfd13279beacce17bc9"
SRCBRANCH:ccimx93 = "imx_22.05"
SRCREV:ccimx93 = "37fc035060646db5048648da01db3738f08e3bfa"
SCONS_MAXLINELENGTH = ""

View File

@ -5,8 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
SRC_URI = "${EIQ_EXAMPLES_SRC};branch=${SRCBRANCH}"
EIQ_EXAMPLES_SRC ?= "git://github.com/nxp-imx/eiq-example.git;protocol=https"
SRCBRANCH = "lf-6.1.36_2.1.0"
SRCREV = "47da4f9c4d568704f8835dde62cfc61f16e89ba6"
SRCBRANCH = "lf-6.1.55_2.2.0"
SRCREV = "4a21f2919e7e16ca1847672b6ed1ecfa60f1a86f"
S = "${WORKDIR}/git"

View File

@ -1,6 +0,0 @@
# Copyright (C) 2023 Digi International
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e"
SRCBRANCH = "lf-6.1.36_2.1.0"
SRCREV = "98759f579297726474d6b32927694502c66ce15a"

View File

@ -0,0 +1,11 @@
# Copyright 2024 Digi International Inc.
#
# Reuse meta-imx/meta-ml ethos-u-driver-stack_22.08.bb
#
require recipes-libraries/ethos-u-driver-stack/ethos-u-driver-stack_22.08.bb
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e"
SRCBRANCH = "lf-6.1.55_2.2.0"
SRCREV = "f8975c4d44e7893dcf106d4afaff55e30470b463"

View File

@ -1,17 +0,0 @@
# Copyright 2023 Digi International Inc.
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
LIC_FILES_CHKSUM = "\
file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e \
file://LICENSE-GPL-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://LICENSE-BSD-3.txt;md5=0858ec9c7a80c4a2cf16e4f825a2cc91 \
"
SRCBRANCH = "lf-6.1.36_2.1.0"
SRCREV = "5fff874731d02bb232159108ccfa6833e92b6942"
SRC_URI:append:ccimx93 = " file://ethosu_firmware"
do_install:append:ccimx93 () {
install -m 0644 ${WORKDIR}/ethosu_firmware ${D}${nonarch_base_libdir}/firmware
}

View File

@ -0,0 +1,21 @@
# Copyright 2024 Digi International Inc.
#
# Reuse meta-imx/meta-ml ethos-u-firmware_22.08.bb
#
require recipes-libraries/ethos-u-driver-stack/ethos-u-firmware_22.08.bb
LIC_FILES_CHKSUM = "\
file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e \
file://LICENSE-GPL-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://LICENSE-BSD-3.txt;md5=0858ec9c7a80c4a2cf16e4f825a2cc91 \
"
SRCBRANCH = "lf-6.1.55_2.2.0"
SRCREV = "7639c9a8ded082c642ff86e55ca053950e6b2486"
SRC_URI:append:ccimx93 = " file://ethosu_firmware"
do_install:ccimx93 () {
install -d ${D}${nonarch_base_libdir}/firmware
install -m 0644 ${WORKDIR}/ethosu_firmware ${D}${nonarch_base_libdir}/firmware/ethosu_firmware
}

View File

@ -8,8 +8,8 @@ DEPENDS = "python3-pip-native python3-wheel-native flatbuffers python3-numpy pyt
SRC_URI = "${VELA_SRC};branch=${SRCBRANCH}"
VELA_SRC ?= "git://github.com/nxp-imx/ethos-u-vela.git;protocol=https"
SRCBRANCH = "lf-6.1.36_2.1.0"
SRCREV = "2647a977643907b2cf2249b917549133302aaa8e"
SRCBRANCH = "lf-6.1.55_2.2.0"
SRCREV = "b8f74c2fcdce8ceb0fe5e2401ae10359a12224e4"
S = "${WORKDIR}/git"

View File

@ -1,44 +0,0 @@
DESCRIPTION = "This package includes the updated and experimental ModelRunner for TensorFlow Lite and ARM NN"
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://COPYING;md5=db4762b09b6bda63da103963e6e081de"
SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true"
SRC_URI[md5sum] = "c1e293af3bcb44925bff11fbd63cb1bd"
SRC_URI[sha256sum] = "a7008d3d3ecd09fe2450ef8ed721ecde07ebf04dfff714f59424625a3cb5ba0d"
S = "${WORKDIR}/${BPN}-${PV}"
inherit fsl-eula-unpack python3native
PACKAGECONFIG ?= "${PACKAGECONFIG_OPENVX}"
PACKAGECONFIG_OPENVX = ""
PACKAGECONFIG_OPENVX:mx8-nxp-bsp:imxgpu = "openvx"
PACKAGECONFIG_OPENVX:mx8mm-nxp-bsp = ""
# The tensorflow-lite implementation for 8ULP uses CPU, and so doesn't
# support OpenVX
PACKAGECONFIG_OPENVX:mx8ulp-nxp-bsp = ""
PACKAGECONFIG[openvx] = ",,,libopenvx-imx"
do_install () {
install -d ${D}${bindir}
install -d ${D}${libdir}
cp -r ${S}/modelrunner/bin/* ${D}${bindir}
cp -rP ${S}/modelrunner/lib/* ${D}${libdir}
chown -R root:root "${D}"
}
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_SYSROOT_STRIP = "1"
FILES_SOLIBSDEV = ""
FILES:${PN} += "${libdir}/*"
RDEPENDS:${PN} = "onnxruntime tensorflow-lite"
INSANE_SKIP:${PN} += "dev-so dev-deps ldflags"
BBCLASSEXTEND = "nativesdk"
COMPATIBLE_MACHINE = "(mx8-nxp-bsp|mx9-nxp-bsp)"

View File

@ -1,34 +0,0 @@
# Copyright 2023 NXP
DESCRIPTION = "Parts of ONNX Runtime that needs to be compiled for native system"
SECTION = "devel"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=37b5762e07f0af8c74ce80a8bda4266b"
# For ONNX Runtime v0.3.0 we need only 'protoc' to be compiled for native system
# 3.18.3
GIT_protobuf = "git://github.com/google/protobuf.git;nobranch=1;name=protobuf;protocol=https"
SRCREV_protobuf = "a902b39270841beafc307dfa709610aa1cac2f06"
SRC_URI = "\
${GIT_protobuf} \
"
SRCREV_FORMAT = "protobuf"
S = "${WORKDIR}/git"
inherit cmake
inherit native
OECMAKE_SOURCEPATH = "${S}/cmake"
EXTRA_OECMAKE += "\
-Dprotobuf_BUILD_TESTS=OFF \
-Dprotobuf_BUILD_EXAMPLES=OFF \
-Dprotobuf_BUILD_SHARED_LIBS=OFF \
"
do_install() {
install -d ${D}/${bindir}/${PN}
install -m 0755 ${B}/protoc ${D}/${bindir}/${PN}
}

View File

@ -6,16 +6,14 @@ LIC_FILES_CHKSUM_runtime = "file://LICENSE;md5=0f7e3b1308cb5c00b372a6e78835732d"
LIC_FILES_CHKSUM_model = "file://${S}/example-models/squeezenet/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
LIC_FILES_CHKSUM = "${LIC_FILES_CHKSUM_runtime} ${LIC_FILES_CHKSUM_model}"
DEPENDS = "libpng zlib ${BPN}-native"
DEPENDS = "libpng zlib"
inherit setuptools3
SRC_URI = "${ONNXRUNTIME_SRC};branch=${SRCBRANCH}"
ONNXRUNTIME_SRC ?= "gitsm://github.com/nxp-imx/onnxruntime-imx.git;protocol=https"
SRCBRANCH_runtime = "lf-6.1.36_2.1.0"
SRC_URI = "${ONNXRUNTIME_SRC};branch=${SRCBRANCH_runtime};name=runtime"
SRCREV_runtime = "0f642b5e71e6e9c9681b90b2844176ab7eacf6eb"
SRCREV_FORMAT = "runtime_model"
SRCBRANCH = "lf-6.1.55_2.2.0"
SRCREV = "1582e774d7c120a5dfbdbf6e11c8788e710ab93f"
S = "${WORKDIR}/git"
@ -25,19 +23,11 @@ OECMAKE_SOURCEPATH = "${S}/cmake"
OECMAKE_GENERATOR = "Unix Makefiles"
# Notes:
# Protobuff/Protoc:
# - protobuf is essetially built twice for native and target system
# - DONNX_CUSTOM_PROTOC_EXECUTABLE - use native protoc
# - onnxruntime_USE_PREBUILT_PB=OFF - we still need protobuf compiled from target system; although we already have native version
# Eigen:
# - the git operation within CMake fails, so we treat it as 'pre-installed' although it's fetched during fetch phase
# - the eigen_SOURCE_PATH needs to match 'destsuffix' in SRC_URI for eigen
# Abseil:
# - FETCHCONTENT_FULLY_DISCONNECTED=OFF and do_configure:prepend() added to allow
# abseil build process (the issue was related to CMake not fetching sources)
EXTRA_OECMAKE += "\
-DONNX_CUSTOM_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/${PN}-native/protoc \
-DFETCHCONTENT_FULLY_DISCONNECTED=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-Donnxruntime_BUILD_UNIT_TESTS=ON \
@ -61,7 +51,7 @@ PYTHON_RDEPENDS = "\
${PYTHON_PN}-sympy \
"
PACKAGECONFIG ?= "crosscompiling sharedlib nnapi python"
PACKAGECONFIG ?= "crosscompiling sharedlib python"
PACKAGECONFIG[nsync] = "-Donnxruntime_USE_NSYNC=ON, -Donnxruntime_USE_NSYNC=OFF"
PACKAGECONFIG[prebuilt] = "-Donnxruntime_USE_PREBUILT_PB=ON, -Donnxruntime_USE_PREBUILT_PB=OFF"
@ -163,7 +153,6 @@ do_install:append() {
# Install test binaries and data in test package
install -d ${D}${bindir}/${BP}/tests
install -m 0744 ${B}/libcustom_op_library.so ${D}${bindir}/${BP}/tests
install -m 0744 ${B}/onnxruntime_api_tests_without_env ${D}${bindir}/${BP}/tests
install -m 0744 ${B}/onnxruntime_global_thread_pools_test ${D}${bindir}/${BP}/tests
install -m 0744 ${B}/onnxruntime_mlas_test ${D}${bindir}/${BP}/tests
install -m 0744 ${B}/onnxruntime_shared_lib_test ${D}${bindir}/${BP}/tests
@ -193,5 +182,3 @@ FILES:${PN}-tests = "${bindir}/${BP}/tests/*"
# onnxruntime_shared_lib_test requires the shlib to be in the same directory as testdata to run properly
INSANE_SKIP:${PN}-tests += "libdir"
INSANE_SKIP:${PN}-dbg += "libdir"
RDEPENDS:${PN}-tests += "arm-compute-library"

View File

@ -1,5 +1,5 @@
# Copyright 2020-2021 NXP
TENSORFLOW_LITE_SRC ?= "git://github.com/nxp-imx/tensorflow-imx.git;protocol=https"
SRCBRANCH_tf = "lf-6.1.36_2.1.0"
SRCREV_tf = "11e92c028eceff5b5835d15e3666a4d3d7ef1088"
SRCBRANCH_tf = "lf-6.1.55_2.2.0"
SRCREV_tf = "22641785b73a34cc88d8d5276bc7697013510a16"

View File

@ -8,8 +8,8 @@ DEPENDS = "tensorflow-lite ethos-u-driver-stack"
require tensorflow-lite-${PV}.inc
TENSORFLOW_LITE_ETHOSU_DELEGATE_SRC ?= "git://github.com/nxp-imx/tflite-ethosu-delegate-imx.git;protocol=https"
SRCBRANCH_ethosu = "lf-6.1.36_2.1.0"
SRCREV_ethosu = "0f8670a7c25ee2b2022a471ee50d394429ecf716"
SRCBRANCH_ethosu = "lf-6.1.55_2.2.0"
SRCREV_ethosu = "8f4df6a8bed86feb699f77a84e5f5b02839db53f"
SRCREV_FORMAT = "ethosu_tf"

View File

@ -1,12 +0,0 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append = " file://tensorflow-lite.pc.in"
do_install:append() {
install -d ${D}${libdir}/pkgconfig
install -m 0644 ${WORKDIR}/tensorflow-lite.pc.in ${D}${libdir}/pkgconfig/tensorflow2-lite.pc
sed -i 's:@version@:${PV}:g
s:@libdir@:${libdir}:g
s:@includedir@:${includedir}:g' ${D}${libdir}/pkgconfig/tensorflow2-lite.pc
}

View File

@ -18,12 +18,6 @@ S = "${WORKDIR}/git"
inherit python3native cmake
PACKAGECONFIG ??= "${PACKAGECONFIG_ETHOSU}"
PACKAGECONFIG_ETHOSU = ""
PACKAGECONFIG_ETHOSU:mx93-nxp-bsp = "ethosu"
PACKAGECONFIG[ethosu] = "-DTFLITE_ENABLE_ETHOSU=on,-DTFLITE_ENABLE_ETHOSU=off,ethos-u-driver-stack"
EXTRA_OECMAKE = " \
-DCMAKE_SYSROOT=${PKG_CONFIG_SYSROOT_DIR} \
-DFETCHCONTENT_FULLY_DISCONNECTED=OFF \