MCPcopy Create free account
hub / github.com/MTG/essentia / descriptorPlotHTML

Function descriptorPlotHTML

src/python/essentia/plotting.py:49–80  ·  view source on GitHub ↗
(namespace, name, audio, pool, options)

Source from the content-addressed store, hash-verified

47
48
49def descriptorPlotHTML(namespace, name, audio, pool, options):
50
51 try:
52 # plot name
53 descName = namespace + '.' + name
54 # plot x data
55 scopes = pool.value(namespace + '.' + name + '.' + 'scope']
56 descScopes = []
57 for scope in scopes:
58 descScopes.append(scope[0])
59 # plot y data
60 descValues = pool.value(namespace + '.' + name)
61 # plotting
62 try:
63 figureName = descriptorPlot(descName, descScopes, descValues, pool, options)
64 htmlCode = '<img src ="' + figureName + '"/>'
65 except RuntimeError:
66 # special case: descriptors with more than one dimension (mfcc, barkbands, etc...)
67 htmlCode = ''
68 for i in range(len(descValues[0])):
69 descSubName = descName + '.' + str(i)
70 descSubValues = []
71 for value in descValues:
72 descSubValues.append(value[i])
73 figureName = descriptorPlot(descSubName, descScopes, descSubValues, pool, options)
74 htmlCode += '<img src ="' + figureName + '"/>'
75
76 except KeyError:
77 htmlCode = ''
78 print "WARNING: the descriptor", descName, "doesn't exist"
79
80 return htmlCode
81
82
83def namespace_comp(ns1, ns2):

Callers 1

computeFunction · 0.85

Calls 3

descriptorPlotFunction · 0.85
appendMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected