MycroftAI / mycroft-precise

A lightweight, simple-to-use, RNN wake word listener
Apache License 2.0
848 stars 227 forks source link

How to run Mycroft on Android? #196

Open EuphoriaCelestial opened 3 years ago

EuphoriaCelestial commented 3 years ago

As the title, I have trained my own Mycroft model, and it worked on Ubuntu; now I want to run it on Android too. Can anyone kindly help me with a step by step guide? Or at least please explain the workflow of this project in detail, how it collect the sound stream from microphone, compute the data, ... so I can replicate it in Java. Thanks in advance!

gfhjjk commented 2 years ago

Hello @EuphoriaCelestial Do you success run it in Android?If you success,can you share something to me. Thank you

EuphoriaCelestial commented 2 years ago

Hello @EuphoriaCelestial Do you success run it in Android?If you success,can you share something to me. Thank you

yes I have been able to run it on android there is tensorflow library/package for android (I am using Java), you just have to implement it and include the .pb model file into your android app then run. you can find tutorial on the main page of android or tensorflow, I don't remember exactly where, but its very straight forward and easy you can also convert to tflite for lighter, faster app, but I don't feel the need to do it with this model, since it already been lightweight

gfhjjk commented 1 year ago

Hello @EuphoriaCelestial Can you send your deployed Android kws to me? I just need a simple sample. I know it's very embarrassing. I'm a rookie, but my boss wants me to run this kws model as an Android demo. I won't do it for a long time. I would appreciate it if you could send me your Android demo.

EuphoriaCelestial commented 1 year ago

I don't have the code along with me, but there is still an complied APK file if you want, I cant send it by email. The data I've used for this version is from my own voice, so its okay to share. But I doubt if you can wake it up, since the wake word is in Vietnamese.

gfhjjk commented 1 year ago

I'm very glad to have your answer. But my boss gave me the ultimate goal is to achieve it on flutter, so I need android code and then migrate it to flutter. If possible, you can find simple Android code at your convenience. I know it's very impolite. Thank you.

EuphoriaCelestial commented 1 year ago

I have no experience with Flutter, but this guide may help you understand the easiest way to run Tensorflow model on Android without the need to convert it to Tensorflow Lite. https://medium.com/capital-one-tech/using-a-pre-trained-tensorflow-model-on-android-part-2-153ebdd4c465 https://medium.com/hellosimply/deploying-a-tensorflow-model-to-android-69d04d1b0cba

gfhjjk commented 1 year ago

OK, thank you very much for your help and answer

MohammadJRanjbar commented 1 year ago

OK, thank you very much for your help and answer

Hi, I'm working on the same task, I trained my wake word model. I have .pb and .net models and I want to run this model on Android. Is it possible for you to send me a template for android? I will really appreciate it. mjranjbark@gmail.com

I have no experience with Flutter, but this guide may help you understand the easiest way to run Tensorflow model on Android without the need to convert it to Tensorflow Lite. https://medium.com/capital-one-tech/using-a-pre-trained-tensorflow-model-on-android-part-2-153ebdd4c465 https://medium.com/hellosimply/deploying-a-tensorflow-model-to-android-69d04d1b0cba

DemingCheng commented 1 year ago

Hello @gfhjjk , 请问下大佬在安卓端跑起来了么,我也是被导师push的要做这些,可以加微信(cdm199811)和您聊聊么?可以付费。