def evaluateModels(extractor, resultsDir):
    if not isExecutable(extractor):
        print '%s does not seem to be an executable extractor... Exiting...' % extractor
        sys.exit(1)

    makedir(resultsDir)

    collections_file = join(gaia2.rootdir(), 'mtgdb', 'mtgdb_collections.yaml')
    collections = [c['name'] for c in yaml.load(open(collections_file))]

    # do all the evaluations
    for collection in collections:
        evaluateCollection(collection, extractor, resultsDir)

    # print a report of the evaluations
    for collection in collections:
        checkErrors(collection, resultsDir)
def evaluateModels(extractor, resultsDir):
    if not isExecutable(extractor):
        print '%s does not seem to be an executable extractor... Exiting...' % extractor
        sys.exit(1)

    makedir(resultsDir)

    collections_file = join(gaia2.rootdir(), 'mtgdb', 'mtgdb_collections.yaml')
    collections = [ c['name'] for c in yaml.load(open(collections_file)) ]

    # do all the evaluations
    for collection in collections:
        evaluateCollection(collection, extractor, resultsDir)

    # print a report of the evaluations
    for collection in collections:
        checkErrors(collection, resultsDir)
# Gaia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation (FSF), either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the Affero GNU General Public License     
# version 3 along with this program. If not, see http://www.gnu.org/licenses/



import os, sys, subprocess, yaml
from os.path import *
from gaia2.mtgdb.environment import MTGDB_AUDIO
import gaia2


if __name__ == '__main__':
    collections_file = join(gaia2.rootdir(), 'mtgdb', 'mtgdb_collections.yaml')

    for db in yaml.load(open(collections_file).read()):
        cmd = [ 'python', join(split(__file__)[0], 'validate_collection.py'), join(MTGDB_AUDIO, db['location']) ]

        subprocess.call(cmd)

        print '\n'