changes to clips and predict

quietlight
Aug 29, 2024, 4:19 AM
JYCKLP2EZJHX7QWMGN6TZZLRXOG7A4LUO64X2ORWDMSJX7LM7XIQC

Dependencies

  • [2] MMG2PLXK new functiion to make clips of downloaded bisd calls
  • [3] NMQCXLNG catch up commit, about to do some work on prediction loop
  • [4] 2UBDFCJH new files tracked
  • [5] NV7FXZ5Q first commit
  • [6] RBXUHIO2 made somn small changes and reverted them mostly
  • [7] ROFI4OLA catch up, working on colour images

Change contents

  • edit in src/Predict.jl at line 262
    [3.373990]
    [3.373990]
    # Python 3.8.12, opensoundscape 0.7.1
  • replacement in src/Predict.jl at line 296
    [3.374910][2.474:558](),[2.558][3.374994:375016](),[3.586][3.374994:375016](),[3.374994][3.374994:375016]()
    scores.to_csv("scores-2024-08-04.csv")
    preds.to_csv("preds-2024-08-04.csv")
    os.chdir('../..')
    [3.374910]
    [3.375016]
    scores.to_csv("scores-2024-08-29.csv")
    preds.to_csv("preds-2024-08-29.csv")
    os.chdir('../..') # Be careful this matches the glob on line 284
  • edit in src/Clips.jl at line 308
    [3.22022]
    [3.22022]
    end
    end
    end
    # Convert mp3's with: for file in *.mp3; do ffmpeg -i "${file}" -ar 16000 "${file%.*}.wav"; done
    # Requires 16000hz wav's, works in current folder, need ffmpeg to convert mp3's to wavs at 16000hz
    #=
    wavs = glob("*.wav")
    for wav in wavs
    Skraak.make_spectro_from_file(wav)
    end
    =#
    function make_spectro_from_file(file::String)
    signal, freq = wavread("$file")
    freq = freq |> Float32
    partitioned_signal = Iterators.partition(signal, 80000) #5s clips
    for (index, part) in enumerate(partitioned_signal)
    length(part) > 50000 && begin
    outfile = "$(chop(file, head=0, tail=4))__$(index)"
    image = get_image_from_sample(part, freq)
    PNGFiles.save("$outfile.png", image)
  • replacement in src/Clips.jl at line 335
    [3.16][3.16:72]()
    For making colour images, not wired up into skraak yet.
    [3.16]
    [3.72]
    For making colour images using GLMakie (moved on but may be useful one day), not wired up into skraak yet.
  • replacement in src/Clips.jl at line 358
    [3.709][2.1269:1913]()
    =#
    # Convert mp3's with: for file in *.mp3; do ffmpeg -i "${file}" -ar 16000 "${file%.*}.wav"; done
    # Requires 16000hz wav's, works in current folder
    #=
    wavs = glob("*.wav")
    for wav in wavs
    Skraak.make_spectro_from_sample(wav)
    end
    =#
    function make_spectro_from_sample(file::String)
    signal, freq = wavread("$file")
    freq = freq |> Float32
    partitioned_signal = Iterators.partition(signal, 80000) #5s clips
    for (index, part) in enumerate(partitioned_signal)
    outfile = "$(index)__$(chop(file, head=0, tail=4))"
    image = get_image_from_sample(part, freq)
    PNGFiles.save("$outfile.png", image)
    end
    end
    [3.709]
    =#