dpwe / audfprint

Landmark-based audio fingerprinting
MIT License
538 stars 121 forks source link

Windows vs. LINUX #7

Open apiszcz opened 9 years ago

apiszcz commented 9 years ago

audfprint appears to be Linux focused.

  1. audfprint_match.py resource and the log method geared towards *NIX. Here is a possible option for this issue: (requires psutil), not sure why function names are different ..
import os,platform,psutil

def process_info():
    rss=usrtime=0
    p=psutil.Process(os.getpid())
    if platform.system().lower()=='windows':
        rss=p.memory_info()[0]
        usrtime=p.cpu_times()[0]
    elif platform.system().lower()=='linux':
        rss=p.get_memory_info()[0]
        usrtime=p.get_cpu_times()[0]
    return rss,usrtime

if __name__ == "__main__":
    print process_info()
  1. Initial review of the filelist from the glob specification on the command line appears to want a list of files returned.
  2. There appears to be a problem with full windows path names. C:\fullpath... using the --list mode helps.
apiszcz commented 9 years ago

audfprint.py DECIDED to use '--list' mode in which case windows file paths are supported.

apiszcz commented 9 years ago

audfprint_match.py * TMP\AUDFPRINT-MASTER\AUDFPRINT-MASTER\audfprint_match.py 13: # for checking phys mem size 14: import resource 15: # for localtest and illustrate * LIB\AUDFPRINT\AUDFPRINT_MATCH.PY 13: # for checking phys mem size 14: #import resource 15: # for localtest and illustrate


* TMP\AUDFPRINT-MASTER\AUDFPRINT-MASTER\audfprint_match.py 22: """ log info with stats """ 23: print time.ctime(), \ 24: "physmem=", resource.getrusage(resource.RUSAGE_SELF).ru_maxrss, \ 25: "utime=", resource.getrusage(resource.RUSAGE_SELF).ru_utime, \ 26: message 27: * LIB\AUDFPRINT\AUDFPRINT_MATCH.PY 22: """ log info with stats """ 23: print time.ctime(), message 24: #print time.ctime(), \ 25: # "physmem=", resource.getrusage(resource.RUSAGE_SELF).ru_maxrss, \ 26: # "utime=", resource.getrusage(resource.RUSAGE_SELF).ru_utime, \ 27: # message 28

dpwe commented 8 years ago

I actually do most development on MacOS, but that is much closer to Linux than Windows. I intend it to work unchanged on Linux, but I don't have access to a Windows machine. If there were simple way to support Windows without much noise, I'd be happy to accept a pull request.

apiszcz commented 8 years ago

Understand. Since there are only a few changes and they are captured in this issue note, at the moment it is probably more valuable to spend your energy other topics. If I had the time, a PR that would support Windows and LINUX would be the way to go.

Hellowlol commented 6 years ago

https://github.com/dpwe/audfprint/pull/33