GithubHelp home page GithubHelp logo

moritzcermann / unity-whisper-mobile Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 2.0 2.22 MB

Whisper-tiny model implemented in Unity-Senits running local on android.

CMake 11.56% C 12.53% C++ 12.40% C# 4.94% HLSL 10.14% ShaderLab 48.43%

unity-whisper-mobile's Introduction

senits-whisper-mobile

A Unity project that utilizes unity/sentis-whisper-tiny, specifically adapted for mobile platforms.

Setup

  1. Download Models: Download AudioDecoder_Tiny.sentis, AudioEncoder_Tiny.sentis, and LogMelSepctro.sentis.
  2. Add Models: In the /Assets directory, place the downloaded models inside the Models folder.
  3. Assign Models: In the Inspector, assign these 3 models to the RunWhisper script.

Ideally, you should store these models in the StreamingAssets folder and load them at runtime. However, accessing the StreamingAssets folder on Android and WebGL platforms is not as straightforward as on other platforms (e.g., you cannot access them directly via Application.streamingAssetsPath + "/AudioDecoder_Tiny.sentis").

Accessing StreamingAssets on Android and WebGL

On Android and WebGL platforms, you cannot access files in the StreamingAssets folder directly as you would on other platforms. Instead, you need to fetch the model files via UnityWebRequest from your StreamingAssets folder, save/cache them, and then load (ModelLoader.Load) the model.

Error

At the time of writing i choose a workaround because loading the model got me an error: “Error Unable to Load type Unity.Sentis.Layers.Gather required for deserialisation”. What i did is exactly what i described in Setup. I basically put the models in the Asset/Models folder instead of the StreamingAsset folder.

For more detailed information on this challenge and possible workaround approaches, refer to this forum post. And this forum post.

Requirements / Versions

  • Unity 2023.2.1f1
  • Sentis 1.3.0-pre

Note:

You might want to change the Backendtype inside RunWhisper.cs depending on your device.

Tested On

  • Pixel 6 -> working
  • Quest 3 -> not tested
  • WebGl -> not tested

unity-whisper-mobile's People

Contributors

moritzcermann avatar

Stargazers

 avatar  avatar Hakkı Tumar avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.