From 7598a8053109d943e996252284da1089b06f864c Mon Sep 17 00:00:00 2001 From: Chester Liu <4710575+skyline75489@users.noreply.github.com> Date: Fri, 20 Dec 2024 04:01:52 +0000 Subject: [PATCH 1/5] Update onnxruntime-extension --- cmake/deps.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/deps.txt b/cmake/deps.txt index 6e504c9a7..981710cc7 100644 --- a/cmake/deps.txt +++ b/cmake/deps.txt @@ -14,4 +14,4 @@ pybind11;https://github.com/pybind/pybind11/archive/refs/tags/v2.10.1.zip;769b6a googletest;https://github.com/google/googletest/archive/530d5c8c84abd2a46f38583ee817743c9b3a42b4.zip;5e3a61db2aa975cfd0f97ba92c818744e7fa7034 microsoft_wil;https://github.com/microsoft/wil/archive/refs/tags/v1.0.230629.1.zip;e4a542a323c070376f7c2d1973d0f7ddbc1d2fa5 directx_headers;https://github.com/microsoft/DirectX-Headers/archive/refs/tags/v1.613.1.zip;47653509a3371eabb156360f42faf582f314bf2e -onnxruntime_extensions;https://github.com/microsoft/onnxruntime-extensions.git;2c3e936cfc3401ba7ebb79d02b9e52a50439ffc3 +onnxruntime_extensions;https://github.com/microsoft/onnxruntime-extensions.git;02e098ce00c753b53a096268f1cc027a861fd5f3 From c25314adccc9ff10363910fa76095e0a2f167e73 Mon Sep 17 00:00:00 2001 From: Chester Liu <4710575+skyline75489@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:35:44 +0800 Subject: [PATCH 2/5] Compile --- src/models/audio_processor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/audio_processor.cpp b/src/models/audio_processor.cpp index 3b0ac53ed..8b35cfb23 100644 --- a/src/models/audio_processor.cpp +++ b/src/models/audio_processor.cpp @@ -45,7 +45,7 @@ std::unique_ptr LoadAudios(const std::span& audio_pat } } ort_extensions::OrtxObjectPtr audios; - CheckResult(OrtxLoadAudios(ort_extensions::ptr(audios), audio_paths.data(), audio_paths.size())); + CheckResult(OrtxLoadAudios(audios.ToBeAssigned(), audio_paths.data(), audio_paths.size())); return std::make_unique(std::move(audios), audio_paths.size()); } From da37843920da57dff0805d3ac9cdfb309be8da51 Mon Sep 17 00:00:00 2001 From: Chester Liu <4710575+skyline75489@users.noreply.github.com> Date: Fri, 20 Dec 2024 14:28:03 +0800 Subject: [PATCH 3/5] Audio processor --- src/models/audio_processor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/audio_processor.cpp b/src/models/audio_processor.cpp index 8b35cfb23..1c6c88d14 100644 --- a/src/models/audio_processor.cpp +++ b/src/models/audio_processor.cpp @@ -68,10 +68,10 @@ std::unique_ptr AudioProcessor::Process(const Audios* audios) cons auto named_tensors = std::make_unique(); ort_extensions::OrtxObjectPtr result; - CheckResult(OrtxSpeechLogMel(processor_.get(), audios->audios_.get(), ort_extensions::ptr(result))); + CheckResult(OrtxSpeechLogMel(processor_.get(), audios->audios_.get(), result.ToBeAssigned())); ort_extensions::OrtxObjectPtr mel; - CheckResult(OrtxTensorResultGetAt(result.get(), 0, ort_extensions::ptr(mel))); + CheckResult(OrtxTensorResultGetAt(result.get(), 0, mel.ToBeAssigned())); named_tensors->emplace(std::string(Config::Defaults::InputFeaturesName), std::make_shared(ProcessMel(mel, input_features_type_, allocator))); From ed8998563e3b9d6581226e0869849474b471f840 Mon Sep 17 00:00:00 2001 From: Chester Liu <4710575+skyline75489@users.noreply.github.com> Date: Mon, 23 Dec 2024 14:45:35 +0800 Subject: [PATCH 4/5] deps --- cmake/deps.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/deps.txt b/cmake/deps.txt index 981710cc7..500cdc334 100644 --- a/cmake/deps.txt +++ b/cmake/deps.txt @@ -14,4 +14,4 @@ pybind11;https://github.com/pybind/pybind11/archive/refs/tags/v2.10.1.zip;769b6a googletest;https://github.com/google/googletest/archive/530d5c8c84abd2a46f38583ee817743c9b3a42b4.zip;5e3a61db2aa975cfd0f97ba92c818744e7fa7034 microsoft_wil;https://github.com/microsoft/wil/archive/refs/tags/v1.0.230629.1.zip;e4a542a323c070376f7c2d1973d0f7ddbc1d2fa5 directx_headers;https://github.com/microsoft/DirectX-Headers/archive/refs/tags/v1.613.1.zip;47653509a3371eabb156360f42faf582f314bf2e -onnxruntime_extensions;https://github.com/microsoft/onnxruntime-extensions.git;02e098ce00c753b53a096268f1cc027a861fd5f3 +onnxruntime_extensions;https://github.com/microsoft/onnxruntime-extensions.git;4e10ee046a2f035351f3fe88740bd8215a18fdb9 From 591e44461b7deaf669746df022c1b2a2026a882c Mon Sep 17 00:00:00 2001 From: Chester Liu <4710575+skyline75489@users.noreply.github.com> Date: Wed, 25 Dec 2024 14:42:18 +0800 Subject: [PATCH 5/5] fix apple framework --- build.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index b83c18e11..87316f16e 100644 --- a/build.py +++ b/build.py @@ -505,6 +505,13 @@ def update(args: argparse.Namespace, env: dict[str, str]): "-DPLATFORM_NAME=" + platform_name, ] + if args.ios or args.macos == "Catalyst" or args.build_apple_framework: + command += [ + "-DENABLE_PYTHON=OFF", + "-DENABLE_TESTS=OFF", + "-DENABLE_MODEL_BENCHMARK=OFF", + ] + if args.macos: command += [ f"-DCMAKE_OSX_SYSROOT={args.apple_sysroot}", @@ -531,9 +538,6 @@ def _get_opencv_toolchain_file(): f"-DIPHONEOS_DEPLOYMENT_TARGET={args.apple_deploy_target}", # The following arguments are specific to the OpenCV toolchain file f"-DCMAKE_TOOLCHAIN_FILE={_get_opencv_toolchain_file()}", - "-DENABLE_PYTHON=OFF", - "-DENABLE_TESTS=OFF", - "-DENABLE_MODEL_BENCHMARK=OFF", ] if args.macos == "Catalyst": @@ -552,9 +556,6 @@ def _get_opencv_toolchain_file(): f"-DCMAKE_CC_FLAGS=--target={macabi_target}", f"-DCMAKE_CC_FLAGS_RELEASE=-O3 -DNDEBUG --target={macabi_target}", "-DMAC_CATALYST=1", - "-DENABLE_PYTHON=OFF", - "-DENABLE_TESTS=OFF", - "-DENABLE_MODEL_BENCHMARK=OFF", ] if args.arm64: