Skip to content

Commit

Permalink
Merge pull request dpwe#33 from Hellowlol/windows_support
Browse files Browse the repository at this point in the history
Fixup for windows support as the resouces module does not exist for windows.
  • Loading branch information
dpwe authored Mar 26, 2018
2 parents 507acd4 + f5d5d1c commit e24de89
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,8 @@ Options:
--help Print this message
```

Uses librosa, get https://github.com/bmcfee/librosa or "pip install librosa"

Uses docopt, see http://docopt.org , get https://github.com/docopt/docopt or "pip install docopt"

Also uses numpy and scipy, which need to be installed, e.g. "pip install numpy", "pip install scipy".

Parallel processing relies on joblib module (and multiprocessing module), which are likely already installed.
audfprint require some packages You can install them with.
```pip install -r requirements.txt```

This version uses `ffmpeg` to read input files. You must have a working `ffmpeg` binary in your path (try `ffmpeg -V` at the command prompt).

Expand Down
23 changes: 16 additions & 7 deletions audfprint_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,34 @@
2014-05-26 Dan Ellis [email protected]
"""
from __future__ import division, print_function

import resource # for checking phys mem size
import os
import time

import librosa
import psutil
import matplotlib.pyplot as plt
import librosa
import numpy as np
import scipy.signal

import audfprint_analyze # for localtest and illustrate
import audio_read


def process_info():
rss = usrtime = 0
p = psutil.Process(os.getpid())
if os.name == 'nt':
rss = p.memory_info()[0]
usrtime = p.cpu_times()[0]
else:
rss = p.get_memory_info()[0]
usrtime = p.get_cpu_times()[0]
return rss, usrtime


def log(message):
""" log info with stats """
print(time.ctime(),
"physmem=", resource.getrusage(resource.RUSAGE_SELF).ru_maxrss,
"utime=", resource.getrusage(resource.RUSAGE_SELF).ru_utime,
message)
print('%s physmem=%s utime=%s %s' % (time.ctime(), process_info()))


def encpowerof2(val):
Expand Down
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
librosa
numpy
scipy
docopt
joblib
psutil

0 comments on commit e24de89

Please sign in to comment.