Giter Site home page Giter Site logo

Comments (11)

dschnabel avatar dschnabel commented on July 29, 2024 9

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.

chenguoguo avatar chenguoguo commented on July 29, 2024 1

@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.

Hemanshu-Bhargav avatar Hemanshu-Bhargav commented on July 29, 2024

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.

dschnabel avatar dschnabel commented on July 29, 2024

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.

Hemanshu-Bhargav avatar Hemanshu-Bhargav commented on July 29, 2024

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.

dschnabel avatar dschnabel commented on July 29, 2024

@Hemanshu-Bhargav I asked a similar question in #5

from snowboy.

Hemanshu-Bhargav avatar Hemanshu-Bhargav commented on July 29, 2024

@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.

Hemanshu-Bhargav avatar Hemanshu-Bhargav commented on July 29, 2024

@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.

dschnabel avatar dschnabel commented on July 29, 2024

@chenguoguo I created a PR: #14

from snowboy.

rrsaikat avatar rrsaikat commented on July 29, 2024

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.

codakkk avatar codakkk commented on July 29, 2024

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)

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.