source: main/trunk/model-sites-dev/mars/collect/deam/MP3-TO-ESSENTIA-CVS-FEATURE-FILE.sh@ 34431

Last change on this file since 34431 was 34431, checked in by davidb, 4 years ago

Scripts to prepare the import folder area

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/bash
2
3audio_file=$1
4json_file=${audio_file%.*}.json
5csv_file=${audio_file%.*}.csv
6
7profile_file=`pwd`/essentia-2013-2014.profile
8
9# knock out any arrays in the JSON extracted features file
10ignore_fields="\
11 lowlevel.barkbands.* \
12 lowlevel.erbbands.* \
13 lowlevel.gfcc.* \
14 lowlevel.melbands.* \
15 lowlevel.melbands128.* \
16 lowlevel.mfcc.* \
17\
18 lowlevel.spectral_contrast_coeffs.* \
19 lowlevel.spectral_contrast_valleys.* \
20\
21 metadata.* \
22\
23 rhythm.beats_loudness_band_ratio.* \
24 rhythm.beats_position.* \
25 rhythm.bpm_histogram.* \
26\
27 tonal.hpcp.* \
28 tonal.chords_histogram.* \
29 tonal.thpcp.*"
30
31if [ ! -f $json_file ] ; then
32
33 echo "******"
34 echo "* Running Essentia music extractor"
35 echo "* on input file: $audio_file"
36 echo "* with profile: $profile_file"
37 echo "* generating output: $json_file"
38 echo "****"
39 essentia_streaming_extractor_music $audio_file $json_file $profile_file
40
41 echo "*"
42 echo "******"
43
44else
45 echo "* Skipping extraction of JSON features as $ofile already exists"
46fi
47
48if [ ! -f $csv_file ] ; then
49
50 echo "******"
51 echo "* Running Essentia JSON to CSV convertor on $json_file"
52
53 json_to_csv.py -i $json_file -o $csv_file --add-filename --ignore $ignore_fields
54 echo "******"
55else
56 echo "* Skipping JSON to CSV conversion as $ofile already exists"
57fi
58
59
60
Note: See TracBrowser for help on using the repository browser.