├── .bazelrc ├── .bazelversion ├── .clang-format ├── .github ├── actions │ ├── lyra-builder │ │ └── action.yml │ └── setup-lyra-deps │ │ └── action.yml └── workflows │ └── ci.yml ├── .gitignore ├── BUILD ├── CONTRIBUTING.md ├── Doxyfile ├── LICENSE ├── README.md ├── WORKSPACE ├── android_configure.bzl ├── external ├── eigen.BUILD └── fft2d.BUILD ├── lyra ├── BUILD ├── android_example │ ├── AndroidManifest.xml │ ├── BUILD │ ├── LibraryManifest.xml │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── android │ │ │ └── lyra │ │ │ ├── BUILD │ │ │ └── MainActivity.java │ ├── jni_lyra_benchmark_lib.cc │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml ├── architecture_utils.h ├── buffered_filter_interface.h ├── buffered_resampler.cc ├── buffered_resampler.h ├── buffered_resampler_test.cc ├── cli_example │ ├── BUILD │ ├── decoder_main.cc │ ├── decoder_main_lib.cc │ ├── decoder_main_lib.h │ ├── decoder_main_lib_test.cc │ ├── encoder_main.cc │ ├── encoder_main_lib.cc │ ├── encoder_main_lib.h │ └── encoder_main_lib_test.cc ├── comfort_noise_generator.cc ├── comfort_noise_generator.h ├── comfort_noise_generator_test.cc ├── dsp_utils.cc ├── dsp_utils.h ├── dsp_utils_test.cc ├── feature_estimator_interface.h ├── feature_extractor_interface.h ├── fixed_packet_loss_model.cc ├── fixed_packet_loss_model.h ├── fixed_packet_loss_model_test.cc ├── generative_model_interface.h ├── gilbert_model.cc ├── gilbert_model.h ├── gilbert_model_test.cc ├── log_mel_spectrogram_extractor_impl.cc ├── log_mel_spectrogram_extractor_impl.h ├── log_mel_spectrogram_extractor_impl_benchmark.cc ├── log_mel_spectrogram_extractor_impl_test.cc ├── lyra_benchmark.cc ├── lyra_benchmark_lib.cc ├── lyra_benchmark_lib.h ├── lyra_components.cc ├── lyra_components.h ├── lyra_config.cc ├── lyra_config.h ├── lyra_config.proto ├── lyra_config_test.cc ├── lyra_decoder.cc ├── lyra_decoder.h ├── lyra_decoder_interface.h ├── lyra_decoder_test.cc ├── lyra_encoder.cc ├── lyra_encoder.h ├── lyra_encoder_interface.h ├── lyra_encoder_test.cc ├── lyra_gan_model.cc ├── lyra_gan_model.h ├── lyra_gan_model_test.cc ├── lyra_integration_test.cc ├── model_coeffs │ ├── lyra_config.binarypb │ ├── lyragan.tflite │ ├── quantizer.tflite │ ├── soundstream_encoder.tflite │ └── test_playback.wav ├── no_op_preprocessor.h ├── no_op_preprocessor_test.cc ├── noise_estimator.cc ├── noise_estimator.h ├── noise_estimator_interface.h ├── noise_estimator_test.cc ├── packet.h ├── packet_interface.h ├── packet_loss_model_interface.h ├── packet_test.cc ├── preprocessor_interface.h ├── resampler.cc ├── resampler.h ├── resampler_interface.h ├── resampler_test.cc ├── residual_vector_quantizer.cc ├── residual_vector_quantizer.h ├── residual_vector_quantizer_test.cc ├── soundstream_encoder.cc ├── soundstream_encoder.h ├── soundstream_encoder_test.cc ├── testdata │ ├── BUILD │ ├── incomplete_encoded_packet.lyra │ ├── invalid.wav │ ├── no_encoded_packet.lyra │ ├── one_encoded_packet_16khz.lyra │ ├── sample1_16kHz.wav │ ├── sample1_32kHz.wav │ ├── sample1_48kHz.wav │ ├── sample1_8kHz.wav │ ├── sample2_16kHz.wav │ ├── sample2_32kHz.wav │ ├── sample2_48kHz.wav │ ├── sample2_8kHz.wav │ └── two_encoded_packets_16khz.lyra ├── testing │ ├── BUILD │ ├── mock_feature_extractor.h │ ├── mock_generative_model.h │ ├── mock_lyra_decoder.h │ ├── mock_lyra_encoder.h │ ├── mock_noise_estimator.h │ ├── mock_resampler.h │ └── mock_vector_quantizer.h ├── tflite_model_wrapper.cc ├── tflite_model_wrapper.h ├── tflite_model_wrapper_test.cc ├── vector_quantizer_interface.h ├── wav_utils.cc ├── wav_utils.h ├── wav_utils_test.cc └── zero_feature_estimator.h ├── patches ├── BUILD └── com_google_absl_f863b622fe13612433fdf43f76547d5edda0c93001.diff └── toolchain ├── BUILD ├── README.md └── cc_toolchain_config.bzl /.bazelversion: -------------------------------------------------------------------------------- 1 | 5.3.2 2 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | Language: Cpp 2 | BasedOnStyle: Google 3 | DerivePointerAlignment: false 4 | PointerAlignment: Left 5 | -------------------------------------------------------------------------------- /.github/actions/lyra-builder/action.yml: -------------------------------------------------------------------------------- 1 | name: lyra-builder 2 | 3 | description: Build lyra binary on different platforms 4 | 5 | inputs: 6 | platform: 7 | description: Platform to build 8 | required: true 9 | architecture: 10 | description: Architecture to build 11 | required: true 12 | build-options: 13 | description: Options in bazel build command 14 | required: false 15 | default: "" 16 | 17 | runs: 18 | using: composite 19 | steps: 20 | - shell: bash 21 | run: | 22 | export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/21.4.7075529" 23 | if [[ "${{inputs.platform}}" != "android" ]]; then 24 | bazelisk test -c opt lyra/cli_example:encoder_main_lib_test ${{ inputs.build-options }} 25 | fi 26 | bazelisk build -c opt lyra/cli_example:encoder_main ${{ inputs.build-options }} 27 | - shell: bash 28 | run: | 29 | export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/21.4.7075529" 30 | if [[ "${{inputs.platform}}" != "android" ]]; then 31 | bazelisk test -c opt lyra/cli_example:decoder_main_lib_test ${{ inputs.build-options }} 32 | fi 33 | bazelisk build -c opt lyra/cli_example:decoder_main ${{ inputs.build-options }} 34 | - shell: bash 35 | run: | 36 | mkdir action-product 37 | cp -r lyra/model_coeffs action-product/ 38 | cp bazel-bin/lyra/cli_example/encoder_main action-product/lyra-encoder 39 | cp bazel-bin/lyra/cli_example/decoder_main action-product/lyra-decoder 40 | - uses: actions/upload-artifact@v2 41 | with: 42 | name: lyra-${{ inputs.platform }}-${{ inputs.architecture }} 43 | path: action-product 44 | -------------------------------------------------------------------------------- /.github/actions/setup-lyra-deps/action.yml: -------------------------------------------------------------------------------- 1 | name: setup-lyra-deps 2 | 3 | description: Setup NDK and python for lyra build 4 | 5 | runs: 6 | using: composite 7 | steps: 8 | - shell: bash 9 | run: | 10 | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "ndk;21.4.7075529" 11 | python -m pip install --upgrade pip 12 | pip install numpy 13 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | android-example: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Checkout repo 10 | uses: actions/checkout@v2 11 | - name: Set up Python 3.9 12 | uses: actions/setup-python@v4 13 | with: 14 | python-version: 3.9 15 | - name: Setup Lyra dependencies 16 | uses: ./.github/actions/setup-lyra-deps 17 | - name: Build Android App 18 | shell: bash 19 | run: | 20 | export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/21.4.7075529" 21 | bazelisk build lyra/android_example:lyra_android_example --config=android_arm64 --copt=-DBENCHMARK 22 | - name: Copy artifacts 23 | shell: bash 24 | run: | 25 | mkdir action-product 26 | cp bazel-bin/lyra/android_example/lyra_android_example.apk action-product/lyra_example.apk 27 | - name: Upload artifact 28 | uses: actions/upload-artifact@v2 29 | with: 30 | name: lyra-android-example 31 | path: action-product 32 | 33 | android-arm64: 34 | runs-on: ubuntu-latest 35 | steps: 36 | - name: Checkout repo 37 | uses: actions/checkout@v2 38 | - name: Set up Python 3.9 39 | uses: actions/setup-python@v4 40 | with: 41 | python-version: 3.9 42 | - name: Setup Lyra dependencies 43 | uses: ./.github/actions/setup-lyra-deps 44 | - name: Build and upload 45 | uses: ./.github/actions/lyra-builder 46 | with: 47 | platform: android 48 | architecture: arm64 49 | build-options: --config=android_arm64 50 | 51 | linux-amd64: 52 | runs-on: ubuntu-latest 53 | steps: 54 | - name: Checkout repo 55 | uses: actions/checkout@v2 56 | - name: Set up Python 3.9 57 | uses: actions/setup-python@v4 58 | with: 59 | python-version: 3.9 60 | - name: Setup Lyra dependencies 61 | uses: ./.github/actions/setup-lyra-deps 62 | - name: Build and upload 63 | uses: ./.github/actions/lyra-builder 64 | with: 65 | platform: linux 66 | architecture: amd64 67 | 68 | macos-amd64: 69 | runs-on: macos-latest 70 | steps: 71 | - name: Checkout repo 72 | uses: actions/checkout@v2 73 | - name: Set up Python 3.9 74 | uses: actions/setup-python@v4 75 | with: 76 | python-version: 3.9 77 | - name: Setup Lyra dependencies 78 | uses: ./.github/actions/setup-lyra-deps 79 | - name: Build and upload 80 | uses: ./.github/actions/lyra-builder 81 | with: 82 | platform: macos 83 | architecture: amd64 84 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ -------------------------------------------------------------------------------- /BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = [":__subpackages__"]) 2 | 3 | licenses(["notice"]) 4 | 5 | exports_files(["LICENSE"]) 6 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement (CLA). You (or your employer) retain the copyright to your 10 | contribution; this simply gives us permission to use and redistribute your 11 | contributions as part of the project. Head over to 12 | to see your current agreements on file or 13 | to sign a new one. 14 | 15 | You generally only need to submit a CLA once, so if you've already submitted one 16 | (even if it was for a different project), you probably don't need to do it 17 | again. 18 | 19 | ## Code Reviews 20 | 21 | All submissions, including submissions by project members, require review. We 22 | use GitHub pull requests for this purpose. Consult 23 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 24 | information on using pull requests. 25 | 26 | ## Community Guidelines 27 | 28 | This project follows 29 | [Google's Open Source Community Guidelines](https://opensource.google/conduct/). 30 | -------------------------------------------------------------------------------- /android_configure.bzl: -------------------------------------------------------------------------------- 1 | """Repository rule for Android SDK and NDK autoconfiguration. 2 | This rule is a no-op unless the required android environment variables are set. 3 | """ 4 | 5 | # Based on https://github.com/envoyproxy/envoy-mobile/pull/2039 6 | # Workaround for https://github.com/bazelbuild/bazel/issues/14260 7 | 8 | def _android_autoconf_impl(repository_ctx): 9 | sdk_rule = "" 10 | if repository_ctx.os.environ.get("ANDROID_HOME"): 11 | sdk_rule = """ 12 | native.android_sdk_repository( 13 | name="androidsdk", 14 | api_level=30, 15 | build_tools_version="30.0.3", 16 | ) 17 | """ 18 | 19 | ndk_rule = "" 20 | if repository_ctx.os.environ.get("ANDROID_NDK_HOME"): 21 | ndk_rule = """ 22 | native.android_ndk_repository( 23 | name="androidndk", 24 | api_level=30, 25 | ) 26 | """ 27 | 28 | if ndk_rule == "" and sdk_rule == "": 29 | sdk_rule = "pass" 30 | 31 | repository_ctx.file("BUILD.bazel", "") 32 | repository_ctx.file("android_configure.bzl", """ 33 | def android_workspace(): 34 | {} 35 | {} 36 | """.format(sdk_rule, ndk_rule)) 37 | 38 | android_configure = repository_rule( 39 | implementation = _android_autoconf_impl, 40 | ) 41 | -------------------------------------------------------------------------------- /external/eigen.BUILD: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Eigen is a C++ template library for linear algebra: vectors, 3 | # matrices, and related algorithms. 4 | # 5 | # Note that this build file is mostly stolen from 6 | # https://github.com/tensorflow/tensorflow/blob/master/third_party/eigen.BUILD 7 | 8 | licenses([ 9 | # Note: Eigen is an MPL2 library that includes GPL v3 and LGPL v2.1+ code. 10 | # We've taken special care to not reference any restricted code. 11 | "reciprocal", # MPL2 12 | "notice", # Portions BSD 13 | ]) 14 | 15 | exports_files(["COPYING.MPL2"]) 16 | 17 | # License-restricted (i.e. not reciprocal or notice) files inside Eigen/... 18 | EIGEN_RESTRICTED_FILES = [ 19 | "Eigen/src/OrderingMethods/Amd.h", 20 | "Eigen/src/SparseCholesky/**", 21 | ] 22 | 23 | # Notable transitive dependencies of restricted files inside Eigen/... 24 | EIGEN_RESTRICTED_DEPS = [ 25 | "Eigen/Eigen", 26 | "Eigen/IterativeLinearSolvers", 27 | "Eigen/MetisSupport", 28 | "Eigen/Sparse", 29 | "Eigen/SparseCholesky", 30 | "Eigen/SparseLU", 31 | ] 32 | 33 | EIGEN_FILES = [ 34 | "Eigen/**", 35 | ] 36 | 37 | # List of files picked up by glob but actually part of another target. 38 | EIGEN_EXCLUDE_FILES = [ 39 | "Eigen/src/Core/arch/AVX/PacketMathGoogleTest.cc", 40 | ] 41 | 42 | # Files known to be under MPL2 license. 43 | EIGEN_MPL2_HEADER_FILES = glob( 44 | EIGEN_FILES, 45 | exclude = EIGEN_EXCLUDE_FILES + 46 | EIGEN_RESTRICTED_FILES + 47 | EIGEN_RESTRICTED_DEPS + [ 48 | # Guarantees any file missed by excludes above will not compile. 49 | "Eigen/src/Core/util/NonMPL2.h", 50 | "Eigen/**/CMakeLists.txt", 51 | ], 52 | ) 53 | 54 | cc_library( 55 | name = "eigen", 56 | hdrs = EIGEN_MPL2_HEADER_FILES, 57 | defines = [ 58 | # This define (mostly) guarantees we don't link any problematic 59 | # code. We use it, but we do not rely on it, as evidenced above. 60 | "EIGEN_MPL2_ONLY", 61 | ], 62 | includes = ["."], 63 | visibility = ["//visibility:public"], 64 | ) 65 | -------------------------------------------------------------------------------- /external/fft2d.BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | # Unrestricted use; can only distribute original package. 4 | # See fft2d/readme2d.txt 5 | licenses(["notice"]) 6 | 7 | exports_files(["LICENSE"]) 8 | 9 | # This is the main 2D FFT library. The 2D FFTs in this library call 10 | # 1D FFTs. In addition, fast DCTs are provided for the special case 11 | # of 8x8 and 16x16. This code in this library is referred to as 12 | # "Version II" on http://momonga.t.u-tokyo.ac.jp/~ooura/fft.html. 13 | cc_library( 14 | name = "fft2d", 15 | srcs = [ 16 | "fft2d/alloc.c", 17 | "fft2d/fftsg.c", 18 | "fft2d/fftsg2d.c", 19 | "fft2d/shrtdct.c", 20 | ], 21 | textual_hdrs = [ 22 | "fft2d/alloc.h", 23 | ], 24 | linkopts = ["-lm"], 25 | ) 26 | -------------------------------------------------------------------------------- /lyra/android_example/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /lyra/android_example/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_android//android:rules.bzl", "android_binary", "android_library") 2 | 3 | # Placeholder for jni import 4 | 5 | package(default_visibility = ["//visibility:public"]) 6 | 7 | licenses(["notice"]) 8 | 9 | # Android App rules 10 | cc_library( 11 | name = "jni_lyra_benchmark_lib", 12 | srcs = [ 13 | "jni_lyra_benchmark_lib.cc", 14 | "@org_tensorflow//tensorflow/lite:libtensorflowlite.so", 15 | ], 16 | linkopts = [ 17 | "-landroid", 18 | "-ldl", 19 | "-llog", 20 | ], 21 | deps = [ 22 | "//lyra:lyra_benchmark_lib", 23 | "//lyra:lyra_config", 24 | "//lyra/cli_example:decoder_main_lib", 25 | "//lyra/cli_example:encoder_main_lib", 26 | "@com_google_absl//absl/random", 27 | ], 28 | alwayslink = True, 29 | ) 30 | 31 | android_library( 32 | name = "lyra_android_lib", 33 | srcs = ["//lyra/android_example/java/com/example/android/lyra:MainActivity.java"], 34 | custom_package = "com.example.android.lyra", 35 | manifest = "LibraryManifest.xml", 36 | resource_files = glob(["res/**/*"]), 37 | deps = [ 38 | ":jni_lyra_benchmark_lib", 39 | "@maven//:androidx_annotation_annotation", 40 | "@maven//:androidx_appcompat_appcompat", 41 | "@maven//:androidx_constraintlayout_constraintlayout", 42 | "@maven//:androidx_core_core", 43 | "@org_tensorflow//tensorflow/lite:libtensorflowlite.so", 44 | ], 45 | ) 46 | 47 | filegroup( 48 | name = "assets", 49 | srcs = ["//lyra:android_example_assets"], 50 | ) 51 | 52 | android_binary( 53 | name = "lyra_android_example", 54 | assets = [ 55 | ":assets", 56 | ], 57 | assets_dir = "model_coeffs", 58 | custom_package = "com.example.android.lyra", 59 | manifest = "AndroidManifest.xml", 60 | multidex = "native", 61 | deps = [":lyra_android_lib"], 62 | ) 63 | -------------------------------------------------------------------------------- /lyra/android_example/LibraryManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 20 | 21 | 22 | 23 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /lyra/android_example/java/com/example/android/lyra/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | exports_files( 4 | ["MainActivity.java"], 5 | visibility = ["//lyra/android_example:__subpackages__"], 6 | ) 7 | -------------------------------------------------------------------------------- /lyra/android_example/jni_lyra_benchmark_lib.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | 17 | #include 18 | #include 19 | 20 | #include "absl/random/random.h" 21 | #include "lyra/cli_example/decoder_main_lib.h" 22 | #include "lyra/cli_example/encoder_main_lib.h" 23 | #include "lyra/lyra_benchmark_lib.h" 24 | #include "lyra/lyra_config.h" 25 | 26 | extern "C" JNIEXPORT jshortArray JNICALL 27 | Java_com_example_android_lyra_MainActivity_encodeAndDecodeSamples( 28 | JNIEnv* env, jobject this_obj, jshortArray samples, jint sample_length, 29 | jint bitrate, jstring model_base_path) { 30 | std::vector samples_vector(sample_length); 31 | std::vector features; 32 | std::vector decoded_audio; 33 | jshortArray java_decoded_audio = nullptr; 34 | env->GetShortArrayRegion(samples, jsize{0}, sample_length, 35 | &samples_vector[0]); 36 | 37 | const char* cpp_model_base_path = env->GetStringUTFChars(model_base_path, 0); 38 | std::unique_ptr decoder = 39 | chromemedia::codec::LyraDecoder::Create( 40 | 16000, chromemedia::codec::kNumChannels, cpp_model_base_path); 41 | 42 | absl::BitGen gen; 43 | if (chromemedia::codec::EncodeWav( 44 | samples_vector, chromemedia::codec::kNumChannels, 16000, bitrate, 45 | false, false, cpp_model_base_path, &features) && 46 | chromemedia::codec::DecodeFeatures( 47 | features, chromemedia::codec::BitrateToPacketSize(bitrate), 48 | /*randomize_num_samples_requested=*/false, gen, decoder.get(), 49 | nullptr, &decoded_audio)) { 50 | java_decoded_audio = env->NewShortArray(decoded_audio.size()); 51 | env->SetShortArrayRegion(java_decoded_audio, 0, decoded_audio.size(), 52 | &decoded_audio[0]); 53 | } 54 | 55 | env->ReleaseStringUTFChars(model_base_path, cpp_model_base_path); 56 | 57 | return java_decoded_audio; 58 | } 59 | 60 | extern "C" JNIEXPORT int JNICALL 61 | Java_com_example_android_lyra_MainActivity_lyraBenchmark( 62 | JNIEnv* env, jobject this_obj, jint num_cond_vectors, 63 | jstring model_base_path) { 64 | const char* cpp_model_base_path = env->GetStringUTFChars(model_base_path, 0); 65 | int ret = 66 | chromemedia::codec::lyra_benchmark(num_cond_vectors, cpp_model_base_path, 67 | /*benchmark_feature_extraction=*/true, 68 | /*benchmark_quantizer=*/true, 69 | /*benchmark_generative_model=*/true); 70 | env->ReleaseStringUTFChars(model_base_path, cpp_model_base_path); 71 | return ret; 72 | } 73 | -------------------------------------------------------------------------------- /lyra/android_example/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 23 | 28 | 29 | 35 | 38 | 41 | 42 | 43 | 44 | 50 | 51 | -------------------------------------------------------------------------------- /lyra/android_example/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 24 | 25 | 34 |