Gaia is a C++ library with python bindings which implements similarity measures and classifications on the results of audio analysis, and generates classification models that Essentia can use to compute high-level description of music.
Licence: Affero GPLv3 license
Documentation: http://essentia.upf.edu/documentation/gaia
Dependencies:
- Qt >= 4.5
- libYAML >= 0.1.1
- Python >= 2.4
- SWIG != 3.0.8
- waf >= 1.9
- Eigen 3.3.4 patched version (included in source)
-
All features work except
project_file.py
. Build with--with-cyclops
(forqt4)
works as before. Testing--with-cyclops --with-gaia-qt5
but it seems to function as before. -
With
python3
runningpython3 tests.py
Ran 91 tests in 61.252s
FAILED (failures=5, errors=36)
Unresolvedpython3
issues withselect
,enumerate
and filtering. Once implemented mostfailures
anderrors
will disappear. None of thesec++
code changes will be present in thegaia
until they work.After building documentation
build/src/bindings/gaia2.py
must have# -*- coding: utf-8 -*-
as first or second line. This is automatically handled. Switching frompython2
topython3
may requirebuild
folder to be removed. -
With
python2
runningpython2 tests.py
Ran 91 tests in 61.252s
FAILED (failures=5, errors=37)
Unresolvedpython2
issues. -
Install dependencies (Ubuntu/Debian)
$ apt-get install build-essential libqt4-dev libyaml-dev swig python-dev pkg-config doxygen
or for
Qt5
$ apt-get install build-essential qt5-default qtbase5-dev libyaml-dev swig python3-dev pkg-config doxygen
Note that
Gaia
build may fail if you are usingswig 3.0.8
. Install either a previous or later version. The newestswig
version is available from source(https://github.com/swig/swig)
.
-
Relase Notes:
Eigen 3.3.4
is provided with source code since one header file was missing from therelease
archive and forc++11
compatibility. PreviousEigen
had too many missing header orinclude
files for version certainty.#define Vector
was replaced bystd::vector
to eliminatec++11
errors. Location ofEigen
headers changed to3rdparty/Eigen
rather thanEigen. Waf2.0.6
is used primarily because it handlesQt5
and themoc
files required forcyclops
.libtbb-dev
can optionally be installed but the check fortbb
has been removed from the build process because it didn't work.Python2.7.15
andpython3.6.3
both have been tested. However, not all versions ofpython
have been used. Python packages are located at either/usr/local/lib/python2.7/dist-packages
or/usr/local/lib/python3.6/dist-packages
and utilize themajor
andminor
python
version numbers. Addendum: All tabs converted to spacesfind ./ -iname '*.h' -type f -exec bash -c 'expand -t 4 "$0" | sponge "$0"' {} \;
find ./ -iname '*.cpp' -type f -exec bash -c 'expand -t 4 "$0" | sponge "$0"' {} \;
find ./ -iname '*.py' -type f -exec bash -c 'expand -t 2 "$0" | sponge "$0"' {} \;
-
Online help is available for WAF or in build system home folder.
$ git clone https://github.com/waf-project/waf.git $ cd waf $ ./waf-light --help $ ./waf-light configure --tools=swig,qt5,qt4 build $ cp waf ~/gaia/.
-
Configure
gaia
with the desired options, ifpython3
wanted use$ python3 ./waf configure [--with-python] [--with-stlfacade] [--with-asserts] [--with-cyclops] [--with-tests] [--with-gaia-qt5]
NOTE: in order to link Essentia library with Gaia, do not use
--with-stlfacade
option -
Compile
libgaia.a
or_gaia2.so
:$ python3 ./waf
-
Install (to install system-wide you might need
sudo
)$ python3 ./waf install [--destdir=/where/ever/]
NOTE: be careful to use
python3
consistently as./waf install
on its own will use the defaultpython.
-
Build documentation (optional or online), it will be located at build/doc/ folder
$ python3 src/doc/regenerate_docstring.py
-
Install Qt4:
brew install cartr/qt4/qt
-
Install homebrew tap:
brew tap MTG/essentia
-
Build Gaia (this will also install all the dependencies)
brew install gaia --HEAD
-
Install python, qt libraries 4.8, libYAML and swig dependencies using homebrew:
$ brew install python --framework $ brew install swig libyaml cartr/qt4/qt
-
Install pyyaml pip package in case use want to build with python bindings:
$ pip install pyyaml
-
Configure and build similarly to Linux (see above).
(Gaia2lib)
-
install qt libraries 4.8 (including debug libraries) and QtCreator from http://qt-project.org/downloads
-
install libYAML and swig dependencies using homebrew (we assume you already have a python installation, otherwise you can also install it using homebrew):
$ brew install swig $ brew install libyaml
-
use QtCreator to open the project file 'Gaia2lib.pro' in packaging/darwin/Gaia2lib/
-
compile the project (you will probably need to configure QtCreator to work with your Qt installation and also to set up the build folder for the project)
(Gaia2Python - python bindings)
-
use swig to generate the file 'gaia_wrap.cxx' that will be needed to compile 'Gaia2Python':
$ swig -c++ -python -w451 /path_to_gaia_source/src/bindings/gaia.swig
-
copy the generated 'gaia_wrap.cxx' to the Gaia2Python project folder:
$ cp /path_to_gaia_source/src/bindings/gaia_wrap.cxx /path_to_gaia_source/packaging/darwin/Gaia2Python/
-
use QtCreator to open the project file 'Gaia2Python.pro' in packaging/darwin/Gaia2Python/ and compile
-
run ./make_release_tarball in packaging/darwin:
$ ./make_release_tarball
-
copy the folder packaging/darwin/tmp/gaia2/python/gaia2 (created when running make_release_tarball.sh) to the site-packages directory of your python distribution. you can now import gaia2 from python
- use the QtCreator projects inside the packaging/win32 directory (not tested).
- using
msys64
andmingw64_shell.bat
partially works but is currently not available and untested.
This library contains source code from the LibSVM project, which is distributed under the revised BSD license. Please refer to the src/3rdparty/libsvm/COPYRIGHT file for more information.
This library contains the Mersenne Twister random number generator, which is distributed under the BSD license.
This library contains source code from the Alglib project (http://www.alglib.net), which is distributed under the 3-clause BSD license.
This library contains source code from the Eigen project (http://eigen.tuxfamily.org/), which is distributed under the LGPLv3 license.
Cyclops for Qt5 contains source code from the Qt project deprecated APIs which have been removed from Qt (https://github.com/qt/qthttp), which is distributed under the terms specified under GNU GPLv3 license. These have been heavily reorder to eliminate compile errors.
This library contains source code from FrogLogic command line parser (http://www.froglogic.com/pg?id=PublicationsFreeware&category=getopt) which is distributed under the BSD license.