Skip to content

Instantly share code, notes, and snippets.

View scottire's full-sized avatar

Scott Condron scottire

View GitHub Profile
@scottire
scottire / gist:d5e4bb0bc8161719bf47688e917240b0
Created August 2, 2017 13:14
Install nvm and node on an OSX circleci build
machine:
timezone:
America/Los_Angeles
xcode:
version: "9.0"
#manually installing node
environment:
dependencies:
pre:
@scottire
scottire / HID TEST
Last active August 4, 2017 13:07
HID POST
import 'rxjs/add/operator/map';
import { Events } from 'ionic-angular'
import { getHidParamsFromUrl } from '../lib/utils'
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Headers } from '@angular/http';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/toPromise';
/*
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
import scipy.io as sio
import numpy as np
import os
import gc
import six.moves.urllib as urllib
import cv2
import time
import xml.etree.cElementTree as ET
import random
import shutil as sh
@scottire
scottire / link_audio_jupyter_wavesurfer.py
Last active June 1, 2020 12:59
Link timestamp from wavesurfer.js Audio visualisation to ipywidget slider using jp_proxy_widget
@scottire
scottire / ipywidgets_audio_plot.py
Last active June 1, 2020 15:59
Interactive Audio Plot using ipywidgets within Jupyter Notebook (not yet working with Jupyter Lab, see comments)
from ipywidgets import IntSlider, ToggleButton, Text
from IPython.display import display, Audio, Javascript
from scipy.io import wavfile
import numpy as np
from matplotlib import pyplot as plt
import ipywidgets
t = Text(value='0',
description='Elapsed Time:',
style = {'description_width': 'initial'},
@scottire
scottire / tconv.py
Last active June 15, 2021 11:48
PyTorch TransposeConvolution1d written in numpy
import numpy as np
import torch
import torch.nn as nn
import numpy as np
import panel as pn
from ipywidgets import widgets
from ipywidgets import interact, interactive, fixed, interact_manual
from IPython.display import display
import holoviews as hv
# --------------------------------------------------------
# Camera sample code for Tegra X2/X1
#
# This program could capture and display video from
# IP CAM, USB webcam, or the Tegra onboard camera.
# Refer to the following blog post for how to set up
# and run the code:
# https://jkjung-avt.github.io/tx2-camera-with-python/
#
# Written by JK Jung <jkjung13@gmail.com>
@scottire
scottire / sweeps_quickstart.py
Last active November 30, 2022 09:38
Get started tuning hyperparameters with W&B quickly
import wandb
# 1: Define objective/training function
def objective(config):
score = config.x ** 3 + config.y
return score
def main():
wandb.init(project='my-first-sweep')
score = objective(wandb.config)
@scottire
scottire / interactive_audio_plots.py
Last active March 11, 2023 10:42
Interactive and clickable plots using Panel, Holoviz and Bokeh in Jupyter Notebooks
import numpy as np
import panel as pn
import holoviews as hv
hv.extension("bokeh")
# hv.extension('matplotlib')
from holoviews.streams import Stream, Params
from scipy.io import wavfile
from scipy.signal import spectrogram
rate, data = wavfile.read('/filepath.wav')