Skip to content

Instantly share code, notes, and snippets.

View sammlapp's full-sized avatar

Sam Lapp sammlapp

View GitHub Profile
"""this script extracts a measurement of sound pressure level from an audio file
specifically, it
(1) calculates a spectrogram
(2) subtracts a spectral noise profile based on the Nth percentile value of each spectrogram row
(3) calibrates the spectrogram to sound pressure level using a calibration curve from a csv file
(4) reconstructs a time series of rms values from the spectrogram
(5) extracts the maximum value of rms and converts to dB
"""
@sammlapp
sammlapp / inreach_setup.md
Created July 6, 2024 01:00
Syncing Garmin Inreach Mini 2 with messaging settings/presents
  • add contacts and choose recipients for "Check-In" messages at https://explore.garmin.com/Messages
  • on phone, install Garmin Explore app (The Garmin Messenger app allows you to send/receive messages when paired, but doesn't allow configuration)
  • on phone, turn on bluetooth and "allow new connections" if necessary
  • if not first time using InReach Mini, go to Menu -> Settings -> Phone -> pair (enters Pairning mode); then in Garmin Explore app, go to devices tab, click through screens to connect to your device
  • Messaging settings will now sync between website and device, can take a couple minutes
  • Check on handheld: menu, check in -> should see your check in presets. Selecting one shows contact list and message content.

Note: the Garmin Explore phone app is the only way to sync messages from the website to the handheld device, and the website is the only way to set up the message settings. Various instructions mention Garmin Messenger App, but at least for iPhone as

@sammlapp
sammlapp / outlook_to_google_cal_sync
Created January 19, 2024 21:27
Sync Outlook to Google Calendar
1. Open Outlook _in a browser_ not in the desktop app
2. Click the calendar icon on left, and find the calendar you want to sync on the left bar; click the menu (...)
3. Click sharing and permissions
4. Send invite to your Google email address
5. In the outlook pane, right click on the calendar's link and choose copy url
6. In Google calendar, in left pane next to "Other Calendars", click + and then "from URL"
7. Paste the URL
Building wheels for collected packages: antlr4-python3-runtime, lmdb, tokenizers
Building wheel for antlr4-python3-runtime (setup.py) ... done
Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.9.3-py3-none-any.whl size=144554 sha256=4592393736e0f23d96921e75beb495b156d5ef90144ed466ddfbfbc29d342b58
Stored in directory: /Users/SML161/Library/Caches/pip/wheels/12/93/dd/1f6a127edc45659556564c5730f6d4e300888f4bca2d4c5a88
Building wheel for lmdb (setup.py) ... done
Created wheel for lmdb: filename=lmdb-1.4.1-cp310-cp310-macosx_11_0_arm64.whl size=93571 sha256=c35657cea497e13b71ac47d3f7cbc918c37c8f83acc739baff46ec3c418be390
Stored in directory: /Users/SML161/Library/Caches/pip/wheels/e6/00/19/a038745f7b5c39772fad66e071042f5ecbefb215235c520e03
Building wheel for tokenizers (pyproject.toml) ... error
error: subprocess-exited-with-error

Use cases

Load, inspect, and manipulate audio files

``` from opensoundscape import Audio Audio.from_file('/path/audio.wav') ```

Head to the Audio tutorial notebook

@sammlapp
sammlapp / model_sharing_guidelines.md
Last active February 6, 2023 16:57
Sharing models trained in OpenSoundscape

Recommended steps for publicly sharing a model trained with OpenSoundscape

  • Uploading the saved model object to a public location such as Box, OneDrive, etc

    • Save the model object in two different ways to improve usability:

    (1) model.save() in OpenSoundscape to save the entire model object, which can be re-loaded only in the same version as OpenSoundscape

    (2) To enable use with other OpenSoundscape versions, save the weights dictionary and additional model information as a dictionary with torch.save. For instance:

set up raspberry pi

use Raspberry Pi imager on mac to install Raspberry Pi OS on a microSD card

  • use the advanced setup option to pre-configure ssh access and wifi

remote access to the GUI:

From mac terminal:

  • ssh into pi (ssh [email protected], then enter password)
  • install tightvnc: sudo apt update (this might take a while) then sudo apt install tightvncserver
  • start the VNC server (will need to be restarted on each reboot, but you only specify the password the first time): vncserver then enter a password (password has 8 character limit)
@sammlapp
sammlapp / machine_learning_hot_takes.md
Created December 16, 2021 20:17
Machine Learning: Hot Takes

Multi-target vs Single-Target models

aka Multi-label vs Single-label

img

Multi-target = "checkboxes": each option (class) can be chosen or not, independently of the others Single-target model = "radio buttons": choose one and only one of the options (classes)

@sammlapp
sammlapp / swallow_setup.md
Last active October 24, 2024 20:29
Setting up a Raspberry Pi 4.0 to use as a Swallow

Setting up a Raspberry Pi 4.0 to use as a Swallow

These instructions are a work in progress

Operating system

  • flash SD card with raspberry pi OS using Raspberry PI Imager application
  • can now use the set-up features to:
    • set the host-name (swallow-016, eg)
    • enter wifi credentials for a local wifi network.
    • enable SSH
  • set username ("pi" is good) and password (ask a lab member)
@sammlapp
sammlapp / bridges.md
Last active January 19, 2021 21:35
Using Bridges 2