Skip to content

Commit 38a69b3

Browse files
authored
V1.6 (#168)
v1.6 Former-commit-id: 08e2b28
1 parent 535e165 commit 38a69b3

File tree

425 files changed

+531
-654
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

425 files changed

+531
-654
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/binding/dotnet/PorcupineCS/bin
66
/binding/dotnet/PorcupineTest/bin
77
/binding/dotnet/PorcupineTest/obj
8+
demo/ios/PorcupineDemoNoWatch.xcodeproj/xcshareddata/

README.md

Lines changed: 50 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,29 @@
55

66
Made in Vancouver, Canada by [Picovoice](https://picovoice.ai)
77

8-
Porcupine is a self-service, highly-accurate, and lightweight **wake word** (**voice control**) engine. It enables
9-
developers to build always-listening voice-enabled applications/platforms. Porcupine is
8+
Porcupine is a highly-accurate and lightweight **wake word**
9+
(a.k.a **keyword spotting**, **hotword detection** and **voice command**) engine. It enables developers to build
10+
always-listening voice-enabled applications. It is
1011

11-
* self-service. Developers are empowered to **choose any wake word** and build its model **within seconds**.
1212
* using **deep neural networks** trained in **real-world situations**.
13-
* compact and computationally-efficient making it suitable for **IoT** applications. It can run with as low as 20 KB of
14-
RAM.
15-
* **cross-platform**. It is implemented in fixed-point ANSI C. Currently **Raspberry Pi**, **Android**, **iOS**,
16-
**watchOS**, **Linux**, **Mac**, **Windows**, and **web browsers** are supported. Furthermore, Support for various
17-
**ARM Cortex-A** and **ARM Cortex-M** processors and a growing number of **DSPs** is available.
18-
* **scalable**. It can detect tens of commands concurrently with no added CPU/memory footprint.
13+
* compact and computationally-efficient making it suitable for **IoT**. It can run with as low as **20 KB RAM** on an MCU.
14+
* **cross-platform**. It is implemented in fixed-point ANSI C. Currently **Raspberry Pi**, **Beagle Bone**, **Android**,
15+
**iOS**, **watchOS**, **Linux**, **Mac**, **Windows**, and **web browsers** (**WebAssembly**) are supported. Furthermore,
16+
Support for various **ARM Cortex-A** and **ARM Cortex-M** (M4 and M7) processors and **DSPs** is available.
17+
* **scalable**. It can detect multiple (possibly many) of voice commands concurrently with no added CPU/memory footprint.
18+
* self-service. Developers are empowered to **choose any wake phrase** and evaluate it.
1919

2020
## Table of Contents
2121

2222
* [Try It Out](#try-it-out)
23-
* [Getting Started](#getting-started)
2423
* [Performance](#performance)
2524
* [Model Variants](#model-variants)
2625
* [Structure of Repository](#structure-of-repository)
2726
* [Running Demo Applications](#running-demo-applications)
2827
* [Python Demo Application](#python-demo-application)
2928
* [Android Demo Application](#android-demo-application)
3029
* [iOS Demo Application](#ios-demo-application)
31-
* [Creating Keyword Files](#creating-keyword-files)
30+
* [Evaluating Keyword Files](#evaluating-keyword-files)
3231
* [Integration](#integration)
3332
* [C](#c)
3433
* [Python](#python)
@@ -42,54 +41,45 @@ RAM.
4241

4342
## Try It Out
4443

45-
Try out Porcupine using its [interactive web demo](https://picovoice.ai/products/#wake-word-demo). You need a working microphone.
44+
Try out Porcupine using its [interactive web demo](https://picovoice.ai/products/#wake-word-demo). You need a working
45+
microphone.
4646

4747
Try out Porcupine by downloading it's
4848
[Android demo application](https://play.google.com/store/apps/details?id=ai.picovoice.porcupine.demo&hl=en). The demo
4949
application allows you to test Porcupine on a variety of wake words in any environment.
5050

5151
![Android Demo](resources/images/demo.gif)
5252

53-
See Porcupine in action on an ARM Cortex-M7 (accompanied by [Rhino](https://github.com/Picovoice/rhino) for intent inference).
53+
See Porcupine in action on an ARM Cortex-M7 (accompanied by [rhino](https://github.com/Picovoice/rhino) for intent inference).
5454

5555
[![Porcupine in Action](https://img.youtube.com/vi/WadKhfLyqTQ/0.jpg)](https://www.youtube.com/watch?v=WadKhfLyqTQ)
5656

57-
## Getting Started
58-
59-
### Wake Word Tutorial
60-
61-
[![Porcupine Tutorial - Wake Word](https://img.youtube.com/vi/3z7LBW_Rl9c/0.jpg)](https://www.youtube.com/watch?v=3z7LBW_Rl9c)
62-
63-
### Voice Control Tutorial
64-
65-
[![Porcupine Tutorial - Voice Control](https://img.youtube.com/vi/YQQ5Bq5HqpQ/0.jpg)](https://www.youtube.com/watch?v=YQQ5Bq5HqpQ)
66-
6757
## Performance
6858

6959
A comparison between accuracy and runtime metrics of Porcupine and two other widely-used libraries, PocketSphinx and
7060
Snowboy, is provided [here](https://github.com/Picovoice/wakeword-benchmark). Compared to the best-performing engine,
71-
Porcupine's standard model is 2.53 times more accurate, 2.6 times faster (on Raspberry Pi 3), and consumes 45% less
72-
memory.
61+
Porcupine's standard model is 3 times more accurate, 3.3 times faster (on Raspberry Pi 3).
7362

7463
## Model Variants
7564

76-
Porcupine comes in two different variations: **standard** and **tiny**. The tiny model is specifically designed for
77-
deeply-embedded applications. Its accuracy is slightly lower than the standard model but it consumes considerably less
78-
resources. Below is the comparison of runtime measurements for different variants of Porcupine on Raspberry Pi3.
65+
Porcupine comes in two different variations: **standard** and **compressed**. The compressed model is specifically designed
66+
for deeply-embedded applications (MCUs and DSPs). Its accuracy is slightly lower than the standard model but it consumes
67+
considerably less resources. Below is the comparison of runtime measurements for different variants of Porcupine on
68+
Raspberry Pi3.
7969

80-
| Model Variant | CPU Usage | Memory Usage |
70+
| Model Variant | CPU Usage | Model Size (KB)
8171
:---: | :---: | :---:
82-
Standard | 7.39% | 1380 KB |
83-
Tiny | 3.42% | 240 KB |
72+
Standard | 5.67% | 1388
73+
Compressed | 2.43% | 232
8474

8575
For accuracy comparison of different variants refer to
8676
[benchmark repository](https://github.com/Picovoice/wakeword-benchmark).
8777

8878
## Structure of Repository
8979

9080
Porcupine is shipped as an ANSI C precompiled library. The binary files for supported platforms are located under
91-
[lib/](/lib) and header files are at [include/](/include). Currently, Raspberry Pi, Android, iOS, watchOS, Linux, Mac,
92-
Windows, and modern web browsers are supported.
81+
[lib/](/lib) and header files are at [include/](/include). Currently, Beagle Bone, Raspberry Pi, Android, iOS, watchOS,
82+
Linux, Mac, Windows, and modern web browsers (supporting WebAssembly) are supported.
9383

9484
Bindings are available at [binding/](/binding) to facilitate usage from higher-level languages/platforms. Demo
9585
applications are at [demo/](/demo). When possible, use one of the demo applications as a starting point for your own
@@ -107,11 +97,11 @@ documentation, it is assumed that the current working directory is the root of t
10797

10898
This [demo application](/demo/python) allows testing Porcupine using computer's microphone. It opens an input audio
10999
stream, monitors it using Porcupine's library, and logs the detection events into the console. Below is an example of
110-
running the demo for hotword **Alexa** from the command line. Replace `${SYSTEM}` with the name of the operating system
111-
on your machine (e.g. linux, mac, windows, or raspberry-pi).
100+
running the demo for hotword `picovoice` from the command line. Replace `${SYSTEM}` with the name of the operating system
101+
on your machine (e.g. linux, mac, windows, or raspberrypi).
112102

113103
```bash
114-
python demo/python/porcupine_demo.py --keyword_file_paths resources/keyword_files/alexa_${SYSTEM}.ppn
104+
python demo/python/porcupine_demo.py --keyword_file_paths resources/keyword_files/${SYSTEM}/alexa_${SYSTEM}.ppn
115105
```
116106

117107
### Android Demo Application
@@ -125,19 +115,19 @@ your machine in order to run the application.
125115
Using [Xcode](https://developer.apple.com/xcode/) open [demo/ios](/demo/ios) and run the application. Note that you need
126116
an iOS device connected to your machine and a valid Apple developer account.
127117

128-
## Creating Keyword Files
118+
## Evaluating Keyword Files
129119

130-
Porcupine enables developers to build models for any wake word. This is done using Porcupine's optimizer utility.
120+
Porcupine enables developers to evaluate models for any wake word. This is done using Porcupine's optimizer utility.
131121
It finds optimal model hyper-parameters for a given hotword and stores these parameters in a keyword file.
132-
You could create your own keyword file using the [Porcupine's optimizer](/tools/optimizer) from the command line
122+
You could create keyword files using the [Porcupine's optimizer](/tools/optimizer) from the command line
133123

134124
```bash
135-
tools/optimizer/${SYSTEM}/${MACHINE}/pv_porcupine_optimizer -r resources/ -w ${WAKE_WORD} \
125+
tools/optimizer/${SYSTEM}/${MACHINE}/pv_porcupine_optimizer -r resources/optimizer_data -w ${WAKE_WORD} \
136126
-p ${TARGET_SYSTEM} -o ${OUTPUT_DIRECTORY}
137127
```
138128

139129
In the above example replace ```${SYSTEM}``` and ```${TARGET_SYSTEM}``` with current and target (runtime) operating
140-
systems (linux, mac, or windows). ```${MACHINE}``` is the CPU architecture of current machine (x86_64 or i386). ```${WAKE_WORD}```
130+
systems (linux, mac, or windows). ```${MACHINE}``` is the CPU architecture of current machine (x86_64 or amd64). ```${WAKE_WORD}```
141131
is the chosen wake word. Finally, ```${OUTPUT_DIRECTORY}``` is the output directory where keyword file will be stored.
142132

143133
## Integration
@@ -154,6 +144,7 @@ object can be constructed as follows.
154144
const char *model_file_path = ... // The file is available at lib/common/porcupine_params.pv
155145
const char *keyword_file_path = ...
156146
const float sensitivity = 0.5;
147+
157148
pv_porcupine_object_t *handle;
158149

159150
const pv_status_t status = pv_porcupine_init(model_file_path, keyword_file_path, sensitivity, &handle);
@@ -164,7 +155,7 @@ if (status != PV_STATUS_SUCCESS) {
164155
```
165156

166157
Sensitivity is the parameter that enables developers to trade miss rate for false alarm. It is a floating number within
167-
[0, 1]. A higher sensitivity reduces miss rate at cost of increased false alarm rate.
158+
[0, 1]. A higher sensitivity reduces miss rate (false reject rate) at cost of increased false alarm rate.
168159

169160
Now the `handle` can be used to monitor incoming audio stream. Porcupine accepts single channel, 16-bit PCM audio.
170161
The sample rate can be retrieved using `pv_sample_rate()`. Finally, Porcupine accepts input audio in consecutive chunks
@@ -233,8 +224,8 @@ handle.delete()
233224

234225
### csharp
235226

236-
[/binding/dotnet/PorcupineCS/Porcupine.cs](/binding/dotnet/PorcupineCS/Porcupine.cs) provides a c# binding for Porcupine library. Below is a
237-
quick demonstration of how to construct an instance of it to detect multiple keywords concurrently.
227+
[/binding/dotnet/PorcupineCS/Porcupine.cs](/binding/dotnet/PorcupineCS/Porcupine.cs) provides a c# binding for Porcupine
228+
. Below is a quick demonstration of how to construct an instance of it to detect multiple keywords concurrently.
238229

239230

240231
```csharp
@@ -455,9 +446,6 @@ acquired by WebAssembly using `.release` when done
455446

456447
For more information refer to [binding](/binding/js) and [demo](/demo/js).
457448

458-
459-
460-
461449
## Contributing
462450

463451
If you like to contribute to Porcupine, please read through [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -474,6 +462,13 @@ If you like to contribute to Porcupine, please read through [CONTRIBUTING.md](CO
474462

475463
## Releases
476464

465+
### v1.6.0 - April 25th, 2019
466+
467+
* Improved accuracy across all models.
468+
* Runtime optimization across all models
469+
* Added support for Beagle Bone
470+
* iOS build can run on simulator now.
471+
477472
### v1.5.0 - November 13, 2018
478473

479474
* Improved optimizer's accuracy.
@@ -482,13 +477,13 @@ If you like to contribute to Porcupine, please read through [CONTRIBUTING.md](CO
482477

483478
### v1.4.0 - July 20, 2018
484479

485-
* Improved accuracy across all models (specifically tiny variant).
480+
* Improved accuracy across all models (specifically compressed variant).
486481
* Runtime optimizations.
487482
* Updated documentation.
488483

489484
### v1.3.0 - June 19, 2018
490485

491-
* Added tiny model (200 KB) for deeply-embedded platforms.
486+
* Added compressed model (200 KB) for deeply-embedded platforms.
492487
* Improved accuracy.
493488
* Runtime optimizations and bug fixes.
494489

@@ -509,13 +504,12 @@ CPU/memory footprint.
509504
## License
510505

511506
This repository is licensed under Apache 2.0 except for the [optimizer tool](/tools/optimizer) and keyword files
512-
generated using it. This allows running the library on all supported platforms using the set of freely-available [keyword
513-
files](/resources/keyword_files).
507+
generated using it. This allows running the library on all supported platforms using the set of freely-available
508+
[keyword files](/resources/keyword_files).
514509

515510
Custom wake-words for Linux, Mac, and Windows can be generated using the [optimizer tool](/tools/optimizer) only for
516-
personal and non-commercial use. The use of [optimizer tool](/tools/optimizer) and keyword files generated using it in
517-
commercial products without acquiring a commercial licensing agreement from Picovoice is strictly prohibited.
518-
519-
Custom wake-words for other platforms are only provided with the purchase of the commercial license.
511+
**non-commercial** and **evaluation** purposes. The use of [optimizer tool](/tools/optimizer) and keyword files generated
512+
using it in commercial products without acquiring a commercial licensing agreement from Picovoice is strictly prohibited.
520513

521-
In order to inquire about the commercial license [contact us](https://picovoice.ai/company/#contact-us).
514+
Custom wake-words for other platforms are only provided with the purchase of the commercial license. In order to inquire
515+
about the commercial license [contact us](https://picovoice.ai/company/#contact-us).

binding/android/.idea/misc.xml

Lines changed: 5 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/android/.idea/codeStyles/Project.xml

Lines changed: 0 additions & 29 deletions
This file was deleted.

demo/android/.idea/misc.xml

Lines changed: 5 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/android/app/src/main/java/ai/picovoice/porcupine/demo/Utils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private static void copyPorcupineConfigFiles(Context context) {
7373
R.raw.americano, R.raw.avocado, R.raw.blueberry, R.raw.bumblebee, R.raw.caterpillar,
7474
R.raw.christina, R.raw.dragonfly, R.raw.flamingo, R.raw.francesca, R.raw.grapefruit,
7575
R.raw.grasshopper, R.raw.iguana, R.raw.picovoice, R.raw.pineapple, R.raw.porcupine,
76-
R.raw.raspberry, R.raw.terminator, R.raw.vancouver, R.raw.params
76+
R.raw.raspberry, R.raw.terminator, R.raw.vancouver, R.raw.params, R.raw.hey_pico
7777
};
7878
Resources resources = context.getResources();
7979
for (int resId : resIds) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../../../resources/keyword_files/android/hey pico_android.ppn

0 commit comments

Comments
 (0)