Coder Social home page Coder Social logo

ftis's Introduction

ftis - finding things in stuff

ftis is a framework for data manipulation, management, creation and munging in Python 3.8+. It is designed for creative use, mainly for my own preoccupations with segmenting, analysing, organising, discovering structure within, and composing with audio corpora.

Architecture

The overall architecture can be conceived in two parts; 'analysers' and 'worlds'. A ftis 'world' can house any number of 'analysers' that can be chained and connected in different ways. A python script can house any number of worlds and therefore you can compose multiple processes. Inside of a world, ftis makes connections between a source, the analysers and an output (known as the sink).

Installation

You can install ftis using pip install ftis. This will pull down the necessary dependencies so that all of the analysers that ship with ftis work straight away.

You can also fork this repository and clone it to your machine.

Workflow

The simplest setup is to have a virtual environment setup with ftis installed as a module. cd to the clone of your fork of ftis and enter the module (the directory containing setup.py). Once there run pip install -e . to install ftis to your activated virtual environment. Once you've designed your script you can easily run it with python mycoolscript.py. Of course if you have used pip to install ftis then none of the previous advice applies.

There are some good examples of scripts in the examples directory of this repository. Otherwise the basic structure looks like this:

# import ftis modules that we need
from ftis.analyser.slicing import FluidNoveltyslice # novelty slicing
from ftis.world import World # a ftis 'world'
from ftis.corpus import Corpus # a corpus object

src = Corpus("~/corpus-folder/corpus1") # corpus object collects audio files at this directory
out = "~/corpus-folder/slicing" # set an output folder

# instantiate an instance of the process
world = World(sink=out)

# Connect together processes using >>
src >> FluidNoveltySlice(threshold=0.35, feature=1) >> ExplodeAudio()

# now add a Corpus node to our world
world.build(src)

if __name__ == "__main__":
    world.run() # finally run the chain of connected analysers

and thats it! For more information read the full documentation.

Contributing

If you feel up to contributing plumbing code or your own analysers please feel free to do via github.

  1. Fork this repository
  2. Checkout a branch with your new feature
  3. Implement feature
  4. Make a pull request!

ftis's People

Contributors

jamesb93 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

tinpark heretogo

ftis's Issues

clusteredSegmentation is broken

commit f294596

trying it with a valid file, works for the FluidNoveltySlice but then aborts:

Traceback (most recent call last):
File "clustered_segmentation.py", line 21, in
w.run()
File "/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/ftis/ftis/ftis/world.py", line 109, in run
c.walk_chain()
File "/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/ftis/ftis/ftis/corpus.py", line 47, in walk_chain
forward_connection.walk_chain()
File "/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/ftis/ftis/ftis/common/analyser.py", line 167, in walk_chain
forward_connection.walk_chain()
File "/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/ftis/ftis/ftis/common/analyser.py", line 151, in walk_chain
self.run()
File "/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/ftis/ftis/ftis/analyser/meta.py", line 144, in run
singleproc(self.name, self.analyse, self.input)
File "/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/ftis/ftis/ftis/common/proc.py", line 28, in singleproc
process(x)
File "/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/ftis/ftis/ftis/analyser/meta.py", line 116, in analyse
mfccs = fluid.mfcc(
File "/Users/pa/anaconda/envs/ftis4dummies/lib/python3.8/site-packages/flucoma/fluid.py", line 469, in mfcc
fftsettings = fftsanitise(fftsettings)
File "/Users/pa/anaconda/envs/ftis4dummies/lib/python3.8/site-packages/flucoma/utils.py", line 15, in fftsanitise
int(fftsettings[2])
IndexError: list index out of range

Couple of issues with the code on the readme.md

Hi James, this is totally brilliant set of tools and fantastically helpful. Thanks for sharing it. I was just getting going and fell when using the example on the readme.md page, a few bits and pieces missing from the imports and a typo in the fluid name, easy to fix, but might slow a newbie like me down... :). This works for me, with obviously, swapping the paths to src and corpus. Hope it's all going well.

# import ftis modules that we need
from ftis.analyser.slicing import FluidNoveltyslice # novelty slicing
from ftis.world import World # a ftis 'world'
from ftis.corpus import Corpus # a corpus object
from ftis.analyser.audio import ExplodeAudio, CollapseAudio

src = Corpus("~/corpus-folder/corpus1") # corpus object collects audio files at this directory
out = "~/corpus-folder/slicing" # set an output folder

# instantiate an instance of the process
world = World(sink=out)

# Connect together processes using >>
src >> FluidNoveltyslice(threshold=0.35, feature=1) >> ExplodeAudio()

# now add a Corpus node to our world
world.build(src)

if __name__ == "__main__":
    world.run() # finally run the chain of connected analysers

ftis.common.exceptions.EmptyWorkables: No workables were passed to the proc

When trying to run 1_slicing.py I'm getting this error on Windows, WSL2 as well as Ubuntu.

Traceback (most recent call last):
  File "/home/robin/ftis/examples/1_slicing.py", line 53, in <module>
    world.run()
  File "/home/robin/.local/lib/python3.10/site-packages/ftis/world.py", line 110, in run
    c.walk_chain()
  File "/home/robin/.local/lib/python3.10/site-packages/ftis/corpus.py", line 52, in walk_chain
    forward_connection.walk_chain()
  File "/home/robin/.local/lib/python3.10/site-packages/ftis/common/analyser.py", line 127, in walk_chain
    forward_connection.walk_chain()
  File "/home/robin/.local/lib/python3.10/site-packages/ftis/common/analyser.py", line 110, in walk_chain
    self.run()
  File "/home/robin/.local/lib/python3.10/site-packages/ftis/analyser/audio.py", line 70, in run
    singleproc(self.name, self.segment, self.input)
  File "/home/robin/.local/lib/python3.10/site-packages/ftis/common/proc.py", line 22, in singleproc
    raise EmptyWorkables
ftis.common.exceptions.EmptyWorkables: No workables were passed to the proc


EDIT: this is on the branch 'trunk' - turns out that switching to 'main' fixed the issue!

create parallel stages

you should be able to create parallel stages.

Something like:

stage: 1

stage: 1

stage: 2

to create compound outputs. These would be processed by the next phase accordingly.

run
  |      \
 1a     1b
  |      /
 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.