Comments (11)
I had the same problem so I made a Dockerfile:
FROM ubuntu:16.04
RUN apt update && apt --yes --force-yes install wget unzip build-essential python python-dev virtualenv portaudio19-dev
RUN wget https://github.com/seasalt-ai/snowboy/archive/master.zip && unzip master.zip
RUN cd snowboy-master/ && \
virtualenv -p python2 venv/snowboy && \
. venv/snowboy/bin/activate && \
cd examples/Python && \
pip install -r requirements.txt
RUN apt -y remove wget unzip build-essential portaudio19-dev && apt -y autoremove && apt clean && rm -rf /var/lib/apt/lists/*
CMD cd snowboy-master/ && \
. venv/snowboy/bin/activate && \
cd examples/Python && \
python generate_pmdl.py -r1=model/record1.wav -r2=model/record2.wav -r3=model/record3.wav -lang=en -n=model/hotword.pmdl
Save the above in a file called Dockerfile
and from the same directory build a docker image like this:
docker build -t snowboy-pmdl .
This will create an image which you can run to train your personal model. In order for this to work you'll need to create a directory called model
on your host machine (Ubuntu 18 or whatever) and place your three audio files in there. So the directory should look something like this (note: the wav files need the exact names as below or it won't work):
$ ls model/
record1.wav record2.wav record3.wav
Finally you can call docker (note: need to be in the parent directory of model
):
docker run -it -v $(pwd)/model:/snowboy-master/examples/Python/model snowboy-pmdl
This command mounts the model
directory in the docker container and runs a script which calls generate_pmdl.py
If everything went well, you should now have a file called hotword.pmdl
in your model
directory.
from snowboy.
@Hemanshu-Bhargav yes we are supposed to use the new script to replace the old training_service.py script. For Android/iOS, you can try to set up your own service, and then call the service from Android/iOS.
@dschnabel would you like to add your dockerfile to the repo? By the way it looks great!
from snowboy.
Hi Daniel Schnabel, I'm not using the Ubuntu version, but it seems the API is not functional at the moment. I see your Dockerfile creates a personal model, however, is this personal model successfully trained on new audio samples? Just to confirm, your Dockerfile does indeed work for personal models trained after the API was shutdown on December 31st, 2020?
from snowboy.
My dockerfile does not use the API, it uses the python script to train a personal model. See this portion from the Dockerfile which does the job:
python generate_pmdl.py -r1=model/record1.wav -r2=model/record2.wav -r3=model/record3.wav -lang=en -n=model/hotword.pmdl
from snowboy.
My dockerfile does not use the API, it uses the python script to train a personal model.
Thanks for your reply. Do you know if this script performs the same function as the API (without using training_service)? @chenguoguo Can you maybe clarify? Thanks!
from snowboy.
@Hemanshu-Bhargav I asked a similar question in #5
from snowboy.
@dschnabel
Ah thanks, I didn't know any of the original model training was still functional for new "hotwords". Pre-existing models trained before the shutdown, however, remain functional.
@chenguoguo @hs79hs
If this new script is intended to replace the API, then, for the sake of example, in the Python demo, training_service.py has been removed in favour of the new script, correct? However, as referenced in #3, what would the execution flow look like for Android/iOS?
from snowboy.
@chenguoguo Thanks for the confirmation. I had another question related to Ubuntu if you don't mind. I can open another issue if that keeps things organized.
Although I believe that support for the Raspberry Pi was later added to the original repository by other collaborators, I've been experiencing an issue with SciPy on the Raspberry Pi and I wanted to ask if you've perhaps had a similar experience.
I've tried different versions of SciPy, Python virtual environments, and @dschnabel's Dockerfile on both Ubuntu and Raspbian, but they all fail— either stating that SciPy is not available, or that Ubuntu 16.04 is required. The Dockerfile works without issue on Ubuntu running on any other architecture.
Any thoughts?
from snowboy.
@chenguoguo I created a PR: #14
from snowboy.
Hi @dschnabel @chenguoguo
The dockerfile works exactly what i wanted, but i'm facing a major issue which is about the generated pmdl file size. I used 3 recording with different sizes (245kb, 350kb and 300kb) , but got the output only 35kb. I also used other recorded files to check if it resturns the same or not, actullay the scripts always return a file size in between 30 to 35kb.
And because of that detection is not really good, so can you suggest me what can i do?
Thank you
from snowboy.
I'm having the same issue, but cannot find a way to make it working.
Is there any way to make it work?
from snowboy.
Related Issues (17)
- Where to see the full documentation? HOT 2
- add support for more than three audio files. HOT 3
- adding a way to train using my own false positives HOT 1
- How to rebuild pmdl lib HOT 3
- pmdl not supported on Android? HOT 5
- A website HOT 1
- hotword.pmdl filesize only 16kb
- Training your own model HOT 1
- running Dockerfile import error for snowboy.so HOT 1
- راجع "Talabat Rider"
- i can not "npm install snowboy"
- Deprecated API HOT 1
- "npm install snowboy" not working HOT 3
- Accuracy of personal model training HOT 1
- GCC 5 support HOT 3
- creating my own umdl HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snowboy.