import jinja2 """ Give me a crude 3 cluster output of all of the 'static' files. Later on we'll find other files similar to these. We can use both bits of information to help compose. """ output = "../../reaper/Convolutions/base_materials" em = Corpus("~/Cloud/Projects/ElectroMagnetic/outputs/classification/4_Split/1") analysis = Chain( source = (em), folder = output ) dr = UMAP(components=10, cache=1) clustering = AgglomerativeClustering(numclusters=3) analysis.add( FluidMFCC(discard=True, numcoeffs=20, fftsettings=[2048, -1, -1], cache=1), Stats(numderivs=1, flatten=True, cache=1), Standardise(cache=1), dr, clustering ) if __name__ == "__main__": analysis.run() tracks = {} for cluster, items in clustering.output.items(): track_id = cluster
"/Users/james/Cloud/Projects/ElectroMagnetic/reaper/Convolutions/anchors/media/07-glued.wav" ) db = (Corpus("~/Cloud/Projects/DataBending/DataAudioUnique").duration( min_duration=2, max_duration=20)) unstatic = Corpus( "~/Cloud/Projects/ElectroMagnetic/outputs/classification/4_Split/0") static = Corpus( "~/Cloud/Projects/ElectroMagnetic/outputs/classification/4_Split/1") output = "../../reaper/Convolutions/tuned" analysis = Chain(source=(db + tuned + unstatic + static), folder=output) kdtree = KDTree() dr = UMAP(components=10, cache=1) # we need access to the original data analysis.add( # FluidMFCC(discard=True, numcoeffs=20, fftsettings=[4096, -1, -1], cache=1), LibroCQT(cache=0), Stats(numderivs=1, flatten=True, cache=1), Standardise(cache=1), dr, kdtree) if __name__ == "__main__": analysis.run() pinpoint = tuned.items[0] # single item x = dr.output[pinpoint] dist, ind = kdtree.model.query([x], k=200) keys = [x for x in dr.output.keys()]
from ftis.analyser.descriptor import FluidMFCC from ftis.analyser.scaling import Standardise from ftis.analyser.dr import UMAP from ftis.analyser.clustering import HDBSCAN from ftis.analyser.stats import Stats from ftis.process import FTISProcess as Chain from ftis.corpus import Corpus db_corpus = (Corpus("~/Cloud/Projects/DataBending/DataAudioUnique").duration( min_duration=0.03)) em_corpus = (Corpus("../outputs/em_detailed_segmentation/1_ExplodeAudio")) analysis = Chain(source=db_corpus + em_corpus, folder="../outputs/multicorpus_exploring") analysis.add( FluidMFCC(discard=True, numcoeffs=20, fftsettings=[2048, -1, -1], cache=1), Stats(numderivs=1, flatten=True, cache=1), Standardise(), UMAP(components=2), HDBSCAN(minclustersize=5)) if __name__ == "__main__": analysis.run()