Skip to content

Commit d997639

Browse files
committed
Merge pull request #82 from readbeyond/devel
Fixing the index issue in dtw
2 parents d8666b8 + 426590b commit d997639

File tree

5 files changed

+35
-10
lines changed

5 files changed

+35
-10
lines changed

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
**aeneas** is a Python/C library and a set of tools to automagically synchronize audio and text (aka forced alignment).
44

5-
* Version: 1.5.0
6-
* Date: 2016-04-02
5+
* Version: 1.5.0.2
6+
* Date: 2016-04-09
77
* Developed by: [ReadBeyond](http://www.readbeyond.it/)
88
* Lead Developer: [Alberto Pettarin](http://www.albertopettarin.it/)
99
* License: the GNU Affero General Public License Version 3 (AGPL v3)
1010
11-
* Quick Links: [Home](http://www.readbeyond.it/aeneas/) - [GitHub](https://github.com/readbeyond/aeneas/) - [PyPI](https://pypi.python.org/pypi/aeneas/) - [Docs](http://www.readbeyond.it/aeneas/docs/) - [Tutorial](http://www.readbeyond.it/aeneas/docs/clitutorial.html) - [Mailing List](https://groups.google.com/d/forum/aeneas-forced-alignment) - [Web App](http://aeneasweb.org)
11+
* Quick Links: [Home](http://www.readbeyond.it/aeneas/) - [GitHub](https://github.com/readbeyond/aeneas/) - [PyPI](https://pypi.python.org/pypi/aeneas/) - [Docs](http://www.readbeyond.it/aeneas/docs/) - [Tutorial](http://www.readbeyond.it/aeneas/docs/clitutorial.html) - [Benchmark](https://readbeyond.github.io/aeneas-benchmark/) - [Mailing List](https://groups.google.com/d/forum/aeneas-forced-alignment) - [Web App](http://aeneasweb.org)
1212

1313

1414
## Goal
@@ -206,10 +206,12 @@ which explains how to use the built-in command line tools.
206206
[https://groups.google.com/d/forum/aeneas-forced-alignment](https://groups.google.com/d/forum/aeneas-forced-alignment)
207207
* Changelog:
208208
[http://www.readbeyond.it/aeneas/docs/changelog.html](http://www.readbeyond.it/aeneas/docs/changelog.html)
209-
* High level description of how **aeneas** works:
209+
* High level description of how aeneas works:
210210
[HOWITWORKS](https://github.com/readbeyond/aeneas/blob/master/wiki/HOWITWORKS.md)
211211
* Development history:
212212
[HISTORY](https://github.com/readbeyond/aeneas/blob/master/wiki/HISTORY.md)
213+
* Benchmark suite:
214+
[https://readbeyond.github.io/aeneas-benchmark/](https://readbeyond.github.io/aeneas-benchmark/)
213215
214216
215217
## Supported Features

README.rst

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ aeneas
44
**aeneas** is a Python/C library and a set of tools to automagically
55
synchronize audio and text (aka forced alignment).
66

7-
- Version: 1.5.0
8-
- Date: 2016-04-02
7+
- Version: 1.5.0.2
8+
- Date: 2016-04-09
99
- Developed by: `ReadBeyond <http://www.readbeyond.it/>`__
1010
- Lead Developer: `Alberto Pettarin <http://www.albertopettarin.it/>`__
1111
- License: the GNU Affero General Public License Version 3 (AGPL v3)
@@ -15,7 +15,8 @@ synchronize audio and text (aka forced alignment).
1515
`PyPI <https://pypi.python.org/pypi/aeneas/>`__ -
1616
`Docs <http://www.readbeyond.it/aeneas/docs/>`__ -
1717
`Tutorial <http://www.readbeyond.it/aeneas/docs/clitutorial.html>`__
18-
- `Mailing
18+
- `Benchmark <https://readbeyond.github.io/aeneas-benchmark/>`__ -
19+
`Mailing
1920
List <https://groups.google.com/d/forum/aeneas-forced-alignment>`__ -
2021
`Web App <http://aeneasweb.org>`__
2122

@@ -208,10 +209,11 @@ Documentation and Support
208209
- Mailing list:
209210
https://groups.google.com/d/forum/aeneas-forced-alignment
210211
- Changelog: http://www.readbeyond.it/aeneas/docs/changelog.html
211-
- High level description of how **aeneas** works:
212+
- High level description of how aeneas works:
212213
`HOWITWORKS <https://github.com/readbeyond/aeneas/blob/master/wiki/HOWITWORKS.md>`__
213214
- Development history:
214215
`HISTORY <https://github.com/readbeyond/aeneas/blob/master/wiki/HISTORY.md>`__
216+
- Benchmark suite: https://readbeyond.github.io/aeneas-benchmark/
215217

216218
Supported Features
217219
------------------

aeneas/dtw.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,22 @@ def compute_boundaries(self, synt_anchors):
222222
# synt_anchors as in seconds, convert them in MFCC indices
223223
mws = self.rconf.mws
224224
anchor_indices = numpy.array([int(a[0] / mws) for a in synt_anchors])
225+
#
225226
# right side sets the split point at the very beginning of "next" fragment
226-
begin_indices = numpy.searchsorted(synt_indices, anchor_indices, side="right")
227+
#
228+
# NOTE clip() is needed since searchsorted() with side="right" might return
229+
# an index == len(synt_indices) == len(real_indices)
230+
# when the insertion point is past the last element of synt_indices
231+
# causing the fancy indexing real_indices[...] below might fail
232+
begin_indices = numpy.clip(numpy.searchsorted(synt_indices, anchor_indices, side="right"), 0, len(synt_indices)-1)
227233
# first split must occur at zero
228234
begin_indices[0] = 0
235+
#
229236
# map onto real indices, obtaining "default" boundary indices
237+
#
238+
# NOTE since len(synt_indices) == len(real_indices)
239+
# and because the numpy.clip() above, the fancy indexing is always valid
240+
#
230241
boundary_indices = numpy.append(real_indices[begin_indices], self.real_wave_mfcc.tail_begin)
231242
self.log([u"Boundary indices: %d", len(boundary_indices)])
232243
self.log(u"Computing boundary indices... done")

docs/source/changelog.rst

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
Changelog
22
=========
33

4+
v1.5.0.2 (2016-04-09)
5+
---------------------
6+
7+
#. Fix an issue in ``dtw`` with ``numpy.searchsorted`` returning an invalid index
8+
9+
v1.5.0.1 (2016-04-03)
10+
---------------------
11+
12+
#. Fix an issue with compiling C extensions on Windows
13+
414
v1.5.0 (2016-04-02)
515
-------------------
616

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"aeneas.extra": ["*.md"],
8787
"aeneas.tools": ["res/*", "*.md"]
8888
},
89-
version="1.5.0.1",
89+
version="1.5.0.2",
9090
description=SHORT_DESCRIPTION,
9191
author="Alberto Pettarin",
9292
author_email="[email protected]",

0 commit comments

Comments
 (0)