react-native-executorch 0.4.8 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/CMakeLists.txt +17 -0
- package/android/build.gradle +76 -13
- package/android/libs/classes.jar +0 -0
- package/android/src/main/cpp/CMakeLists.txt +73 -0
- package/android/src/main/cpp/ETInstallerModule.cpp +76 -0
- package/android/src/main/cpp/ETInstallerModule.h +43 -0
- package/android/src/main/java/com/swmansion/rnexecutorch/ETInstaller.kt +66 -0
- package/android/src/main/java/com/swmansion/rnexecutorch/LLM.kt +3 -3
- package/android/src/main/java/com/swmansion/rnexecutorch/RnExecutorchPackage.kt +7 -113
- package/common/ada/ada.cpp +17406 -0
- package/common/ada/ada.h +10274 -0
- package/common/pfft/pfft.c +2205 -0
- package/common/pfft/pfft.h +185 -0
- package/common/rnexecutorch/Log.h +489 -0
- package/common/rnexecutorch/RnExecutorchInstaller.cpp +78 -0
- package/common/rnexecutorch/RnExecutorchInstaller.h +112 -0
- package/common/rnexecutorch/TokenizerModule.cpp +52 -0
- package/common/rnexecutorch/TokenizerModule.h +26 -0
- package/common/rnexecutorch/data_processing/FFT.cpp +21 -0
- package/common/rnexecutorch/data_processing/FFT.h +23 -0
- package/common/rnexecutorch/data_processing/FileUtils.h +30 -0
- package/common/rnexecutorch/data_processing/ImageProcessing.cpp +240 -0
- package/common/rnexecutorch/data_processing/ImageProcessing.h +55 -0
- package/common/rnexecutorch/data_processing/Numerical.cpp +82 -0
- package/common/rnexecutorch/data_processing/Numerical.h +23 -0
- package/common/rnexecutorch/data_processing/base64.cpp +110 -0
- package/common/rnexecutorch/data_processing/base64.h +46 -0
- package/common/rnexecutorch/data_processing/dsp.cpp +65 -0
- package/common/rnexecutorch/data_processing/dsp.h +12 -0
- package/common/rnexecutorch/host_objects/JSTensorViewIn.h +12 -0
- package/common/rnexecutorch/host_objects/JSTensorViewOut.h +22 -0
- package/common/rnexecutorch/host_objects/JsiConversions.h +410 -0
- package/common/rnexecutorch/host_objects/ModelHostObject.h +239 -0
- package/common/rnexecutorch/jsi/JsiHostObject.cpp +108 -0
- package/common/rnexecutorch/jsi/JsiHostObject.h +87 -0
- package/common/rnexecutorch/jsi/OwningArrayBuffer.h +40 -0
- package/common/rnexecutorch/jsi/Promise.cpp +20 -0
- package/common/rnexecutorch/jsi/Promise.h +69 -0
- package/common/rnexecutorch/jsi/RuntimeAwareCache.h +58 -0
- package/common/rnexecutorch/jsi/RuntimeLifecycleMonitor.cpp +53 -0
- package/common/rnexecutorch/jsi/RuntimeLifecycleMonitor.h +35 -0
- package/common/rnexecutorch/metaprogramming/ConstructorHelpers.h +131 -0
- package/common/rnexecutorch/metaprogramming/FunctionHelpers.h +50 -0
- package/common/rnexecutorch/metaprogramming/TypeConcepts.h +37 -0
- package/common/rnexecutorch/models/BaseModel.cpp +181 -0
- package/common/rnexecutorch/models/BaseModel.h +47 -0
- package/common/rnexecutorch/models/EncoderDecoderBase.cpp +21 -0
- package/common/rnexecutorch/models/EncoderDecoderBase.h +31 -0
- package/common/rnexecutorch/models/classification/Classification.cpp +72 -0
- package/common/rnexecutorch/models/classification/Classification.h +26 -0
- package/{ios/RnExecutorch/models/classification/Constants.mm → common/rnexecutorch/models/classification/Constants.h} +7 -2
- package/common/rnexecutorch/models/embeddings/BaseEmbeddings.cpp +27 -0
- package/common/rnexecutorch/models/embeddings/BaseEmbeddings.h +17 -0
- package/common/rnexecutorch/models/embeddings/image/ImageEmbeddings.cpp +45 -0
- package/common/rnexecutorch/models/embeddings/image/ImageEmbeddings.h +23 -0
- package/common/rnexecutorch/models/embeddings/text/TextEmbeddings.cpp +61 -0
- package/common/rnexecutorch/models/embeddings/text/TextEmbeddings.h +26 -0
- package/{ios/RnExecutorch/models/image_segmentation/Constants.mm → common/rnexecutorch/models/image_segmentation/Constants.h} +7 -2
- package/common/rnexecutorch/models/image_segmentation/ImageSegmentation.cpp +173 -0
- package/common/rnexecutorch/models/image_segmentation/ImageSegmentation.h +43 -0
- package/{ios/RnExecutorch/utils/Constants.mm → common/rnexecutorch/models/object_detection/Constants.h} +9 -2
- package/common/rnexecutorch/models/object_detection/ObjectDetection.cpp +82 -0
- package/common/rnexecutorch/models/object_detection/ObjectDetection.h +31 -0
- package/{ios/RnExecutorch/utils/ObjectDetectionUtils.mm → common/rnexecutorch/models/object_detection/Utils.cpp} +10 -30
- package/common/rnexecutorch/models/object_detection/Utils.h +17 -0
- package/common/rnexecutorch/models/ocr/CTCLabelConverter.cpp +88 -0
- package/common/rnexecutorch/models/ocr/CTCLabelConverter.h +29 -0
- package/common/rnexecutorch/models/ocr/Constants.h +34 -0
- package/common/rnexecutorch/models/ocr/Detector.cpp +102 -0
- package/common/rnexecutorch/models/ocr/Detector.h +30 -0
- package/common/rnexecutorch/models/ocr/DetectorUtils.cpp +703 -0
- package/common/rnexecutorch/models/ocr/DetectorUtils.h +80 -0
- package/common/rnexecutorch/models/ocr/OCR.cpp +52 -0
- package/common/rnexecutorch/models/ocr/OCR.h +36 -0
- package/common/rnexecutorch/models/ocr/RecognitionHandler.cpp +107 -0
- package/common/rnexecutorch/models/ocr/RecognitionHandler.h +40 -0
- package/common/rnexecutorch/models/ocr/RecognitionHandlerUtils.cpp +153 -0
- package/common/rnexecutorch/models/ocr/RecognitionHandlerUtils.h +72 -0
- package/common/rnexecutorch/models/ocr/Recognizer.cpp +80 -0
- package/common/rnexecutorch/models/ocr/Recognizer.h +36 -0
- package/common/rnexecutorch/models/ocr/RecognizerUtils.cpp +202 -0
- package/common/rnexecutorch/models/ocr/RecognizerUtils.h +70 -0
- package/common/rnexecutorch/models/ocr/Types.h +37 -0
- package/common/rnexecutorch/models/speech_to_text/SpeechToText.cpp +64 -0
- package/common/rnexecutorch/models/speech_to_text/SpeechToText.h +31 -0
- package/common/rnexecutorch/models/speech_to_text/SpeechToTextStrategy.h +27 -0
- package/common/rnexecutorch/models/speech_to_text/WhisperStrategy.cpp +50 -0
- package/common/rnexecutorch/models/speech_to_text/WhisperStrategy.h +25 -0
- package/common/rnexecutorch/models/style_transfer/StyleTransfer.cpp +55 -0
- package/common/rnexecutorch/models/style_transfer/StyleTransfer.h +29 -0
- package/common/rnexecutorch/models/vertical_ocr/VerticalDetector.cpp +92 -0
- package/common/rnexecutorch/models/vertical_ocr/VerticalDetector.h +49 -0
- package/common/rnexecutorch/models/vertical_ocr/VerticalOCR.cpp +180 -0
- package/common/rnexecutorch/models/vertical_ocr/VerticalOCR.h +78 -0
- package/common/rnexecutorch/tests/LogTest.cpp +530 -0
- package/common/rnexecutorch/tests/README.md +20 -0
- package/common/rnexecutorch/tests/run_all_tests.sh +14 -0
- package/common/rnexecutorch/tests/run_test.sh +18 -0
- package/ios/ExecutorchLib.xcframework/Info.plist +4 -4
- package/ios/ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/ExecutorchLib +0 -0
- package/ios/ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/Info.plist +0 -0
- package/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/ExecutorchLib +0 -0
- package/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/Info.plist +0 -0
- package/ios/RnExecutorch/ETInstaller.h +8 -0
- package/ios/RnExecutorch/ETInstaller.mm +56 -0
- package/ios/RnExecutorch/utils/Conversions.h +8 -9
- package/ios/RnExecutorch/utils/Numerical.h +2 -0
- package/ios/RnExecutorch.xcodeproj/project.pbxproj +73 -0
- package/lib/module/Error.js +2 -0
- package/lib/module/Error.js.map +1 -1
- package/lib/module/common/Logger.js +23 -0
- package/lib/module/common/Logger.js.map +1 -0
- package/lib/module/constants/llmDefaults.js +8 -0
- package/lib/module/constants/llmDefaults.js.map +1 -1
- package/lib/module/constants/modelUrls.js +328 -84
- package/lib/module/constants/modelUrls.js.map +1 -1
- package/lib/module/constants/ocr/models.js +181 -286
- package/lib/module/constants/ocr/models.js.map +1 -1
- package/lib/module/constants/ocr/symbols.js +63 -63
- package/lib/module/controllers/LLMController.js +17 -11
- package/lib/module/controllers/LLMController.js.map +1 -1
- package/lib/module/controllers/OCRController.js +16 -9
- package/lib/module/controllers/OCRController.js.map +1 -1
- package/lib/module/controllers/VerticalOCRController.js +16 -9
- package/lib/module/controllers/VerticalOCRController.js.map +1 -1
- package/lib/module/hooks/computer_vision/useClassification.js +5 -5
- package/lib/module/hooks/computer_vision/useClassification.js.map +1 -1
- package/lib/module/hooks/computer_vision/useImageEmbeddings.js +13 -0
- package/lib/module/hooks/computer_vision/useImageEmbeddings.js.map +1 -0
- package/lib/module/hooks/computer_vision/useImageSegmentation.js +4 -4
- package/lib/module/hooks/computer_vision/useImageSegmentation.js.map +1 -1
- package/lib/module/hooks/computer_vision/useOCR.js +14 -15
- package/lib/module/hooks/computer_vision/useOCR.js.map +1 -1
- package/lib/module/hooks/computer_vision/useObjectDetection.js +5 -5
- package/lib/module/hooks/computer_vision/useObjectDetection.js.map +1 -1
- package/lib/module/hooks/computer_vision/useStyleTransfer.js +5 -5
- package/lib/module/hooks/computer_vision/useStyleTransfer.js.map +1 -1
- package/lib/module/hooks/computer_vision/useVerticalOCR.js +16 -17
- package/lib/module/hooks/computer_vision/useVerticalOCR.js.map +1 -1
- package/lib/module/hooks/general/useExecutorchModule.js +5 -3
- package/lib/module/hooks/general/useExecutorchModule.js.map +1 -1
- package/lib/module/hooks/natural_language_processing/useLLM.js +22 -25
- package/lib/module/hooks/natural_language_processing/useLLM.js.map +1 -1
- package/lib/module/hooks/natural_language_processing/useSpeechToText.js +72 -33
- package/lib/module/hooks/natural_language_processing/useSpeechToText.js.map +1 -1
- package/lib/module/hooks/natural_language_processing/useTextEmbeddings.js +4 -5
- package/lib/module/hooks/natural_language_processing/useTextEmbeddings.js.map +1 -1
- package/lib/module/hooks/natural_language_processing/useTokenizer.js +20 -19
- package/lib/module/hooks/natural_language_processing/useTokenizer.js.map +1 -1
- package/lib/module/hooks/useNonStaticModule.js +52 -0
- package/lib/module/hooks/useNonStaticModule.js.map +1 -0
- package/lib/module/index.js +15 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/BaseModule.js +6 -3
- package/lib/module/modules/BaseModule.js.map +1 -1
- package/lib/module/modules/BaseNonStaticModule.js +17 -0
- package/lib/module/modules/BaseNonStaticModule.js.map +1 -0
- package/lib/module/modules/computer_vision/ClassificationModule.js +13 -8
- package/lib/module/modules/computer_vision/ClassificationModule.js.map +1 -1
- package/lib/module/modules/computer_vision/ImageEmbeddingsModule.js +19 -0
- package/lib/module/modules/computer_vision/ImageEmbeddingsModule.js.map +1 -0
- package/lib/module/modules/computer_vision/ImageSegmentationModule.js +21 -19
- package/lib/module/modules/computer_vision/ImageSegmentationModule.js.map +1 -1
- package/lib/module/modules/computer_vision/OCRModule.js +13 -10
- package/lib/module/modules/computer_vision/OCRModule.js.map +1 -1
- package/lib/module/modules/computer_vision/ObjectDetectionModule.js +13 -8
- package/lib/module/modules/computer_vision/ObjectDetectionModule.js.map +1 -1
- package/lib/module/modules/computer_vision/StyleTransferModule.js +13 -8
- package/lib/module/modules/computer_vision/StyleTransferModule.js.map +1 -1
- package/lib/module/modules/computer_vision/VerticalOCRModule.js +15 -10
- package/lib/module/modules/computer_vision/VerticalOCRModule.js.map +1 -1
- package/lib/module/modules/general/ExecutorchModule.js +10 -36
- package/lib/module/modules/general/ExecutorchModule.js.map +1 -1
- package/lib/module/modules/natural_language_processing/LLMModule.js +18 -22
- package/lib/module/modules/natural_language_processing/LLMModule.js.map +1 -1
- package/lib/module/modules/natural_language_processing/SpeechToTextModule.js +79 -27
- package/lib/module/modules/natural_language_processing/SpeechToTextModule.js.map +1 -1
- package/lib/module/modules/natural_language_processing/TextEmbeddingsModule.js +15 -8
- package/lib/module/modules/natural_language_processing/TextEmbeddingsModule.js.map +1 -1
- package/lib/module/modules/natural_language_processing/TokenizerModule.js +20 -14
- package/lib/module/modules/natural_language_processing/TokenizerModule.js.map +1 -1
- package/lib/module/native/NativeETInstaller.js +5 -0
- package/lib/module/native/NativeETInstaller.js.map +1 -0
- package/lib/module/native/RnExecutorchModules.js +2 -11
- package/lib/module/native/RnExecutorchModules.js.map +1 -1
- package/lib/module/types/common.js +25 -8
- package/lib/module/types/common.js.map +1 -1
- package/lib/module/types/stt.js +1 -79
- package/lib/module/types/stt.js.map +1 -1
- package/lib/module/utils/ResourceFetcher.js +276 -114
- package/lib/module/utils/ResourceFetcher.js.map +1 -1
- package/lib/module/utils/ResourceFetcherUtils.js +155 -0
- package/lib/module/utils/ResourceFetcherUtils.js.map +1 -0
- package/lib/module/utils/SpeechToTextModule/ASR.js +191 -0
- package/lib/module/utils/SpeechToTextModule/ASR.js.map +1 -0
- package/lib/module/utils/SpeechToTextModule/OnlineProcessor.js +73 -0
- package/lib/module/utils/SpeechToTextModule/OnlineProcessor.js.map +1 -0
- package/lib/module/utils/SpeechToTextModule/hypothesisBuffer.js +56 -0
- package/lib/module/utils/SpeechToTextModule/hypothesisBuffer.js.map +1 -0
- package/lib/module/utils/llm.js +41 -1
- package/lib/module/utils/llm.js.map +1 -1
- package/lib/typescript/Error.d.ts +2 -0
- package/lib/typescript/Error.d.ts.map +1 -1
- package/lib/typescript/common/Logger.d.ts +9 -0
- package/lib/typescript/common/Logger.d.ts.map +1 -0
- package/lib/typescript/constants/llmDefaults.d.ts +1 -0
- package/lib/typescript/constants/llmDefaults.d.ts.map +1 -1
- package/lib/typescript/constants/modelUrls.d.ts +240 -79
- package/lib/typescript/constants/modelUrls.d.ts.map +1 -1
- package/lib/typescript/constants/ocr/models.d.ts +882 -284
- package/lib/typescript/constants/ocr/models.d.ts.map +1 -1
- package/lib/typescript/controllers/LLMController.d.ts +3 -4
- package/lib/typescript/controllers/LLMController.d.ts.map +1 -1
- package/lib/typescript/controllers/OCRController.d.ts +5 -6
- package/lib/typescript/controllers/OCRController.d.ts.map +1 -1
- package/lib/typescript/controllers/VerticalOCRController.d.ts +5 -6
- package/lib/typescript/controllers/VerticalOCRController.d.ts.map +1 -1
- package/lib/typescript/hooks/computer_vision/useClassification.d.ts +8 -6
- package/lib/typescript/hooks/computer_vision/useClassification.d.ts.map +1 -1
- package/lib/typescript/hooks/computer_vision/useImageEmbeddings.d.ts +16 -0
- package/lib/typescript/hooks/computer_vision/useImageEmbeddings.d.ts.map +1 -0
- package/lib/typescript/hooks/computer_vision/useImageSegmentation.d.ts +5 -3
- package/lib/typescript/hooks/computer_vision/useImageSegmentation.d.ts.map +1 -1
- package/lib/typescript/hooks/computer_vision/useOCR.d.ts +4 -4
- package/lib/typescript/hooks/computer_vision/useOCR.d.ts.map +1 -1
- package/lib/typescript/hooks/computer_vision/useObjectDetection.d.ts +5 -3
- package/lib/typescript/hooks/computer_vision/useObjectDetection.d.ts.map +1 -1
- package/lib/typescript/hooks/computer_vision/useStyleTransfer.d.ts +5 -3
- package/lib/typescript/hooks/computer_vision/useStyleTransfer.d.ts.map +1 -1
- package/lib/typescript/hooks/computer_vision/useVerticalOCR.d.ts +3 -5
- package/lib/typescript/hooks/computer_vision/useVerticalOCR.d.ts.map +1 -1
- package/lib/typescript/hooks/general/useExecutorchModule.d.ts +1 -1
- package/lib/typescript/hooks/natural_language_processing/useLLM.d.ts +6 -4
- package/lib/typescript/hooks/natural_language_processing/useLLM.d.ts.map +1 -1
- package/lib/typescript/hooks/natural_language_processing/useSpeechToText.d.ts +15 -22
- package/lib/typescript/hooks/natural_language_processing/useSpeechToText.d.ts.map +1 -1
- package/lib/typescript/hooks/natural_language_processing/useTextEmbeddings.d.ts +9 -5
- package/lib/typescript/hooks/natural_language_processing/useTextEmbeddings.d.ts.map +1 -1
- package/lib/typescript/hooks/natural_language_processing/useTokenizer.d.ts +6 -4
- package/lib/typescript/hooks/natural_language_processing/useTokenizer.d.ts.map +1 -1
- package/lib/typescript/hooks/useNonStaticModule.d.ts +21 -0
- package/lib/typescript/hooks/useNonStaticModule.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +17 -4
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/modules/BaseModule.d.ts +1 -1
- package/lib/typescript/modules/BaseModule.d.ts.map +1 -1
- package/lib/typescript/modules/BaseNonStaticModule.d.ts +10 -0
- package/lib/typescript/modules/BaseNonStaticModule.d.ts.map +1 -0
- package/lib/typescript/modules/computer_vision/ClassificationModule.d.ts +6 -6
- package/lib/typescript/modules/computer_vision/ClassificationModule.d.ts.map +1 -1
- package/lib/typescript/modules/computer_vision/ImageEmbeddingsModule.d.ts +9 -0
- package/lib/typescript/modules/computer_vision/ImageEmbeddingsModule.d.ts.map +1 -0
- package/lib/typescript/modules/computer_vision/ImageSegmentationModule.d.ts +8 -28
- package/lib/typescript/modules/computer_vision/ImageSegmentationModule.d.ts.map +1 -1
- package/lib/typescript/modules/computer_vision/OCRModule.d.ts +8 -7
- package/lib/typescript/modules/computer_vision/OCRModule.d.ts.map +1 -1
- package/lib/typescript/modules/computer_vision/ObjectDetectionModule.d.ts +7 -5
- package/lib/typescript/modules/computer_vision/ObjectDetectionModule.d.ts.map +1 -1
- package/lib/typescript/modules/computer_vision/StyleTransferModule.d.ts +6 -5
- package/lib/typescript/modules/computer_vision/StyleTransferModule.d.ts.map +1 -1
- package/lib/typescript/modules/computer_vision/VerticalOCRModule.d.ts +7 -8
- package/lib/typescript/modules/computer_vision/VerticalOCRModule.d.ts.map +1 -1
- package/lib/typescript/modules/general/ExecutorchModule.d.ts +5 -8
- package/lib/typescript/modules/general/ExecutorchModule.d.ts.map +1 -1
- package/lib/typescript/modules/natural_language_processing/LLMModule.d.ts +16 -16
- package/lib/typescript/modules/natural_language_processing/LLMModule.d.ts.map +1 -1
- package/lib/typescript/modules/natural_language_processing/SpeechToTextModule.d.ts +20 -13
- package/lib/typescript/modules/natural_language_processing/SpeechToTextModule.d.ts.map +1 -1
- package/lib/typescript/modules/natural_language_processing/TextEmbeddingsModule.d.ts +7 -5
- package/lib/typescript/modules/natural_language_processing/TextEmbeddingsModule.d.ts.map +1 -1
- package/lib/typescript/modules/natural_language_processing/TokenizerModule.d.ts +10 -9
- package/lib/typescript/modules/natural_language_processing/TokenizerModule.d.ts.map +1 -1
- package/lib/typescript/native/{NativeStyleTransfer.d.ts → NativeETInstaller.d.ts} +2 -3
- package/lib/typescript/native/NativeETInstaller.d.ts.map +1 -0
- package/lib/typescript/native/RnExecutorchModules.d.ts +3 -21
- package/lib/typescript/native/RnExecutorchModules.d.ts.map +1 -1
- package/lib/typescript/types/common.d.ts +30 -2
- package/lib/typescript/types/common.d.ts.map +1 -1
- package/lib/typescript/types/stt.d.ts +18 -88
- package/lib/typescript/types/stt.d.ts.map +1 -1
- package/lib/typescript/utils/ResourceFetcher.d.ts +18 -10
- package/lib/typescript/utils/ResourceFetcher.d.ts.map +1 -1
- package/lib/typescript/utils/ResourceFetcherUtils.d.ts +55 -0
- package/lib/typescript/utils/ResourceFetcherUtils.d.ts.map +1 -0
- package/lib/typescript/utils/SpeechToTextModule/ASR.d.ts +27 -0
- package/lib/typescript/utils/SpeechToTextModule/ASR.d.ts.map +1 -0
- package/lib/typescript/utils/SpeechToTextModule/OnlineProcessor.d.ts +23 -0
- package/lib/typescript/utils/SpeechToTextModule/OnlineProcessor.d.ts.map +1 -0
- package/lib/typescript/utils/SpeechToTextModule/hypothesisBuffer.d.ts +13 -0
- package/lib/typescript/utils/SpeechToTextModule/hypothesisBuffer.d.ts.map +1 -0
- package/lib/typescript/utils/llm.d.ts +4 -0
- package/lib/typescript/utils/llm.d.ts.map +1 -1
- package/package.json +23 -65
- package/react-native-executorch.podspec +75 -3
- package/src/Error.ts +2 -0
- package/src/common/Logger.ts +25 -0
- package/src/constants/llmDefaults.ts +11 -0
- package/src/constants/modelUrls.ts +401 -168
- package/src/constants/ocr/models.ts +826 -395
- package/src/constants/ocr/symbols.ts +63 -63
- package/src/controllers/LLMController.ts +28 -18
- package/src/controllers/OCRController.ts +24 -15
- package/src/controllers/VerticalOCRController.ts +24 -14
- package/src/hooks/computer_vision/useClassification.ts +10 -11
- package/src/hooks/computer_vision/useImageEmbeddings.ts +15 -0
- package/src/hooks/computer_vision/useImageSegmentation.ts +5 -8
- package/src/hooks/computer_vision/useOCR.ts +29 -21
- package/src/hooks/computer_vision/useObjectDetection.ts +6 -9
- package/src/hooks/computer_vision/useStyleTransfer.ts +6 -6
- package/src/hooks/computer_vision/useVerticalOCR.ts +30 -27
- package/src/hooks/general/useExecutorchModule.ts +3 -3
- package/src/hooks/natural_language_processing/useLLM.ts +38 -28
- package/src/hooks/natural_language_processing/useSpeechToText.ts +91 -88
- package/src/hooks/natural_language_processing/useTextEmbeddings.ts +11 -11
- package/src/hooks/natural_language_processing/useTokenizer.ts +22 -22
- package/src/hooks/useNonStaticModule.ts +74 -0
- package/src/index.ts +100 -0
- package/src/modules/BaseModule.ts +9 -3
- package/src/modules/BaseNonStaticModule.ts +26 -0
- package/src/modules/computer_vision/ClassificationModule.ts +20 -11
- package/src/modules/computer_vision/ImageEmbeddingsModule.ts +26 -0
- package/src/modules/computer_vision/ImageSegmentationModule.ts +35 -27
- package/src/modules/computer_vision/OCRModule.ts +23 -15
- package/src/modules/computer_vision/ObjectDetectionModule.ts +24 -11
- package/src/modules/computer_vision/StyleTransferModule.ts +20 -11
- package/src/modules/computer_vision/VerticalOCRModule.ts +25 -21
- package/src/modules/general/ExecutorchModule.ts +18 -48
- package/src/modules/natural_language_processing/LLMModule.ts +27 -30
- package/src/modules/natural_language_processing/SpeechToTextModule.ts +85 -68
- package/src/modules/natural_language_processing/TextEmbeddingsModule.ts +27 -12
- package/src/modules/natural_language_processing/TokenizerModule.ts +27 -17
- package/src/native/NativeETInstaller.ts +8 -0
- package/src/native/RnExecutorchModules.ts +4 -46
- package/src/types/common.ts +40 -12
- package/src/types/stt.ts +98 -89
- package/src/utils/ResourceFetcher.ts +338 -119
- package/src/utils/ResourceFetcherUtils.ts +186 -0
- package/src/utils/SpeechToTextModule/ASR.ts +303 -0
- package/src/utils/SpeechToTextModule/OnlineProcessor.ts +87 -0
- package/src/utils/SpeechToTextModule/hypothesisBuffer.ts +79 -0
- package/src/utils/llm.ts +65 -1
- package/third-party/android/libs/executorch/arm64-v8a/libexecutorch.so +0 -0
- package/third-party/android/libs/executorch/x86_64/libexecutorch.so +0 -0
- package/third-party/android/libs/opencv/arm64-v8a/libopencv_core.a +0 -0
- package/third-party/android/libs/opencv/arm64-v8a/libopencv_features2d.a +0 -0
- package/third-party/android/libs/opencv/arm64-v8a/libopencv_highgui.a +0 -0
- package/third-party/android/libs/opencv/arm64-v8a/libopencv_imgproc.a +0 -0
- package/third-party/android/libs/opencv/arm64-v8a/libopencv_photo.a +0 -0
- package/third-party/android/libs/opencv/arm64-v8a/libopencv_video.a +0 -0
- package/third-party/android/libs/opencv/x86_64/libopencv_core.a +0 -0
- package/third-party/android/libs/opencv/x86_64/libopencv_features2d.a +0 -0
- package/third-party/android/libs/opencv/x86_64/libopencv_highgui.a +0 -0
- package/third-party/android/libs/opencv/x86_64/libopencv_imgproc.a +0 -0
- package/third-party/android/libs/opencv/x86_64/libopencv_photo.a +0 -0
- package/third-party/android/libs/opencv/x86_64/libopencv_video.a +0 -0
- package/third-party/android/libs/opencv-third-party/arm64-v8a/libkleidicv.a +0 -0
- package/third-party/android/libs/opencv-third-party/arm64-v8a/libkleidicv_hal.a +0 -0
- package/third-party/android/libs/opencv-third-party/arm64-v8a/libkleidicv_thread.a +0 -0
- package/third-party/include/c10/macros/Export.h +163 -0
- package/third-party/include/c10/macros/Macros.h +497 -0
- package/third-party/include/c10/util/BFloat16-inl.h +342 -0
- package/third-party/include/c10/util/BFloat16-math.h +266 -0
- package/third-party/include/c10/util/BFloat16.h +125 -0
- package/third-party/include/c10/util/Half-inl.h +347 -0
- package/third-party/include/c10/util/Half.h +416 -0
- package/third-party/include/c10/util/TypeSafeSignMath.h +133 -0
- package/third-party/include/c10/util/bit_cast.h +43 -0
- package/third-party/include/c10/util/floating_point_utils.h +33 -0
- package/third-party/include/c10/util/irange.h +107 -0
- package/third-party/include/executorch/ExecuTorch.h +13 -0
- package/third-party/include/executorch/ExecuTorchError.h +16 -0
- package/third-party/include/executorch/ExecuTorchLog.h +76 -0
- package/third-party/include/executorch/ExecuTorchModule.h +286 -0
- package/third-party/include/executorch/ExecuTorchTensor.h +742 -0
- package/third-party/include/executorch/ExecuTorchValue.h +219 -0
- package/third-party/include/executorch/extension/module/module.h +492 -0
- package/third-party/include/executorch/extension/tensor/tensor.h +13 -0
- package/third-party/include/executorch/extension/tensor/tensor_accessor.h +190 -0
- package/third-party/include/executorch/extension/tensor/tensor_ptr.h +347 -0
- package/third-party/include/executorch/extension/tensor/tensor_ptr_maker.h +653 -0
- package/third-party/include/executorch/runtime/backend/backend_execution_context.h +71 -0
- package/third-party/include/executorch/runtime/backend/backend_init_context.h +72 -0
- package/third-party/include/executorch/runtime/backend/interface.h +166 -0
- package/third-party/include/executorch/runtime/core/array_ref.h +235 -0
- package/third-party/include/executorch/runtime/core/data_loader.h +136 -0
- package/third-party/include/executorch/runtime/core/defines.h +20 -0
- package/third-party/include/executorch/runtime/core/error.h +229 -0
- package/third-party/include/executorch/runtime/core/evalue.h +521 -0
- package/third-party/include/executorch/runtime/core/event_tracer.h +565 -0
- package/third-party/include/executorch/runtime/core/event_tracer_hooks.h +323 -0
- package/third-party/include/executorch/runtime/core/event_tracer_hooks_delegate.h +197 -0
- package/third-party/include/executorch/runtime/core/exec_aten/exec_aten.h +147 -0
- package/third-party/include/executorch/runtime/core/exec_aten/util/dim_order_util.h +263 -0
- package/third-party/include/executorch/runtime/core/exec_aten/util/scalar_type_util.h +1331 -0
- package/third-party/include/executorch/runtime/core/exec_aten/util/tensor_dimension_limit.h +21 -0
- package/third-party/include/executorch/runtime/core/exec_aten/util/tensor_shape_to_c_string.h +69 -0
- package/third-party/include/executorch/runtime/core/exec_aten/util/tensor_util.h +1250 -0
- package/third-party/include/executorch/runtime/core/freeable_buffer.h +107 -0
- package/third-party/include/executorch/runtime/core/hierarchical_allocator.h +107 -0
- package/third-party/include/executorch/runtime/core/memory_allocator.h +198 -0
- package/third-party/include/executorch/runtime/core/named_data_map.h +86 -0
- package/third-party/include/executorch/runtime/core/portable_type/bfloat16.h +27 -0
- package/third-party/include/executorch/runtime/core/portable_type/bfloat16_math.h +14 -0
- package/third-party/include/executorch/runtime/core/portable_type/bits_types.h +83 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/macros/Export.h +163 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/macros/Macros.h +497 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-inl.h +342 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-math.h +266 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/BFloat16.h +125 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/Half-inl.h +347 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/Half.h +416 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/TypeSafeSignMath.h +133 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/bit_cast.h +43 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/floating_point_utils.h +33 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/irange.h +107 -0
- package/third-party/include/executorch/runtime/core/portable_type/complex.h +44 -0
- package/third-party/include/executorch/runtime/core/portable_type/device.h +70 -0
- package/third-party/include/executorch/runtime/core/portable_type/half.h +27 -0
- package/third-party/include/executorch/runtime/core/portable_type/optional.h +36 -0
- package/third-party/include/executorch/runtime/core/portable_type/qint_types.h +83 -0
- package/third-party/include/executorch/runtime/core/portable_type/scalar.h +110 -0
- package/third-party/include/executorch/runtime/core/portable_type/scalar_type.h +154 -0
- package/third-party/include/executorch/runtime/core/portable_type/string_view.h +29 -0
- package/third-party/include/executorch/runtime/core/portable_type/tensor.h +142 -0
- package/third-party/include/executorch/runtime/core/portable_type/tensor_impl.h +261 -0
- package/third-party/include/executorch/runtime/core/portable_type/tensor_options.h +60 -0
- package/third-party/include/executorch/runtime/core/result.h +258 -0
- package/third-party/include/executorch/runtime/core/span.h +93 -0
- package/third-party/include/executorch/runtime/core/tag.h +71 -0
- package/third-party/include/executorch/runtime/core/tensor_layout.h +79 -0
- package/third-party/include/executorch/runtime/core/tensor_shape_dynamism.h +39 -0
- package/third-party/include/executorch/runtime/executor/memory_manager.h +113 -0
- package/third-party/include/executorch/runtime/executor/method.h +387 -0
- package/third-party/include/executorch/runtime/executor/method_meta.h +251 -0
- package/third-party/include/executorch/runtime/executor/program.h +320 -0
- package/third-party/include/executorch/runtime/executor/pte_data_map.h +144 -0
- package/third-party/include/executorch/runtime/executor/tensor_parser.h +156 -0
- package/third-party/include/executorch/runtime/kernel/kernel_runtime_context.h +122 -0
- package/third-party/include/executorch/runtime/kernel/operator_registry.h +278 -0
- package/third-party/include/executorch/runtime/platform/abort.h +36 -0
- package/third-party/include/executorch/runtime/platform/assert.h +119 -0
- package/third-party/include/executorch/runtime/platform/clock.h +43 -0
- package/third-party/include/executorch/runtime/platform/compat_unistd.h +75 -0
- package/third-party/include/executorch/runtime/platform/compiler.h +191 -0
- package/third-party/include/executorch/runtime/platform/log.h +177 -0
- package/third-party/include/executorch/runtime/platform/platform.h +133 -0
- package/third-party/include/executorch/runtime/platform/profiler.h +292 -0
- package/third-party/include/executorch/runtime/platform/runtime.h +35 -0
- package/third-party/include/executorch/runtime/platform/system.h +49 -0
- package/third-party/include/executorch/runtime/platform/types.h +24 -0
- package/third-party/include/executorch/schema/extended_header.h +76 -0
- package/third-party/include/opencv2/core/affine.hpp +676 -0
- package/third-party/include/opencv2/core/async.hpp +107 -0
- package/third-party/include/opencv2/core/base.hpp +735 -0
- package/third-party/include/opencv2/core/bindings_utils.hpp +279 -0
- package/third-party/include/opencv2/core/bufferpool.hpp +39 -0
- package/third-party/include/opencv2/core/check.hpp +231 -0
- package/third-party/include/opencv2/core/core.hpp +55 -0
- package/third-party/include/opencv2/core/core_c.h +3261 -0
- package/third-party/include/opencv2/core/cv_cpu_dispatch.h +404 -0
- package/third-party/include/opencv2/core/cv_cpu_helper.h +856 -0
- package/third-party/include/opencv2/core/cvdef.h +1003 -0
- package/third-party/include/opencv2/core/cvstd.hpp +196 -0
- package/third-party/include/opencv2/core/cvstd.inl.hpp +188 -0
- package/third-party/include/opencv2/core/cvstd_wrapper.hpp +187 -0
- package/third-party/include/opencv2/core/detail/async_promise.hpp +73 -0
- package/third-party/include/opencv2/core/detail/dispatch_helper.impl.hpp +48 -0
- package/third-party/include/opencv2/core/detail/exception_ptr.hpp +24 -0
- package/third-party/include/opencv2/core/dualquaternion.hpp +1054 -0
- package/third-party/include/opencv2/core/dualquaternion.inl.hpp +464 -0
- package/third-party/include/opencv2/core/eigen.hpp +405 -0
- package/third-party/include/opencv2/core/fast_math.hpp +433 -0
- package/third-party/include/opencv2/core/hal/hal.hpp +451 -0
- package/third-party/include/opencv2/core/hal/interface.h +191 -0
- package/third-party/include/opencv2/core/hal/intrin.hpp +1222 -0
- package/third-party/include/opencv2/core/hal/intrin_avx.hpp +3378 -0
- package/third-party/include/opencv2/core/hal/intrin_avx512.hpp +3688 -0
- package/third-party/include/opencv2/core/hal/intrin_cpp.hpp +3446 -0
- package/third-party/include/opencv2/core/hal/intrin_forward.hpp +195 -0
- package/third-party/include/opencv2/core/hal/intrin_lasx.hpp +3243 -0
- package/third-party/include/opencv2/core/hal/intrin_lsx.hpp +2671 -0
- package/third-party/include/opencv2/core/hal/intrin_math.hpp +772 -0
- package/third-party/include/opencv2/core/hal/intrin_msa.hpp +1973 -0
- package/third-party/include/opencv2/core/hal/intrin_neon.hpp +2710 -0
- package/third-party/include/opencv2/core/hal/intrin_rvv071.hpp +3452 -0
- package/third-party/include/opencv2/core/hal/intrin_rvv_scalable.hpp +2559 -0
- package/third-party/include/opencv2/core/hal/intrin_sse.hpp +3528 -0
- package/third-party/include/opencv2/core/hal/intrin_sse_em.hpp +175 -0
- package/third-party/include/opencv2/core/hal/intrin_vsx.hpp +1756 -0
- package/third-party/include/opencv2/core/hal/intrin_wasm.hpp +2911 -0
- package/third-party/include/opencv2/core/hal/msa_macros.h +2079 -0
- package/third-party/include/opencv2/core/hal/simd_utils.impl.hpp +313 -0
- package/third-party/include/opencv2/core/mat.hpp +3842 -0
- package/third-party/include/opencv2/core/mat.inl.hpp +2753 -0
- package/third-party/include/opencv2/core/matx.hpp +603 -0
- package/third-party/include/opencv2/core/matx.inl.hpp +1132 -0
- package/third-party/include/opencv2/core/neon_utils.hpp +127 -0
- package/third-party/include/opencv2/core/operations.hpp +610 -0
- package/third-party/include/opencv2/core/optim.hpp +362 -0
- package/third-party/include/opencv2/core/parallel/backend/parallel_for.openmp.hpp +66 -0
- package/third-party/include/opencv2/core/parallel/backend/parallel_for.tbb.hpp +148 -0
- package/third-party/include/opencv2/core/parallel/parallel_backend.hpp +108 -0
- package/third-party/include/opencv2/core/persistence.hpp +1321 -0
- package/third-party/include/opencv2/core/quaternion.hpp +1889 -0
- package/third-party/include/opencv2/core/quaternion.inl.hpp +907 -0
- package/third-party/include/opencv2/core/saturate.hpp +347 -0
- package/third-party/include/opencv2/core/simd_intrinsics.hpp +90 -0
- package/third-party/include/opencv2/core/softfloat.hpp +657 -0
- package/third-party/include/opencv2/core/sse_utils.hpp +861 -0
- package/third-party/include/opencv2/core/traits.hpp +417 -0
- package/third-party/include/opencv2/core/types.hpp +2368 -0
- package/third-party/include/opencv2/core/types_c.h +2064 -0
- package/third-party/include/opencv2/core/utility.hpp +1296 -0
- package/third-party/include/opencv2/core/utils/allocator_stats.hpp +31 -0
- package/third-party/include/opencv2/core/utils/allocator_stats.impl.hpp +111 -0
- package/third-party/include/opencv2/core/utils/filesystem.hpp +91 -0
- package/third-party/include/opencv2/core/utils/fp_control_utils.hpp +70 -0
- package/third-party/include/opencv2/core/utils/instrumentation.hpp +127 -0
- package/third-party/include/opencv2/core/utils/logger.defines.hpp +50 -0
- package/third-party/include/opencv2/core/utils/logger.hpp +258 -0
- package/third-party/include/opencv2/core/utils/logtag.hpp +27 -0
- package/third-party/include/opencv2/core/utils/tls.hpp +230 -0
- package/third-party/include/opencv2/core/utils/trace.hpp +281 -0
- package/third-party/include/opencv2/core/version.hpp +29 -0
- package/third-party/include/opencv2/core/vsx_utils.hpp +1115 -0
- package/third-party/include/opencv2/core.hpp +3699 -0
- package/third-party/include/opencv2/cvconfig.h +155 -0
- package/third-party/include/opencv2/dnn/dnn.hpp +51 -0
- package/third-party/include/opencv2/dnn.hpp +17 -0
- package/third-party/include/opencv2/features2d/features2d.hpp +55 -0
- package/third-party/include/opencv2/features2d/hal/interface.h +32 -0
- package/third-party/include/opencv2/features2d.hpp +1756 -0
- package/third-party/include/opencv2/highgui/highgui.hpp +113 -0
- package/third-party/include/opencv2/highgui.hpp +17 -0
- package/third-party/include/opencv2/imgproc/bindings.hpp +34 -0
- package/third-party/include/opencv2/imgproc/detail/gcgraph.hpp +355 -0
- package/third-party/include/opencv2/imgproc/detail/legacy.hpp +35 -0
- package/third-party/include/opencv2/imgproc/hal/hal.hpp +246 -0
- package/third-party/include/opencv2/imgproc/hal/interface.h +52 -0
- package/third-party/include/opencv2/imgproc/imgproc.hpp +55 -0
- package/third-party/include/opencv2/imgproc/imgproc_c.h +1261 -0
- package/third-party/include/opencv2/imgproc/segmentation.hpp +168 -0
- package/third-party/include/opencv2/imgproc/types_c.h +632 -0
- package/third-party/include/opencv2/imgproc.hpp +5956 -0
- package/third-party/include/opencv2/opencv.hpp +102 -0
- package/third-party/include/opencv2/opencv_modules.hpp +19 -0
- package/third-party/include/opencv2/photo/legacy/constants_c.h +10 -0
- package/third-party/include/opencv2/photo/photo.hpp +55 -0
- package/third-party/include/opencv2/photo.hpp +975 -0
- package/third-party/include/opencv2/video/background_segm.hpp +341 -0
- package/third-party/include/opencv2/video/detail/tracking.detail.hpp +435 -0
- package/third-party/include/opencv2/video/legacy/constants_c.h +15 -0
- package/third-party/include/opencv2/video/tracking.hpp +1014 -0
- package/third-party/include/opencv2/video/video.hpp +55 -0
- package/third-party/include/opencv2/video.hpp +65 -0
- package/third-party/include/tokenizers-cpp/tokenizers_c.h +61 -0
- package/third-party/include/tokenizers-cpp/tokenizers_cpp.h +118 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/ETModel.h +27 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/ETModel.mm +249 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/HuggingFaceTokenizer.h +14 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/HuggingFaceTokenizer.mm +80 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/LLaMARunner.h +32 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/LLaMARunner.mm +95 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/InputType.h +12 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/Utils.hpp +217 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/model/Model.cpp +11 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/model/Model.h +11 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/irunner.h +48 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/runner.cpp +278 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/runner.h +67 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/stats.h +164 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/text_decoder_runner.cpp +65 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/text_decoder_runner.h +105 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/text_prefiller.cpp +91 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/text_prefiller.h +51 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/text_token_generator.h +162 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/util.h +108 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/sampler/sampler.cpp +193 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/sampler/sampler.h +64 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/base64.h +202 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/bpe_tokenizer.cpp +313 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/bpe_tokenizer.h +57 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/llama_tiktoken.cpp +78 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/llama_tiktoken.h +23 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/tiktoken.cpp +427 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/tiktoken.h +87 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/tokenizer.h +76 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib.xcodeproj/project.pbxproj +683 -0
- package/third-party/ios/ExecutorchLib/build.sh +44 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_coreml.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_coreml.xcframework/ios-arm64/libbackend_coreml_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_coreml.xcframework/ios-arm64-simulator/libbackend_coreml_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_mps.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_mps.xcframework/ios-arm64/libbackend_mps_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_mps.xcframework/ios-arm64-simulator/libbackend_mps_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_xnnpack.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_xnnpack.xcframework/ios-arm64/libbackend_xnnpack_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_xnnpack.xcframework/ios-arm64-simulator/libbackend_xnnpack_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/Info.plist +47 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/macros/Export.h +163 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/macros/Macros.h +497 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/BFloat16-inl.h +342 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/BFloat16-math.h +266 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/BFloat16.h +125 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/Half-inl.h +347 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/Half.h +416 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/TypeSafeSignMath.h +133 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/bit_cast.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/floating_point_utils.h +33 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/irange.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorch.h +13 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchError.h +16 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchLog.h +76 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchModule.h +286 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchTensor.h +742 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchValue.h +219 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/module/module.h +492 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/tensor/tensor.h +13 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/tensor/tensor_accessor.h +190 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/tensor/tensor_ptr.h +347 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/tensor/tensor_ptr_maker.h +653 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/backend/backend_execution_context.h +71 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/backend/backend_init_context.h +72 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/backend/interface.h +166 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/array_ref.h +235 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/data_loader.h +136 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/defines.h +20 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/error.h +229 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/evalue.h +521 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/event_tracer.h +565 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/event_tracer_hooks.h +323 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/event_tracer_hooks_delegate.h +197 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/exec_aten.h +147 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/dim_order_util.h +263 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/scalar_type_util.h +1331 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/tensor_dimension_limit.h +21 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/tensor_shape_to_c_string.h +69 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/tensor_util.h +1250 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/freeable_buffer.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/hierarchical_allocator.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/memory_allocator.h +198 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/named_data_map.h +86 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/bfloat16.h +27 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/bfloat16_math.h +14 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/bits_types.h +83 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/macros/Export.h +163 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/macros/Macros.h +497 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-inl.h +342 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-math.h +266 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16.h +125 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/Half-inl.h +347 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/Half.h +416 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/TypeSafeSignMath.h +133 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/bit_cast.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/floating_point_utils.h +33 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/irange.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/complex.h +44 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/device.h +70 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/half.h +27 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/optional.h +36 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/qint_types.h +83 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/scalar.h +110 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/scalar_type.h +154 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/string_view.h +29 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/tensor.h +142 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/tensor_impl.h +261 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/tensor_options.h +60 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/result.h +258 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/span.h +93 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/tag.h +71 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/tensor_layout.h +79 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/tensor_shape_dynamism.h +39 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/memory_manager.h +113 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/method.h +387 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/method_meta.h +251 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/program.h +320 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/pte_data_map.h +144 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/tensor_parser.h +156 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/kernel/kernel_runtime_context.h +122 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/kernel/operator_registry.h +278 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/abort.h +36 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/assert.h +119 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/clock.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/compat_unistd.h +75 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/compiler.h +191 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/log.h +177 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/platform.h +133 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/profiler.h +292 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/runtime.h +35 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/system.h +49 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/types.h +24 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/schema/extended_header.h +76 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/module.modulemap +5 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/libexecutorch_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/macros/Export.h +163 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/macros/Macros.h +497 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/BFloat16-inl.h +342 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/BFloat16-math.h +266 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/BFloat16.h +125 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/Half-inl.h +347 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/Half.h +416 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/TypeSafeSignMath.h +133 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/bit_cast.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/floating_point_utils.h +33 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/irange.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorch.h +13 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchError.h +16 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchLog.h +76 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchModule.h +286 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchTensor.h +742 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchValue.h +219 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/module/module.h +492 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/tensor/tensor.h +13 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/tensor/tensor_accessor.h +190 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/tensor/tensor_ptr.h +347 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/tensor/tensor_ptr_maker.h +653 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/backend/backend_execution_context.h +71 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/backend/backend_init_context.h +72 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/backend/interface.h +166 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/array_ref.h +235 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/data_loader.h +136 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/defines.h +20 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/error.h +229 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/evalue.h +521 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/event_tracer.h +565 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/event_tracer_hooks.h +323 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/event_tracer_hooks_delegate.h +197 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/exec_aten.h +147 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/dim_order_util.h +263 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/scalar_type_util.h +1331 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/tensor_dimension_limit.h +21 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/tensor_shape_to_c_string.h +69 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/tensor_util.h +1250 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/freeable_buffer.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/hierarchical_allocator.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/memory_allocator.h +198 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/named_data_map.h +86 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/bfloat16.h +27 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/bfloat16_math.h +14 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/bits_types.h +83 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/macros/Export.h +163 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/macros/Macros.h +497 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-inl.h +342 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-math.h +266 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16.h +125 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/Half-inl.h +347 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/Half.h +416 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/TypeSafeSignMath.h +133 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/bit_cast.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/floating_point_utils.h +33 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/irange.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/complex.h +44 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/device.h +70 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/half.h +27 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/optional.h +36 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/qint_types.h +83 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/scalar.h +110 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/scalar_type.h +154 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/string_view.h +29 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/tensor.h +142 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/tensor_impl.h +261 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/tensor_options.h +60 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/result.h +258 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/span.h +93 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/tag.h +71 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/tensor_layout.h +79 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/tensor_shape_dynamism.h +39 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/memory_manager.h +113 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/method.h +387 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/method_meta.h +251 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/program.h +320 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/pte_data_map.h +144 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/tensor_parser.h +156 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/kernel/kernel_runtime_context.h +122 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/kernel/operator_registry.h +278 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/abort.h +36 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/assert.h +119 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/clock.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/compat_unistd.h +75 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/compiler.h +191 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/log.h +177 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/platform.h +133 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/profiler.h +292 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/runtime.h +35 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/system.h +49 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/types.h +24 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/schema/extended_header.h +76 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/module.modulemap +5 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/libexecutorch_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_custom.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_custom.xcframework/ios-arm64/libkernels_custom_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_custom.xcframework/ios-arm64-simulator/libkernels_custom_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_optimized.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_optimized.xcframework/ios-arm64/libkernels_optimized_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_optimized.xcframework/ios-arm64-simulator/libkernels_optimized_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_portable.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_portable.xcframework/ios-arm64/libkernels_portable_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_portable.xcframework/ios-arm64-simulator/libkernels_portable_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_quantized.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_quantized.xcframework/ios-arm64/libkernels_quantized_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_quantized.xcframework/ios-arm64-simulator/libkernels_quantized_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/bitmap256.h +82 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/filtered_re2.h +111 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/pod_array.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/prefilter.h +130 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/prefilter_tree.h +139 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/prog.h +483 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/re2.h +994 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/regexp.h +692 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/set.h +85 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/sparse_array.h +367 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/sparse_set.h +241 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/stringpiece.h +205 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/unicode_casefold.h +78 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/unicode_groups.h +64 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/walker-inl.h +235 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Info.plist +26 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/re2 +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/bitmap256.h +82 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/filtered_re2.h +111 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/pod_array.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/prefilter.h +130 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/prefilter_tree.h +139 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/prog.h +483 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/re2.h +994 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/regexp.h +692 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/set.h +85 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/sparse_array.h +367 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/sparse_set.h +241 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/stringpiece.h +205 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/unicode_casefold.h +78 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/unicode_groups.h +64 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/walker-inl.h +235 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Info.plist +26 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/re2 +0 -0
- package/third-party/ios/ios.toolchain.cmake +1122 -0
- package/LICENSE +0 -79
- package/README.md +0 -148
- package/android/src/main/java/com/swmansion/rnexecutorch/Classification.kt +0 -64
- package/android/src/main/java/com/swmansion/rnexecutorch/ETModule.kt +0 -90
- package/android/src/main/java/com/swmansion/rnexecutorch/ImageSegmentation.kt +0 -58
- package/android/src/main/java/com/swmansion/rnexecutorch/OCR.kt +0 -90
- package/android/src/main/java/com/swmansion/rnexecutorch/ObjectDetection.kt +0 -64
- package/android/src/main/java/com/swmansion/rnexecutorch/SpeechToText.kt +0 -91
- package/android/src/main/java/com/swmansion/rnexecutorch/StyleTransfer.kt +0 -54
- package/android/src/main/java/com/swmansion/rnexecutorch/TextEmbeddings.kt +0 -51
- package/android/src/main/java/com/swmansion/rnexecutorch/Tokenizer.kt +0 -86
- package/android/src/main/java/com/swmansion/rnexecutorch/VerticalOCR.kt +0 -179
- package/android/src/main/java/com/swmansion/rnexecutorch/models/BaseModel.kt +0 -54
- package/android/src/main/java/com/swmansion/rnexecutorch/models/TextEmbeddings/TextEmbeddingsModel.kt +0 -48
- package/android/src/main/java/com/swmansion/rnexecutorch/models/TextEmbeddings/TextEmbeddingsUtils.kt +0 -37
- package/android/src/main/java/com/swmansion/rnexecutorch/models/classification/ClassificationModel.kt +0 -46
- package/android/src/main/java/com/swmansion/rnexecutorch/models/classification/Constants.kt +0 -1005
- package/android/src/main/java/com/swmansion/rnexecutorch/models/imageSegmentation/Constants.kt +0 -26
- package/android/src/main/java/com/swmansion/rnexecutorch/models/imageSegmentation/ImageSegmentationModel.kt +0 -142
- package/android/src/main/java/com/swmansion/rnexecutorch/models/objectDetection/SSDLiteLargeModel.kt +0 -74
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/Detector.kt +0 -82
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/RecognitionHandler.kt +0 -117
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/Recognizer.kt +0 -51
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/VerticalDetector.kt +0 -89
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/utils/CTCLabelConverter.kt +0 -58
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/utils/Constants.kt +0 -31
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/utils/DetectorUtils.kt +0 -608
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/utils/RecognizerUtils.kt +0 -430
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/BaseS2TDecoder.kt +0 -39
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/BaseS2TModule.kt +0 -43
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/Moonshine.kt +0 -16
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/MoonshineDecoder.kt +0 -23
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/MoonshineEncoder.kt +0 -20
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/Whisper.kt +0 -16
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/WhisperDecoder.kt +0 -22
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/WhisperEncoder.kt +0 -29
- package/android/src/main/java/com/swmansion/rnexecutorch/models/styleTransfer/StyleTransferModel.kt +0 -43
- package/android/src/main/java/com/swmansion/rnexecutorch/utils/ArrayUtils.kt +0 -87
- package/android/src/main/java/com/swmansion/rnexecutorch/utils/ETError.kt +0 -34
- package/android/src/main/java/com/swmansion/rnexecutorch/utils/ImageProcessor.kt +0 -237
- package/android/src/main/java/com/swmansion/rnexecutorch/utils/Numerical.kt +0 -8
- package/android/src/main/java/com/swmansion/rnexecutorch/utils/ObjectDetectionUtils.kt +0 -201
- package/android/src/main/java/com/swmansion/rnexecutorch/utils/STFT.kt +0 -50
- package/android/src/main/java/com/swmansion/rnexecutorch/utils/TensorUtils.kt +0 -103
- package/ios/RnExecutorch/Classification.h +0 -5
- package/ios/RnExecutorch/Classification.mm +0 -54
- package/ios/RnExecutorch/ETModule.h +0 -5
- package/ios/RnExecutorch/ETModule.mm +0 -75
- package/ios/RnExecutorch/ImageSegmentation.h +0 -5
- package/ios/RnExecutorch/ImageSegmentation.mm +0 -60
- package/ios/RnExecutorch/OCR.h +0 -5
- package/ios/RnExecutorch/OCR.mm +0 -96
- package/ios/RnExecutorch/ObjectDetection.h +0 -5
- package/ios/RnExecutorch/ObjectDetection.mm +0 -56
- package/ios/RnExecutorch/SpeechToText.h +0 -5
- package/ios/RnExecutorch/SpeechToText.mm +0 -125
- package/ios/RnExecutorch/StyleTransfer.h +0 -5
- package/ios/RnExecutorch/StyleTransfer.mm +0 -55
- package/ios/RnExecutorch/TextEmbeddings.h +0 -5
- package/ios/RnExecutorch/TextEmbeddings.mm +0 -62
- package/ios/RnExecutorch/Tokenizer.h +0 -5
- package/ios/RnExecutorch/Tokenizer.mm +0 -83
- package/ios/RnExecutorch/VerticalOCR.h +0 -5
- package/ios/RnExecutorch/VerticalOCR.mm +0 -183
- package/ios/RnExecutorch/models/BaseModel.h +0 -21
- package/ios/RnExecutorch/models/BaseModel.mm +0 -43
- package/ios/RnExecutorch/models/classification/ClassificationModel.h +0 -10
- package/ios/RnExecutorch/models/classification/ClassificationModel.mm +0 -53
- package/ios/RnExecutorch/models/classification/Constants.h +0 -3
- package/ios/RnExecutorch/models/image_segmentation/Constants.h +0 -4
- package/ios/RnExecutorch/models/image_segmentation/ImageSegmentationModel.h +0 -10
- package/ios/RnExecutorch/models/image_segmentation/ImageSegmentationModel.mm +0 -146
- package/ios/RnExecutorch/models/object_detection/SSDLiteLargeModel.hpp +0 -11
- package/ios/RnExecutorch/models/object_detection/SSDLiteLargeModel.mm +0 -64
- package/ios/RnExecutorch/models/ocr/Detector.h +0 -9
- package/ios/RnExecutorch/models/ocr/Detector.mm +0 -101
- package/ios/RnExecutorch/models/ocr/RecognitionHandler.h +0 -16
- package/ios/RnExecutorch/models/ocr/RecognitionHandler.mm +0 -135
- package/ios/RnExecutorch/models/ocr/Recognizer.h +0 -8
- package/ios/RnExecutorch/models/ocr/Recognizer.mm +0 -77
- package/ios/RnExecutorch/models/ocr/VerticalDetector.h +0 -10
- package/ios/RnExecutorch/models/ocr/VerticalDetector.mm +0 -118
- package/ios/RnExecutorch/models/ocr/utils/CTCLabelConverter.h +0 -16
- package/ios/RnExecutorch/models/ocr/utils/CTCLabelConverter.mm +0 -80
- package/ios/RnExecutorch/models/ocr/utils/Constants.h +0 -26
- package/ios/RnExecutorch/models/ocr/utils/DetectorUtils.h +0 -31
- package/ios/RnExecutorch/models/ocr/utils/DetectorUtils.mm +0 -754
- package/ios/RnExecutorch/models/ocr/utils/OCRUtils.h +0 -10
- package/ios/RnExecutorch/models/ocr/utils/OCRUtils.mm +0 -67
- package/ios/RnExecutorch/models/ocr/utils/RecognizerUtils.h +0 -35
- package/ios/RnExecutorch/models/ocr/utils/RecognizerUtils.mm +0 -331
- package/ios/RnExecutorch/models/stt/Moonshine.hpp +0 -13
- package/ios/RnExecutorch/models/stt/Moonshine.mm +0 -64
- package/ios/RnExecutorch/models/stt/MoonshineDecoder.hpp +0 -16
- package/ios/RnExecutorch/models/stt/MoonshineDecoder.mm +0 -24
- package/ios/RnExecutorch/models/stt/MoonshineEncoder.hpp +0 -15
- package/ios/RnExecutorch/models/stt/MoonshineEncoder.mm +0 -18
- package/ios/RnExecutorch/models/stt/SpeechToTextBaseModel.hpp +0 -26
- package/ios/RnExecutorch/models/stt/SpeechToTextBaseModel.mm +0 -19
- package/ios/RnExecutorch/models/stt/Whisper.hpp +0 -12
- package/ios/RnExecutorch/models/stt/Whisper.mm +0 -68
- package/ios/RnExecutorch/models/stt/WhisperDecoder.hpp +0 -16
- package/ios/RnExecutorch/models/stt/WhisperDecoder.mm +0 -22
- package/ios/RnExecutorch/models/stt/WhisperEncoder.hpp +0 -15
- package/ios/RnExecutorch/models/stt/WhisperEncoder.mm +0 -21
- package/ios/RnExecutorch/models/style_transfer/StyleTransferModel.h +0 -11
- package/ios/RnExecutorch/models/style_transfer/StyleTransferModel.mm +0 -50
- package/ios/RnExecutorch/models/text_embeddings/TextEmbeddingsModel.h +0 -15
- package/ios/RnExecutorch/models/text_embeddings/TextEmbeddingsModel.mm +0 -45
- package/ios/RnExecutorch/models/text_embeddings/TextEmbeddingsUtils.h +0 -8
- package/ios/RnExecutorch/models/text_embeddings/TextEmbeddingsUtils.mm +0 -49
- package/ios/RnExecutorch/utils/Constants.h +0 -8
- package/ios/RnExecutorch/utils/ObjectDetectionUtils.hpp +0 -23
- package/ios/RnExecutorch/utils/SFFT.hpp +0 -13
- package/ios/RnExecutorch/utils/SFFT.mm +0 -71
- package/lib/module/constants/sttDefaults.js +0 -72
- package/lib/module/constants/sttDefaults.js.map +0 -1
- package/lib/module/controllers/SpeechToTextController.js +0 -307
- package/lib/module/controllers/SpeechToTextController.js.map +0 -1
- package/lib/module/native/NativeClassification.js +0 -5
- package/lib/module/native/NativeClassification.js.map +0 -1
- package/lib/module/native/NativeETModule.js +0 -5
- package/lib/module/native/NativeETModule.js.map +0 -1
- package/lib/module/native/NativeImageSegmentation.js +0 -5
- package/lib/module/native/NativeImageSegmentation.js.map +0 -1
- package/lib/module/native/NativeOCR.js +0 -5
- package/lib/module/native/NativeOCR.js.map +0 -1
- package/lib/module/native/NativeObjectDetection.js +0 -5
- package/lib/module/native/NativeObjectDetection.js.map +0 -1
- package/lib/module/native/NativeSpeechToText.js +0 -5
- package/lib/module/native/NativeSpeechToText.js.map +0 -1
- package/lib/module/native/NativeStyleTransfer.js +0 -5
- package/lib/module/native/NativeStyleTransfer.js.map +0 -1
- package/lib/module/native/NativeTextEmbeddings.js +0 -5
- package/lib/module/native/NativeTextEmbeddings.js.map +0 -1
- package/lib/module/native/NativeTokenizer.js +0 -5
- package/lib/module/native/NativeTokenizer.js.map +0 -1
- package/lib/module/native/NativeVerticalOCR.js +0 -5
- package/lib/module/native/NativeVerticalOCR.js.map +0 -1
- package/lib/module/package.json +0 -1
- package/lib/typescript/constants/sttDefaults.d.ts +0 -28
- package/lib/typescript/constants/sttDefaults.d.ts.map +0 -1
- package/lib/typescript/controllers/SpeechToTextController.d.ts +0 -52
- package/lib/typescript/controllers/SpeechToTextController.d.ts.map +0 -1
- package/lib/typescript/native/NativeClassification.d.ts +0 -10
- package/lib/typescript/native/NativeClassification.d.ts.map +0 -1
- package/lib/typescript/native/NativeETModule.d.ts +0 -9
- package/lib/typescript/native/NativeETModule.d.ts.map +0 -1
- package/lib/typescript/native/NativeImageSegmentation.d.ts +0 -10
- package/lib/typescript/native/NativeImageSegmentation.d.ts.map +0 -1
- package/lib/typescript/native/NativeOCR.d.ts +0 -9
- package/lib/typescript/native/NativeOCR.d.ts.map +0 -1
- package/lib/typescript/native/NativeObjectDetection.d.ts +0 -9
- package/lib/typescript/native/NativeObjectDetection.d.ts.map +0 -1
- package/lib/typescript/native/NativeSpeechToText.d.ts +0 -12
- package/lib/typescript/native/NativeSpeechToText.d.ts.map +0 -1
- package/lib/typescript/native/NativeStyleTransfer.d.ts.map +0 -1
- package/lib/typescript/native/NativeTextEmbeddings.d.ts +0 -8
- package/lib/typescript/native/NativeTextEmbeddings.d.ts.map +0 -1
- package/lib/typescript/native/NativeTokenizer.d.ts +0 -12
- package/lib/typescript/native/NativeTokenizer.d.ts.map +0 -1
- package/lib/typescript/native/NativeVerticalOCR.d.ts +0 -9
- package/lib/typescript/native/NativeVerticalOCR.d.ts.map +0 -1
- package/src/constants/sttDefaults.ts +0 -86
- package/src/controllers/SpeechToTextController.ts +0 -458
- package/src/index.tsx +0 -47
- package/src/native/NativeClassification.ts +0 -9
- package/src/native/NativeETModule.ts +0 -14
- package/src/native/NativeImageSegmentation.ts +0 -14
- package/src/native/NativeOCR.ts +0 -16
- package/src/native/NativeObjectDetection.ts +0 -10
- package/src/native/NativeSpeechToText.ts +0 -17
- package/src/native/NativeStyleTransfer.ts +0 -10
- package/src/native/NativeTextEmbeddings.ts +0 -9
- package/src/native/NativeTokenizer.ts +0 -13
- package/src/native/NativeVerticalOCR.ts +0 -16
|
@@ -0,0 +1,907 @@
|
|
|
1
|
+
// This file is part of OpenCV project.
|
|
2
|
+
// It is subject to the license terms in the LICENSE file found in the top-level
|
|
3
|
+
// directory of this distribution and at http://opencv.org/license.html.
|
|
4
|
+
//
|
|
5
|
+
//
|
|
6
|
+
// License Agreement
|
|
7
|
+
// For Open Source Computer Vision Library
|
|
8
|
+
//
|
|
9
|
+
// Copyright (C) 2020, Huawei Technologies Co., Ltd. All rights reserved.
|
|
10
|
+
// Third party copyrights are property of their respective owners.
|
|
11
|
+
//
|
|
12
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
// you may not use this file except in compliance with the License.
|
|
14
|
+
// You may obtain a copy of the License at
|
|
15
|
+
//
|
|
16
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
//
|
|
18
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
19
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
+
// See the License for the specific language governing permissions and
|
|
22
|
+
// limitations under the License.
|
|
23
|
+
//
|
|
24
|
+
// Author: Liangqian Kong <chargerKong@126.com>
|
|
25
|
+
// Longbu Wang <riskiest@gmail.com>
|
|
26
|
+
|
|
27
|
+
#ifndef OPENCV_CORE_QUATERNION_INL_HPP
|
|
28
|
+
#define OPENCV_CORE_QUATERNION_INL_HPP
|
|
29
|
+
|
|
30
|
+
#ifndef OPENCV_CORE_QUATERNION_HPP
|
|
31
|
+
#error This is not a standalone header. Include quaternion.hpp instead.
|
|
32
|
+
#endif
|
|
33
|
+
|
|
34
|
+
//@cond IGNORE
|
|
35
|
+
///////////////////////////////////////////////////////////////////////////////////////
|
|
36
|
+
// Implementation
|
|
37
|
+
namespace cv {
|
|
38
|
+
|
|
39
|
+
template <typename T> Quat<T>::Quat() : w(0), x(0), y(0), z(0) {}
|
|
40
|
+
|
|
41
|
+
template <typename T>
|
|
42
|
+
Quat<T>::Quat(const Vec<T, 4> &coeff)
|
|
43
|
+
: w(coeff[0]), x(coeff[1]), y(coeff[2]), z(coeff[3]) {}
|
|
44
|
+
|
|
45
|
+
template <typename T>
|
|
46
|
+
Quat<T>::Quat(const T qw, const T qx, const T qy, const T qz)
|
|
47
|
+
: w(qw), x(qx), y(qy), z(qz) {}
|
|
48
|
+
|
|
49
|
+
template <typename T>
|
|
50
|
+
Quat<T> Quat<T>::createFromAngleAxis(const T angle, const Vec<T, 3> &axis) {
|
|
51
|
+
T w, x, y, z;
|
|
52
|
+
T vNorm = std::sqrt(axis.dot(axis));
|
|
53
|
+
if (vNorm < CV_QUAT_EPS) {
|
|
54
|
+
CV_Error(Error::StsBadArg, "this quaternion does not represent a rotation");
|
|
55
|
+
}
|
|
56
|
+
const T angle_half = angle * T(0.5);
|
|
57
|
+
w = std::cos(angle_half);
|
|
58
|
+
const T sin_v = std::sin(angle_half);
|
|
59
|
+
const T sin_norm = sin_v / vNorm;
|
|
60
|
+
x = sin_norm * axis[0];
|
|
61
|
+
y = sin_norm * axis[1];
|
|
62
|
+
z = sin_norm * axis[2];
|
|
63
|
+
return Quat<T>(w, x, y, z);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
template <typename T> Quat<T> Quat<T>::createFromRotMat(InputArray _R) {
|
|
67
|
+
CV_CheckTypeEQ(_R.type(), cv::traits::Type<T>::value, "");
|
|
68
|
+
if (_R.rows() != 3 || _R.cols() != 3) {
|
|
69
|
+
CV_Error(Error::StsBadArg, "Cannot convert matrix to quaternion: rotation "
|
|
70
|
+
"matrix should be a 3x3 matrix");
|
|
71
|
+
}
|
|
72
|
+
Matx<T, 3, 3> R;
|
|
73
|
+
_R.copyTo(R);
|
|
74
|
+
|
|
75
|
+
T S, w, x, y, z;
|
|
76
|
+
T trace = R(0, 0) + R(1, 1) + R(2, 2);
|
|
77
|
+
if (trace > 0) {
|
|
78
|
+
S = std::sqrt(trace + 1) * T(2);
|
|
79
|
+
x = (R(1, 2) - R(2, 1)) / S;
|
|
80
|
+
y = (R(2, 0) - R(0, 2)) / S;
|
|
81
|
+
z = (R(0, 1) - R(1, 0)) / S;
|
|
82
|
+
w = -T(0.25) * S;
|
|
83
|
+
} else if (R(0, 0) > R(1, 1) && R(0, 0) > R(2, 2)) {
|
|
84
|
+
|
|
85
|
+
S = std::sqrt(T(1.0) + R(0, 0) - R(1, 1) - R(2, 2)) * T(2);
|
|
86
|
+
x = -T(0.25) * S;
|
|
87
|
+
y = -(R(1, 0) + R(0, 1)) / S;
|
|
88
|
+
z = -(R(0, 2) + R(2, 0)) / S;
|
|
89
|
+
w = (R(1, 2) - R(2, 1)) / S;
|
|
90
|
+
} else if (R(1, 1) > R(2, 2)) {
|
|
91
|
+
S = std::sqrt(T(1.0) - R(0, 0) + R(1, 1) - R(2, 2)) * T(2);
|
|
92
|
+
x = (R(0, 1) + R(1, 0)) / S;
|
|
93
|
+
y = T(0.25) * S;
|
|
94
|
+
z = (R(1, 2) + R(2, 1)) / S;
|
|
95
|
+
w = (R(0, 2) - R(2, 0)) / S;
|
|
96
|
+
} else {
|
|
97
|
+
S = std::sqrt(T(1.0) - R(0, 0) - R(1, 1) + R(2, 2)) * T(2);
|
|
98
|
+
x = (R(0, 2) + R(2, 0)) / S;
|
|
99
|
+
y = (R(1, 2) + R(2, 1)) / S;
|
|
100
|
+
z = T(0.25) * S;
|
|
101
|
+
w = -(R(0, 1) - R(1, 0)) / S;
|
|
102
|
+
}
|
|
103
|
+
return Quat<T>(w, x, y, z);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
template <typename T> Quat<T> Quat<T>::createFromRvec(InputArray _rvec) {
|
|
107
|
+
if (!((_rvec.cols() == 1 && _rvec.rows() == 3) ||
|
|
108
|
+
(_rvec.cols() == 3 && _rvec.rows() == 1))) {
|
|
109
|
+
CV_Error(Error::StsBadArg, "Cannot convert rotation vector to quaternion: "
|
|
110
|
+
"The length of rotation vector should be 3");
|
|
111
|
+
}
|
|
112
|
+
Vec<T, 3> rvec;
|
|
113
|
+
_rvec.copyTo(rvec);
|
|
114
|
+
T psi = std::sqrt(rvec.dot(rvec));
|
|
115
|
+
if (abs(psi) < CV_QUAT_EPS) {
|
|
116
|
+
return Quat<T>(1, 0, 0, 0);
|
|
117
|
+
}
|
|
118
|
+
Vec<T, 3> axis = rvec / psi;
|
|
119
|
+
return createFromAngleAxis(psi, axis);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
template <typename T> inline Quat<T> Quat<T>::operator-() const {
|
|
123
|
+
return Quat<T>(-w, -x, -y, -z);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
template <typename T> inline bool Quat<T>::operator==(const Quat<T> &q) const {
|
|
127
|
+
return (abs(w - q.w) < CV_QUAT_EPS && abs(x - q.x) < CV_QUAT_EPS &&
|
|
128
|
+
abs(y - q.y) < CV_QUAT_EPS && abs(z - q.z) < CV_QUAT_EPS);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
template <typename T>
|
|
132
|
+
inline Quat<T> Quat<T>::operator+(const Quat<T> &q1) const {
|
|
133
|
+
return Quat<T>(w + q1.w, x + q1.x, y + q1.y, z + q1.z);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
template <typename T> inline Quat<T> operator+(const T a, const Quat<T> &q) {
|
|
137
|
+
return Quat<T>(q.w + a, q.x, q.y, q.z);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
template <typename T> inline Quat<T> operator+(const Quat<T> &q, const T a) {
|
|
141
|
+
return Quat<T>(q.w + a, q.x, q.y, q.z);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
template <typename T> inline Quat<T> operator-(const T a, const Quat<T> &q) {
|
|
145
|
+
return Quat<T>(a - q.w, -q.x, -q.y, -q.z);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
template <typename T> inline Quat<T> operator-(const Quat<T> &q, const T a) {
|
|
149
|
+
return Quat<T>(q.w - a, q.x, q.y, q.z);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
template <typename T>
|
|
153
|
+
inline Quat<T> Quat<T>::operator-(const Quat<T> &q1) const {
|
|
154
|
+
return Quat<T>(w - q1.w, x - q1.x, y - q1.y, z - q1.z);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
template <typename T> inline Quat<T> &Quat<T>::operator+=(const Quat<T> &q1) {
|
|
158
|
+
w += q1.w;
|
|
159
|
+
x += q1.x;
|
|
160
|
+
y += q1.y;
|
|
161
|
+
z += q1.z;
|
|
162
|
+
return *this;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
template <typename T> inline Quat<T> &Quat<T>::operator-=(const Quat<T> &q1) {
|
|
166
|
+
w -= q1.w;
|
|
167
|
+
x -= q1.x;
|
|
168
|
+
y -= q1.y;
|
|
169
|
+
z -= q1.z;
|
|
170
|
+
return *this;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
template <typename T>
|
|
174
|
+
inline Quat<T> Quat<T>::operator*(const Quat<T> &q1) const {
|
|
175
|
+
Vec<T, 4> q{w, x, y, z};
|
|
176
|
+
Vec<T, 4> q2{q1.w, q1.x, q1.y, q1.z};
|
|
177
|
+
return Quat<T>(q * q2);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
template <typename T> Quat<T> operator*(const Quat<T> &q1, const T a) {
|
|
181
|
+
return Quat<T>(a * q1.w, a * q1.x, a * q1.y, a * q1.z);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
template <typename T> Quat<T> operator*(const T a, const Quat<T> &q1) {
|
|
185
|
+
return Quat<T>(a * q1.w, a * q1.x, a * q1.y, a * q1.z);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
template <typename T> inline Quat<T> &Quat<T>::operator*=(const Quat<T> &q1) {
|
|
189
|
+
T qw, qx, qy, qz;
|
|
190
|
+
qw = w * q1.w - x * q1.x - y * q1.y - z * q1.z;
|
|
191
|
+
qx = x * q1.w + w * q1.x + y * q1.z - z * q1.y;
|
|
192
|
+
qy = y * q1.w + w * q1.y + z * q1.x - x * q1.z;
|
|
193
|
+
qz = z * q1.w + w * q1.z + x * q1.y - y * q1.x;
|
|
194
|
+
w = qw;
|
|
195
|
+
x = qx;
|
|
196
|
+
y = qy;
|
|
197
|
+
z = qz;
|
|
198
|
+
return *this;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
template <typename T> inline Quat<T> &Quat<T>::operator/=(const Quat<T> &q1) {
|
|
202
|
+
Quat<T> q(*this * q1.inv());
|
|
203
|
+
w = q.w;
|
|
204
|
+
x = q.x;
|
|
205
|
+
y = q.y;
|
|
206
|
+
z = q.z;
|
|
207
|
+
return *this;
|
|
208
|
+
}
|
|
209
|
+
template <typename T> Quat<T> &Quat<T>::operator*=(const T q1) {
|
|
210
|
+
w *= q1;
|
|
211
|
+
x *= q1;
|
|
212
|
+
y *= q1;
|
|
213
|
+
z *= q1;
|
|
214
|
+
return *this;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
template <typename T> inline Quat<T> &Quat<T>::operator/=(const T a) {
|
|
218
|
+
const T a_inv = 1.0 / a;
|
|
219
|
+
w *= a_inv;
|
|
220
|
+
x *= a_inv;
|
|
221
|
+
y *= a_inv;
|
|
222
|
+
z *= a_inv;
|
|
223
|
+
return *this;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
template <typename T> inline Quat<T> Quat<T>::operator/(const T a) const {
|
|
227
|
+
const T a_inv = T(1.0) / a;
|
|
228
|
+
return Quat<T>(w * a_inv, x * a_inv, y * a_inv, z * a_inv);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
template <typename T>
|
|
232
|
+
inline Quat<T> Quat<T>::operator/(const Quat<T> &q) const {
|
|
233
|
+
return *this * q.inv();
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
template <typename T> inline const T &Quat<T>::operator[](std::size_t n) const {
|
|
237
|
+
switch (n) {
|
|
238
|
+
case 0:
|
|
239
|
+
return w;
|
|
240
|
+
case 1:
|
|
241
|
+
return x;
|
|
242
|
+
case 2:
|
|
243
|
+
return y;
|
|
244
|
+
case 3:
|
|
245
|
+
return z;
|
|
246
|
+
default:
|
|
247
|
+
CV_Error(Error::StsOutOfRange, "subscript exceeds the index range");
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
template <typename T> inline T &Quat<T>::operator[](std::size_t n) {
|
|
252
|
+
switch (n) {
|
|
253
|
+
case 0:
|
|
254
|
+
return w;
|
|
255
|
+
case 1:
|
|
256
|
+
return x;
|
|
257
|
+
case 2:
|
|
258
|
+
return y;
|
|
259
|
+
case 3:
|
|
260
|
+
return z;
|
|
261
|
+
default:
|
|
262
|
+
CV_Error(Error::StsOutOfRange, "subscript exceeds the index range");
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
template <typename T>
|
|
267
|
+
std::ostream &operator<<(std::ostream &os, const Quat<T> &q) {
|
|
268
|
+
os << "Quat " << Vec<T, 4>{q.w, q.x, q.y, q.z};
|
|
269
|
+
return os;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
template <typename T> inline T Quat<T>::at(size_t index) const {
|
|
273
|
+
return (*this)[index];
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
template <typename T> inline Quat<T> Quat<T>::conjugate() const {
|
|
277
|
+
return Quat<T>(w, -x, -y, -z);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
template <typename T> inline T Quat<T>::norm() const {
|
|
281
|
+
return std::sqrt(dot(*this));
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
template <typename T> Quat<T> exp(const Quat<T> &q) { return q.exp(); }
|
|
285
|
+
|
|
286
|
+
template <typename T> Quat<T> Quat<T>::exp() const {
|
|
287
|
+
Vec<T, 3> v{x, y, z};
|
|
288
|
+
T normV = std::sqrt(v.dot(v));
|
|
289
|
+
T k = normV < CV_QUAT_EPS ? 1 : std::sin(normV) / normV;
|
|
290
|
+
return std::exp(w) * Quat<T>(std::cos(normV), v[0] * k, v[1] * k, v[2] * k);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
template <typename T> Quat<T> log(const Quat<T> &q, QuatAssumeType assumeUnit) {
|
|
294
|
+
return q.log(assumeUnit);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
template <typename T> Quat<T> Quat<T>::log(QuatAssumeType assumeUnit) const {
|
|
298
|
+
Vec<T, 3> v{x, y, z};
|
|
299
|
+
T vNorm = std::sqrt(v.dot(v));
|
|
300
|
+
if (assumeUnit) {
|
|
301
|
+
T k = vNorm < CV_QUAT_EPS ? 1 : std::acos(w) / vNorm;
|
|
302
|
+
return Quat<T>(0, v[0] * k, v[1] * k, v[2] * k);
|
|
303
|
+
}
|
|
304
|
+
T qNorm = norm();
|
|
305
|
+
if (qNorm < CV_QUAT_EPS) {
|
|
306
|
+
CV_Error(Error::StsBadArg,
|
|
307
|
+
"Cannot apply this quaternion to log function: undefined");
|
|
308
|
+
}
|
|
309
|
+
T k = vNorm < CV_QUAT_EPS ? 1 : std::acos(w / qNorm) / vNorm;
|
|
310
|
+
return Quat<T>(std::log(qNorm), v[0] * k, v[1] * k, v[2] * k);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
template <typename T>
|
|
314
|
+
inline Quat<T> power(const Quat<T> &q1, const T alpha,
|
|
315
|
+
QuatAssumeType assumeUnit) {
|
|
316
|
+
return q1.power(alpha, assumeUnit);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
template <typename T>
|
|
320
|
+
inline Quat<T> Quat<T>::power(const T alpha, QuatAssumeType assumeUnit) const {
|
|
321
|
+
if (x * x + y * y + z * z > CV_QUAT_EPS) {
|
|
322
|
+
T angle = getAngle(assumeUnit);
|
|
323
|
+
Vec<T, 3> axis = getAxis(assumeUnit);
|
|
324
|
+
if (assumeUnit) {
|
|
325
|
+
return createFromAngleAxis(alpha * angle, axis);
|
|
326
|
+
}
|
|
327
|
+
return std::pow(norm(), alpha) * createFromAngleAxis(alpha * angle, axis);
|
|
328
|
+
} else {
|
|
329
|
+
return std::pow(norm(), alpha) * Quat<T>(w, x, y, z);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
template <typename T>
|
|
334
|
+
inline Quat<T> sqrt(const Quat<T> &q, QuatAssumeType assumeUnit) {
|
|
335
|
+
return q.sqrt(assumeUnit);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
template <typename T>
|
|
339
|
+
inline Quat<T> Quat<T>::sqrt(QuatAssumeType assumeUnit) const {
|
|
340
|
+
return power(0.5, assumeUnit);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
template <typename T>
|
|
344
|
+
inline Quat<T> power(const Quat<T> &p, const Quat<T> &q,
|
|
345
|
+
QuatAssumeType assumeUnit) {
|
|
346
|
+
return p.power(q, assumeUnit);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
template <typename T>
|
|
350
|
+
inline Quat<T> Quat<T>::power(const Quat<T> &q,
|
|
351
|
+
QuatAssumeType assumeUnit) const {
|
|
352
|
+
return cv::exp(q * log(assumeUnit));
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
template <typename T> inline T Quat<T>::dot(Quat<T> q1) const {
|
|
356
|
+
return w * q1.w + x * q1.x + y * q1.y + z * q1.z;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
template <typename T>
|
|
360
|
+
inline Quat<T> crossProduct(const Quat<T> &p, const Quat<T> &q) {
|
|
361
|
+
return p.crossProduct(q);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
template <typename T>
|
|
365
|
+
inline Quat<T> Quat<T>::crossProduct(const Quat<T> &q) const {
|
|
366
|
+
return Quat<T>(0, y * q.z - z * q.y, z * q.x - x * q.z, x * q.y - q.x * y);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
template <typename T> inline Quat<T> Quat<T>::normalize() const {
|
|
370
|
+
T normVal = norm();
|
|
371
|
+
if (normVal < CV_QUAT_EPS) {
|
|
372
|
+
CV_Error(Error::StsBadArg,
|
|
373
|
+
"Cannot normalize this quaternion: the norm is too small.");
|
|
374
|
+
}
|
|
375
|
+
return Quat<T>(w / normVal, x / normVal, y / normVal, z / normVal);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
template <typename T>
|
|
379
|
+
inline Quat<T> inv(const Quat<T> &q, QuatAssumeType assumeUnit) {
|
|
380
|
+
return q.inv(assumeUnit);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
template <typename T>
|
|
384
|
+
inline Quat<T> Quat<T>::inv(QuatAssumeType assumeUnit) const {
|
|
385
|
+
if (assumeUnit) {
|
|
386
|
+
return conjugate();
|
|
387
|
+
}
|
|
388
|
+
T norm2 = dot(*this);
|
|
389
|
+
if (norm2 < CV_QUAT_EPS) {
|
|
390
|
+
CV_Error(Error::StsBadArg,
|
|
391
|
+
"This quaternion do not have inverse quaternion");
|
|
392
|
+
}
|
|
393
|
+
return conjugate() / norm2;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
template <typename T> inline Quat<T> sinh(const Quat<T> &q) { return q.sinh(); }
|
|
397
|
+
|
|
398
|
+
template <typename T> inline Quat<T> Quat<T>::sinh() const {
|
|
399
|
+
Vec<T, 3> v{x, y, z};
|
|
400
|
+
T vNorm = std::sqrt(v.dot(v));
|
|
401
|
+
T k = vNorm < CV_QUAT_EPS ? 1 : std::cosh(w) * std::sin(vNorm) / vNorm;
|
|
402
|
+
return Quat<T>(std::sinh(w) * std::cos(vNorm), v[0] * k, v[1] * k, v[2] * k);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
template <typename T> inline Quat<T> cosh(const Quat<T> &q) { return q.cosh(); }
|
|
406
|
+
|
|
407
|
+
template <typename T> inline Quat<T> Quat<T>::cosh() const {
|
|
408
|
+
Vec<T, 3> v{x, y, z};
|
|
409
|
+
T vNorm = std::sqrt(v.dot(v));
|
|
410
|
+
T k = vNorm < CV_QUAT_EPS ? 1 : std::sinh(w) * std::sin(vNorm) / vNorm;
|
|
411
|
+
return Quat<T>(std::cosh(w) * std::cos(vNorm), v[0] * k, v[1] * k, v[2] * k);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
template <typename T> inline Quat<T> tanh(const Quat<T> &q) { return q.tanh(); }
|
|
415
|
+
|
|
416
|
+
template <typename T> inline Quat<T> Quat<T>::tanh() const {
|
|
417
|
+
return sinh() * cosh().inv();
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
template <typename T> inline Quat<T> sin(const Quat<T> &q) { return q.sin(); }
|
|
421
|
+
|
|
422
|
+
template <typename T> inline Quat<T> Quat<T>::sin() const {
|
|
423
|
+
Vec<T, 3> v{x, y, z};
|
|
424
|
+
T vNorm = std::sqrt(v.dot(v));
|
|
425
|
+
T k = vNorm < CV_QUAT_EPS ? 1 : std::cos(w) * std::sinh(vNorm) / vNorm;
|
|
426
|
+
return Quat<T>(std::sin(w) * std::cosh(vNorm), v[0] * k, v[1] * k, v[2] * k);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
template <typename T> inline Quat<T> cos(const Quat<T> &q) { return q.cos(); }
|
|
430
|
+
|
|
431
|
+
template <typename T> inline Quat<T> Quat<T>::cos() const {
|
|
432
|
+
Vec<T, 3> v{x, y, z};
|
|
433
|
+
T vNorm = std::sqrt(v.dot(v));
|
|
434
|
+
T k = vNorm < CV_QUAT_EPS ? 1 : std::sin(w) * std::sinh(vNorm) / vNorm;
|
|
435
|
+
return Quat<T>(std::cos(w) * std::cosh(vNorm), -v[0] * k, -v[1] * k,
|
|
436
|
+
-v[2] * k);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
template <typename T> inline Quat<T> tan(const Quat<T> &q) { return q.tan(); }
|
|
440
|
+
|
|
441
|
+
template <typename T> inline Quat<T> Quat<T>::tan() const {
|
|
442
|
+
return sin() * cos().inv();
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
template <typename T> inline Quat<T> asinh(const Quat<T> &q) {
|
|
446
|
+
return q.asinh();
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
template <typename T> inline Quat<T> Quat<T>::asinh() const {
|
|
450
|
+
return cv::log(*this + cv::power(*this * *this + Quat<T>(1, 0, 0, 0), 0.5));
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
template <typename T> inline Quat<T> acosh(const Quat<T> &q) {
|
|
454
|
+
return q.acosh();
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
template <typename T> inline Quat<T> Quat<T>::acosh() const {
|
|
458
|
+
return cv::log(*this + cv::power(*this * *this - Quat<T>(1, 0, 0, 0), 0.5));
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
template <typename T> inline Quat<T> atanh(const Quat<T> &q) {
|
|
462
|
+
return q.atanh();
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
template <typename T> inline Quat<T> Quat<T>::atanh() const {
|
|
466
|
+
Quat<T> ident(1, 0, 0, 0);
|
|
467
|
+
Quat<T> c1 = (ident + *this).log();
|
|
468
|
+
Quat<T> c2 = (ident - *this).log();
|
|
469
|
+
return 0.5 * (c1 - c2);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
template <typename T> inline Quat<T> asin(const Quat<T> &q) { return q.asin(); }
|
|
473
|
+
|
|
474
|
+
template <typename T> inline Quat<T> Quat<T>::asin() const {
|
|
475
|
+
Quat<T> v(0, x, y, z);
|
|
476
|
+
T vNorm = v.norm();
|
|
477
|
+
T k = vNorm < CV_QUAT_EPS ? 1 : vNorm;
|
|
478
|
+
return -v / k * (*this * v / k).asinh();
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
template <typename T> inline Quat<T> acos(const Quat<T> &q) { return q.acos(); }
|
|
482
|
+
|
|
483
|
+
template <typename T> inline Quat<T> Quat<T>::acos() const {
|
|
484
|
+
Quat<T> v(0, x, y, z);
|
|
485
|
+
T vNorm = v.norm();
|
|
486
|
+
T k = vNorm < CV_QUAT_EPS ? 1 : vNorm;
|
|
487
|
+
return -v / k * acosh();
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
template <typename T> inline Quat<T> atan(const Quat<T> &q) { return q.atan(); }
|
|
491
|
+
|
|
492
|
+
template <typename T> inline Quat<T> Quat<T>::atan() const {
|
|
493
|
+
Quat<T> v(0, x, y, z);
|
|
494
|
+
T vNorm = v.norm();
|
|
495
|
+
T k = vNorm < CV_QUAT_EPS ? 1 : vNorm;
|
|
496
|
+
return -v / k * (*this * v / k).atanh();
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
template <typename T>
|
|
500
|
+
inline T Quat<T>::getAngle(QuatAssumeType assumeUnit) const {
|
|
501
|
+
if (assumeUnit) {
|
|
502
|
+
return 2 * std::acos(w);
|
|
503
|
+
}
|
|
504
|
+
if (norm() < CV_QUAT_EPS) {
|
|
505
|
+
CV_Error(Error::StsBadArg, "This quaternion does not represent a rotation");
|
|
506
|
+
}
|
|
507
|
+
return 2 * std::acos(w / norm());
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
template <typename T>
|
|
511
|
+
inline Vec<T, 3> Quat<T>::getAxis(QuatAssumeType assumeUnit) const {
|
|
512
|
+
T angle = getAngle(assumeUnit);
|
|
513
|
+
const T sin_v = std::sin(angle * 0.5);
|
|
514
|
+
if (assumeUnit) {
|
|
515
|
+
return Vec<T, 3>{x, y, z} / sin_v;
|
|
516
|
+
}
|
|
517
|
+
return Vec<T, 3>{x, y, z} / (norm() * sin_v);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
template <typename T>
|
|
521
|
+
Matx<T, 4, 4> Quat<T>::toRotMat4x4(QuatAssumeType assumeUnit) const {
|
|
522
|
+
T a = w, b = x, c = y, d = z;
|
|
523
|
+
if (!assumeUnit) {
|
|
524
|
+
Quat<T> qTemp = normalize();
|
|
525
|
+
a = qTemp.w;
|
|
526
|
+
b = qTemp.x;
|
|
527
|
+
c = qTemp.y;
|
|
528
|
+
d = qTemp.z;
|
|
529
|
+
}
|
|
530
|
+
Matx<T, 4, 4> R{
|
|
531
|
+
1 - 2 * (c * c + d * d),
|
|
532
|
+
2 * (b * c - a * d),
|
|
533
|
+
2 * (b * d + a * c),
|
|
534
|
+
0,
|
|
535
|
+
2 * (b * c + a * d),
|
|
536
|
+
1 - 2 * (b * b + d * d),
|
|
537
|
+
2 * (c * d - a * b),
|
|
538
|
+
0,
|
|
539
|
+
2 * (b * d - a * c),
|
|
540
|
+
2 * (c * d + a * b),
|
|
541
|
+
1 - 2 * (b * b + c * c),
|
|
542
|
+
0,
|
|
543
|
+
0,
|
|
544
|
+
0,
|
|
545
|
+
0,
|
|
546
|
+
1,
|
|
547
|
+
};
|
|
548
|
+
return R;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
template <typename T>
|
|
552
|
+
Matx<T, 3, 3> Quat<T>::toRotMat3x3(QuatAssumeType assumeUnit) const {
|
|
553
|
+
T a = w, b = x, c = y, d = z;
|
|
554
|
+
if (!assumeUnit) {
|
|
555
|
+
Quat<T> qTemp = normalize();
|
|
556
|
+
a = qTemp.w;
|
|
557
|
+
b = qTemp.x;
|
|
558
|
+
c = qTemp.y;
|
|
559
|
+
d = qTemp.z;
|
|
560
|
+
}
|
|
561
|
+
Matx<T, 3, 3> R{1 - 2 * (c * c + d * d), 2 * (b * c - a * d),
|
|
562
|
+
2 * (b * d + a * c), 2 * (b * c + a * d),
|
|
563
|
+
1 - 2 * (b * b + d * d), 2 * (c * d - a * b),
|
|
564
|
+
2 * (b * d - a * c), 2 * (c * d + a * b),
|
|
565
|
+
1 - 2 * (b * b + c * c)};
|
|
566
|
+
return R;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
template <typename T>
|
|
570
|
+
Vec<T, 3> Quat<T>::toRotVec(QuatAssumeType assumeUnit) const {
|
|
571
|
+
T angle = getAngle(assumeUnit);
|
|
572
|
+
Vec<T, 3> axis = getAxis(assumeUnit);
|
|
573
|
+
return angle * axis;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
template <typename T> Vec<T, 4> Quat<T>::toVec() const {
|
|
577
|
+
return Vec<T, 4>{w, x, y, z};
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
template <typename T>
|
|
581
|
+
Quat<T> Quat<T>::lerp(const Quat<T> &q0, const Quat<T> &q1, const T t) {
|
|
582
|
+
return (1 - t) * q0 + t * q1;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
template <typename T>
|
|
586
|
+
Quat<T> Quat<T>::slerp(const Quat<T> &q0, const Quat<T> &q1, const T t,
|
|
587
|
+
QuatAssumeType assumeUnit, bool directChange) {
|
|
588
|
+
Quat<T> v0(q0);
|
|
589
|
+
Quat<T> v1(q1);
|
|
590
|
+
if (!assumeUnit) {
|
|
591
|
+
v0 = v0.normalize();
|
|
592
|
+
v1 = v1.normalize();
|
|
593
|
+
}
|
|
594
|
+
T cosTheta = v0.dot(v1);
|
|
595
|
+
constexpr T DOT_THRESHOLD = 0.995;
|
|
596
|
+
if (std::abs(cosTheta) > DOT_THRESHOLD) {
|
|
597
|
+
return nlerp(v0, v1, t, QUAT_ASSUME_UNIT);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
if (directChange && cosTheta < 0) {
|
|
601
|
+
v0 = -v0;
|
|
602
|
+
cosTheta = -cosTheta;
|
|
603
|
+
}
|
|
604
|
+
T sinTheta = std::sqrt(1 - cosTheta * cosTheta);
|
|
605
|
+
T angle = atan2(sinTheta, cosTheta);
|
|
606
|
+
return (std::sin((1 - t) * angle) / (sinTheta)*v0 +
|
|
607
|
+
std::sin(t * angle) / (sinTheta)*v1)
|
|
608
|
+
.normalize();
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
template <typename T>
|
|
612
|
+
inline Quat<T> Quat<T>::nlerp(const Quat<T> &q0, const Quat<T> &q1, const T t,
|
|
613
|
+
QuatAssumeType assumeUnit) {
|
|
614
|
+
Quat<T> v0(q0), v1(q1);
|
|
615
|
+
if (v1.dot(v0) < 0) {
|
|
616
|
+
v0 = -v0;
|
|
617
|
+
}
|
|
618
|
+
if (assumeUnit) {
|
|
619
|
+
return ((1 - t) * v0 + t * v1).normalize();
|
|
620
|
+
}
|
|
621
|
+
v0 = v0.normalize();
|
|
622
|
+
v1 = v1.normalize();
|
|
623
|
+
return ((1 - t) * v0 + t * v1).normalize();
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
template <typename T> inline bool Quat<T>::isNormal(T eps) const {
|
|
627
|
+
|
|
628
|
+
double normVar = norm();
|
|
629
|
+
if ((normVar > 1 - eps) && (normVar < 1 + eps))
|
|
630
|
+
return true;
|
|
631
|
+
return false;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
template <typename T> inline void Quat<T>::assertNormal(T eps) const {
|
|
635
|
+
if (!isNormal(eps))
|
|
636
|
+
CV_Error(Error::StsBadArg, "Quaternion should be normalized");
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
template <typename T>
|
|
640
|
+
inline Quat<T> Quat<T>::squad(const Quat<T> &q0, const Quat<T> &q1,
|
|
641
|
+
const Quat<T> &q2, const Quat<T> &q3, const T t,
|
|
642
|
+
QuatAssumeType assumeUnit, bool directChange) {
|
|
643
|
+
Quat<T> v0(q0), v1(q1), v2(q2), v3(q3);
|
|
644
|
+
if (!assumeUnit) {
|
|
645
|
+
v0 = v0.normalize();
|
|
646
|
+
v1 = v1.normalize();
|
|
647
|
+
v2 = v2.normalize();
|
|
648
|
+
v3 = v3.normalize();
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
Quat<T> c0 = slerp(v0, v3, t, assumeUnit, directChange);
|
|
652
|
+
Quat<T> c1 = slerp(v1, v2, t, assumeUnit, directChange);
|
|
653
|
+
return slerp(c0, c1, 2 * t * (1 - t), assumeUnit, directChange);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
template <typename T>
|
|
657
|
+
Quat<T> Quat<T>::interPoint(const Quat<T> &q0, const Quat<T> &q1,
|
|
658
|
+
const Quat<T> &q2, QuatAssumeType assumeUnit) {
|
|
659
|
+
Quat<T> v0(q0), v1(q1), v2(q2);
|
|
660
|
+
if (!assumeUnit) {
|
|
661
|
+
v0 = v0.normalize();
|
|
662
|
+
v1 = v1.normalize();
|
|
663
|
+
v2 = v2.normalize();
|
|
664
|
+
}
|
|
665
|
+
return v1 * cv::exp(-(cv::log(v1.conjugate() * v0, assumeUnit) +
|
|
666
|
+
(cv::log(v1.conjugate() * v2, assumeUnit))) /
|
|
667
|
+
4);
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
template <typename T>
|
|
671
|
+
Quat<T> Quat<T>::spline(const Quat<T> &q0, const Quat<T> &q1, const Quat<T> &q2,
|
|
672
|
+
const Quat<T> &q3, const T t,
|
|
673
|
+
QuatAssumeType assumeUnit) {
|
|
674
|
+
Quat<T> v0(q0), v1(q1), v2(q2), v3(q3);
|
|
675
|
+
if (!assumeUnit) {
|
|
676
|
+
v0 = v0.normalize();
|
|
677
|
+
v1 = v1.normalize();
|
|
678
|
+
v2 = v2.normalize();
|
|
679
|
+
v3 = v3.normalize();
|
|
680
|
+
}
|
|
681
|
+
T cosTheta;
|
|
682
|
+
std::vector<Quat<T>> vec{v0, v1, v2, v3};
|
|
683
|
+
for (size_t i = 0; i < 3; ++i) {
|
|
684
|
+
cosTheta = vec[i].dot(vec[i + 1]);
|
|
685
|
+
if (cosTheta < 0) {
|
|
686
|
+
vec[i + 1] = -vec[i + 1];
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
Quat<T> s1 = interPoint(vec[0], vec[1], vec[2], QUAT_ASSUME_UNIT);
|
|
690
|
+
Quat<T> s2 = interPoint(vec[1], vec[2], vec[3], QUAT_ASSUME_UNIT);
|
|
691
|
+
return squad(vec[1], s1, s2, vec[2], t, assumeUnit, QUAT_ASSUME_NOT_UNIT);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
namespace detail {
|
|
695
|
+
|
|
696
|
+
template <typename T>
|
|
697
|
+
static Quat<T> createFromAxisRot(int axis, const T theta) {
|
|
698
|
+
if (axis == 0)
|
|
699
|
+
return Quat<T>::createFromXRot(theta);
|
|
700
|
+
if (axis == 1)
|
|
701
|
+
return Quat<T>::createFromYRot(theta);
|
|
702
|
+
if (axis == 2)
|
|
703
|
+
return Quat<T>::createFromZRot(theta);
|
|
704
|
+
CV_Assert(0);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
inline bool isIntAngleType(QuatEnum::EulerAnglesType eulerAnglesType) {
|
|
708
|
+
return eulerAnglesType < QuatEnum::EXT_XYZ;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
inline bool isTaitBryan(QuatEnum::EulerAnglesType eulerAnglesType) {
|
|
712
|
+
return eulerAnglesType / 6 == 1 || eulerAnglesType / 6 == 3;
|
|
713
|
+
}
|
|
714
|
+
} // namespace detail
|
|
715
|
+
|
|
716
|
+
template <typename T> Quat<T> Quat<T>::createFromYRot(const T theta) {
|
|
717
|
+
return Quat<T>{std::cos(theta * 0.5f), 0, std::sin(theta * 0.5f), 0};
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
template <typename T> Quat<T> Quat<T>::createFromXRot(const T theta) {
|
|
721
|
+
return Quat<T>{std::cos(theta * 0.5f), std::sin(theta * 0.5f), 0, 0};
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
template <typename T> Quat<T> Quat<T>::createFromZRot(const T theta) {
|
|
725
|
+
return Quat<T>{std::cos(theta * 0.5f), 0, 0, std::sin(theta * 0.5f)};
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
template <typename T>
|
|
729
|
+
Quat<T>
|
|
730
|
+
Quat<T>::createFromEulerAngles(const Vec<T, 3> &angles,
|
|
731
|
+
QuatEnum::EulerAnglesType eulerAnglesType) {
|
|
732
|
+
CV_Assert(eulerAnglesType <
|
|
733
|
+
QuatEnum::EulerAnglesType::EULER_ANGLES_MAX_VALUE);
|
|
734
|
+
static const int rotationAxis[24][3] = {
|
|
735
|
+
{0, 1, 2}, ///< Intrinsic rotations with the Euler angles type X-Y-Z
|
|
736
|
+
{0, 2, 1}, ///< Intrinsic rotations with the Euler angles type X-Z-Y
|
|
737
|
+
{1, 0, 2}, ///< Intrinsic rotations with the Euler angles type Y-X-Z
|
|
738
|
+
{1, 2, 0}, ///< Intrinsic rotations with the Euler angles type Y-Z-X
|
|
739
|
+
{2, 0, 1}, ///< Intrinsic rotations with the Euler angles type Z-X-Y
|
|
740
|
+
{2, 1, 0}, ///< Intrinsic rotations with the Euler angles type Z-Y-X
|
|
741
|
+
{0, 1, 0}, ///< Intrinsic rotations with the Euler angles type X-Y-X
|
|
742
|
+
{0, 2, 0}, ///< Intrinsic rotations with the Euler angles type X-Z-X
|
|
743
|
+
{1, 0, 1}, ///< Intrinsic rotations with the Euler angles type Y-X-Y
|
|
744
|
+
{1, 2, 1}, ///< Intrinsic rotations with the Euler angles type Y-Z-Y
|
|
745
|
+
{2, 0, 2}, ///< Intrinsic rotations with the Euler angles type Z-X-Z
|
|
746
|
+
{2, 1, 2}, ///< Intrinsic rotations with the Euler angles type Z-Y-Z
|
|
747
|
+
{0, 1, 2}, ///< Extrinsic rotations with the Euler angles type X-Y-Z
|
|
748
|
+
{0, 2, 1}, ///< Extrinsic rotations with the Euler angles type X-Z-Y
|
|
749
|
+
{1, 0, 2}, ///< Extrinsic rotations with the Euler angles type Y-X-Z
|
|
750
|
+
{1, 2, 0}, ///< Extrinsic rotations with the Euler angles type Y-Z-X
|
|
751
|
+
{2, 0, 1}, ///< Extrinsic rotations with the Euler angles type Z-X-Y
|
|
752
|
+
{2, 1, 0}, ///< Extrinsic rotations with the Euler angles type Z-Y-X
|
|
753
|
+
{0, 1, 0}, ///< Extrinsic rotations with the Euler angles type X-Y-X
|
|
754
|
+
{0, 2, 0}, ///< Extrinsic rotations with the Euler angles type X-Z-X
|
|
755
|
+
{1, 0, 1}, ///< Extrinsic rotations with the Euler angles type Y-X-Y
|
|
756
|
+
{1, 2, 1}, ///< Extrinsic rotations with the Euler angles type Y-Z-Y
|
|
757
|
+
{2, 0, 2}, ///< Extrinsic rotations with the Euler angles type Z-X-Z
|
|
758
|
+
{2, 1, 2} ///< Extrinsic rotations with the Euler angles type Z-Y-Z
|
|
759
|
+
};
|
|
760
|
+
Quat<T> q1 =
|
|
761
|
+
detail::createFromAxisRot(rotationAxis[eulerAnglesType][0], angles(0));
|
|
762
|
+
Quat<T> q2 =
|
|
763
|
+
detail::createFromAxisRot(rotationAxis[eulerAnglesType][1], angles(1));
|
|
764
|
+
Quat<T> q3 =
|
|
765
|
+
detail::createFromAxisRot(rotationAxis[eulerAnglesType][2], angles(2));
|
|
766
|
+
if (detail::isIntAngleType(eulerAnglesType)) {
|
|
767
|
+
return q1 * q2 * q3;
|
|
768
|
+
} else // (!detail::isIntAngleType<T>(eulerAnglesType))
|
|
769
|
+
{
|
|
770
|
+
return q3 * q2 * q1;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
template <typename T>
|
|
775
|
+
Vec<T, 3> Quat<T>::toEulerAngles(QuatEnum::EulerAnglesType eulerAnglesType) {
|
|
776
|
+
CV_Assert(eulerAnglesType <
|
|
777
|
+
QuatEnum::EulerAnglesType::EULER_ANGLES_MAX_VALUE);
|
|
778
|
+
Matx33d R = toRotMat3x3();
|
|
779
|
+
enum {
|
|
780
|
+
C_ZERO,
|
|
781
|
+
C_PI,
|
|
782
|
+
C_PI_2,
|
|
783
|
+
N_CONSTANTS,
|
|
784
|
+
R_0_0 = N_CONSTANTS,
|
|
785
|
+
R_0_1,
|
|
786
|
+
R_0_2,
|
|
787
|
+
R_1_0,
|
|
788
|
+
R_1_1,
|
|
789
|
+
R_1_2,
|
|
790
|
+
R_2_0,
|
|
791
|
+
R_2_1,
|
|
792
|
+
R_2_2
|
|
793
|
+
};
|
|
794
|
+
static const T constants_[N_CONSTANTS] = {
|
|
795
|
+
0, // C_ZERO
|
|
796
|
+
(T)CV_PI, // C_PI
|
|
797
|
+
(T)(CV_PI * 0.5) // C_PI_2, -C_PI_2
|
|
798
|
+
};
|
|
799
|
+
static const int rotationR_[24][12] = {
|
|
800
|
+
{+R_0_2, +R_1_0, +R_1_1, C_PI_2, +R_2_1, +R_1_1, -C_PI_2, -R_1_2, +R_2_2,
|
|
801
|
+
+R_0_2, -R_0_1, +R_0_0}, // INT_XYZ
|
|
802
|
+
{+R_0_1, -R_1_2, +R_2_2, -C_PI_2, +R_2_0, +R_2_2, C_PI_2, +R_2_1, +R_1_1,
|
|
803
|
+
-R_0_1, +R_0_2, +R_0_0}, // INT_XZY
|
|
804
|
+
{+R_1_2, -R_0_1, +R_0_0, -C_PI_2, +R_0_1, +R_0_0, C_PI_2, +R_0_2, +R_2_2,
|
|
805
|
+
-R_1_2, +R_1_0, +R_1_1}, // INT_YXZ
|
|
806
|
+
{+R_1_0, +R_0_2, +R_2_2, C_PI_2, +R_0_2, +R_0_1, -C_PI_2, -R_2_0, +R_0_0,
|
|
807
|
+
+R_1_0, -R_1_2, +R_1_1}, // INT_YZX
|
|
808
|
+
{+R_2_1, +R_1_0, +R_0_0, C_PI_2, +R_1_0, +R_0_0, -C_PI_2, -R_0_1, +R_1_1,
|
|
809
|
+
+R_2_1, -R_2_0, +R_2_2}, // INT_ZXY
|
|
810
|
+
{+R_2_0, -R_0_1, +R_1_1, -C_PI_2, +R_1_2, +R_1_1, C_PI_2, +R_1_0, +R_0_0,
|
|
811
|
+
-R_2_0, +R_2_1, +R_2_2}, // INT_ZYX
|
|
812
|
+
{+R_0_0, +R_2_1, +R_2_2, C_ZERO, +R_1_2, +R_1_1, C_PI, +R_1_0, -R_2_0,
|
|
813
|
+
+R_0_0, +R_0_1, +R_0_2}, // INT_XYX
|
|
814
|
+
{+R_0_0, +R_2_1, +R_2_2, C_ZERO, -R_2_1, +R_2_2, C_PI, +R_2_0, +R_1_0,
|
|
815
|
+
+R_0_0, +R_0_2, -R_0_1}, // INT_XZX
|
|
816
|
+
{+R_1_1, +R_0_2, +R_0_0, C_ZERO, -R_2_0, +R_0_0, C_PI, +R_0_1, +R_2_1,
|
|
817
|
+
+R_1_1, +R_1_0, -R_1_2}, // INT_YXY
|
|
818
|
+
{+R_1_1, +R_0_2, +R_0_0, C_ZERO, +R_0_2, -R_0_0, C_PI, +R_2_1, -R_0_1,
|
|
819
|
+
+R_1_1, +R_1_2, +R_1_0}, // INT_YZY
|
|
820
|
+
{+R_2_2, +R_1_0, +R_1_1, C_ZERO, +R_1_0, +R_0_0, C_PI, +R_0_2, -R_1_2,
|
|
821
|
+
+R_2_2, +R_2_0, +R_2_1}, // INT_ZXZ
|
|
822
|
+
{+R_2_2, +R_1_0, +R_0_0, C_ZERO, +R_1_0, +R_0_0, C_PI, +R_1_2, +R_0_2,
|
|
823
|
+
+R_2_2, +R_2_1, -R_2_0}, // INT_ZYZ
|
|
824
|
+
|
|
825
|
+
{+R_2_0, -C_PI_2, -R_0_1, +R_1_1, C_PI_2, +R_1_2, +R_1_1, +R_2_1, +R_2_2,
|
|
826
|
+
-R_2_0, +R_1_0, +R_0_0}, // EXT_XYZ
|
|
827
|
+
{+R_1_0, C_PI_2, +R_0_2, +R_2_2, -C_PI_2, +R_0_2, +R_0_1, -R_1_2, +R_1_1,
|
|
828
|
+
+R_1_0, -R_2_0, +R_0_0}, // EXT_XZY
|
|
829
|
+
{+R_2_1, C_PI_2, +R_1_0, +R_0_0, -C_PI_2, +R_1_0, +R_0_0, -R_2_0, +R_2_2,
|
|
830
|
+
+R_2_1, -R_0_1, +R_1_1}, // EXT_YXZ
|
|
831
|
+
{+R_0_2, -C_PI_2, -R_1_2, +R_2_2, C_PI_2, +R_2_0, +R_2_2, +R_0_2, +R_0_0,
|
|
832
|
+
-R_0_1, +R_2_1, +R_1_1}, // EXT_YZX
|
|
833
|
+
{+R_1_2, -C_PI_2, -R_0_1, +R_0_0, C_PI_2, +R_0_1, +R_0_0, +R_1_0, +R_1_1,
|
|
834
|
+
-R_1_2, +R_0_2, +R_2_2}, // EXT_ZXY
|
|
835
|
+
{+R_0_2, C_PI_2, +R_1_0, +R_1_1, -C_PI_2, +R_2_1, +R_1_1, -R_0_1, +R_0_0,
|
|
836
|
+
+R_0_2, -R_1_2, +R_2_2}, // EXT_ZYX
|
|
837
|
+
{+R_0_0, C_ZERO, +R_2_1, +R_2_2, C_PI, +R_1_2, +R_1_1, +R_0_1, +R_0_2,
|
|
838
|
+
+R_0_0, +R_1_0, -R_2_0}, // EXT_XYX
|
|
839
|
+
{+R_0_0, C_ZERO, +R_2_1, +R_2_2, C_PI, +R_2_1, +R_2_2, +R_0_2, -R_0_1,
|
|
840
|
+
+R_0_0, +R_2_0, +R_1_0}, // EXT_XZX
|
|
841
|
+
{+R_1_1, C_ZERO, +R_0_2, +R_0_0, C_PI, -R_2_0, +R_0_0, +R_1_0, -R_1_2,
|
|
842
|
+
+R_1_1, +R_0_1, +R_2_1}, // EXT_YXY
|
|
843
|
+
{+R_1_1, C_ZERO, +R_0_2, +R_0_0, C_PI, +R_0_2, -R_0_0, +R_1_2, +R_1_0,
|
|
844
|
+
+R_1_1, +R_2_1, -R_0_1}, // EXT_YZY
|
|
845
|
+
{+R_2_2, C_ZERO, +R_1_0, +R_1_1, C_PI, +R_1_0, +R_0_0, +R_2_0, +R_2_1,
|
|
846
|
+
+R_2_2, +R_0_2, -R_1_2}, // EXT_ZXZ
|
|
847
|
+
{+R_2_2, C_ZERO, +R_1_0, +R_0_0, C_PI, +R_1_0, +R_0_0, +R_2_1, -R_2_0,
|
|
848
|
+
+R_2_2, +R_1_2, +R_0_2}, // EXT_ZYZ
|
|
849
|
+
};
|
|
850
|
+
T rotationR[12];
|
|
851
|
+
for (int i = 0; i < 12; i++) {
|
|
852
|
+
int id = rotationR_[eulerAnglesType][i];
|
|
853
|
+
unsigned idx = std::abs(id);
|
|
854
|
+
T value = 0.0f;
|
|
855
|
+
if (idx < N_CONSTANTS) {
|
|
856
|
+
value = constants_[idx];
|
|
857
|
+
} else {
|
|
858
|
+
unsigned r_idx = idx - N_CONSTANTS;
|
|
859
|
+
CV_DbgAssert(r_idx < 9);
|
|
860
|
+
value = R.val[r_idx];
|
|
861
|
+
}
|
|
862
|
+
bool isNegative = id < 0;
|
|
863
|
+
if (isNegative)
|
|
864
|
+
value = -value;
|
|
865
|
+
rotationR[i] = value;
|
|
866
|
+
}
|
|
867
|
+
Vec<T, 3> angles;
|
|
868
|
+
if (detail::isIntAngleType(eulerAnglesType)) {
|
|
869
|
+
if (abs(rotationR[0] - 1) < CV_QUAT_CONVERT_THRESHOLD) {
|
|
870
|
+
CV_LOG_WARNING(NULL, "Gimbal Lock occurs. Euler angles are non-unique, "
|
|
871
|
+
"we set the third angle to 0");
|
|
872
|
+
angles = {std::atan2(rotationR[1], rotationR[2]), rotationR[3], 0};
|
|
873
|
+
return angles;
|
|
874
|
+
} else if (abs(rotationR[0] + 1) < CV_QUAT_CONVERT_THRESHOLD) {
|
|
875
|
+
CV_LOG_WARNING(NULL, "Gimbal Lock occurs. Euler angles are non-unique, "
|
|
876
|
+
"we set the third angle to 0");
|
|
877
|
+
angles = {std::atan2(rotationR[4], rotationR[5]), rotationR[6], 0};
|
|
878
|
+
return angles;
|
|
879
|
+
}
|
|
880
|
+
} else // (!detail::isIntAngleType<T>(eulerAnglesType))
|
|
881
|
+
{
|
|
882
|
+
if (abs(rotationR[0] - 1) < CV_QUAT_CONVERT_THRESHOLD) {
|
|
883
|
+
CV_LOG_WARNING(NULL, "Gimbal Lock occurs. Euler angles are non-unique, "
|
|
884
|
+
"we set the first angle to 0");
|
|
885
|
+
angles = {0, rotationR[1], std::atan2(rotationR[2], rotationR[3])};
|
|
886
|
+
return angles;
|
|
887
|
+
} else if (abs(rotationR[0] + 1) < CV_QUAT_CONVERT_THRESHOLD) {
|
|
888
|
+
CV_LOG_WARNING(NULL, "Gimbal Lock occurs. Euler angles are non-unique, "
|
|
889
|
+
"we set the first angle to 0");
|
|
890
|
+
angles = {0, rotationR[4], std::atan2(rotationR[5], rotationR[6])};
|
|
891
|
+
return angles;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
angles(0) = std::atan2(rotationR[7], rotationR[8]);
|
|
896
|
+
if (detail::isTaitBryan(eulerAnglesType))
|
|
897
|
+
angles(1) = std::acos(rotationR[9]);
|
|
898
|
+
else
|
|
899
|
+
angles(1) = std::asin(rotationR[9]);
|
|
900
|
+
angles(2) = std::atan2(rotationR[10], rotationR[11]);
|
|
901
|
+
return angles;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
} // namespace cv
|
|
905
|
+
//! @endcond
|
|
906
|
+
|
|
907
|
+
#endif /*OPENCV_CORE_QUATERNION_INL_HPP*/
|