Skip to content

Instantly share code, notes, and snippets.

Avatar

josephrocca

View GitHub Profile
View webm-writer2-fixed.js
// This is a version of this file: https://w3c.github.io/webcodecs/samples/capture-to-file/webm-writer2.js
// With these fixed applied: https://github.com/w3c/webcodecs/issues/332#issuecomment-1077442192
/**
* A tool for presenting an ArrayBuffer as a stream for writing some simple data
* types.
*
* By Nicholas Sherlock, with updates from jimbankoski
*
* - make it work off frames with timestamps from webcodecs
@josephrocca
josephrocca / createCanvasFromRGBAData.js
Created December 1, 2022 10:52
RGBA data to canvas - create a canvas from RGB data
View createCanvasFromRGBAData.js
function createCanvasFromRGBAData(data, width, height) {
// `data` should look something like [[123,32,40,255], [3,233,42,120], ...]
if(width*height !== data.length) throw new Error("width*height should equal data.length");
let canvas = document.createElement("canvas");
canvas.width = width;
canvas.height = height;
let ctx = canvas.getContext("2d");
let imgData = ctx.createImageData(width, height);
for(let i = 0; i < data.length; i++) {
imgData.data[i*4+0] = data[i][0];
@josephrocca
josephrocca / notebook.ipynb
Last active November 14, 2022 00:49
lyra-v2-soundstream split quantizer into its two subgraphs.ipynb
View notebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@josephrocca
josephrocca / onnx-runtime-python-inference.ipynb
Last active October 30, 2022 16:53
onnx-runtime-python-inference.ipynb
View onnx-runtime-python-inference.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@josephrocca
josephrocca / aaa_usage.js
Created October 29, 2022 07:33
AWS S3 (v3) working in Deno
View aaa_usage.js
import * as AWS from "./aws_sdk_client_s3_v3.198.0-es.js";
let s3 = new AWS.S3({
region: "YOUR_REGION",
endpoint: "YOUR_ENDPOINT_URL_IF_NECCESSARY",
credentials: {
accessKeyId: "YOUR_ACCESS_KEY",
secretAccessKey: "YOUR_SECRET",
},
});
@josephrocca
josephrocca / notebook.ipynb
Last active November 28, 2022 10:37
jax2tf2onnx - jax.lax.switch with functions.ipynb
View notebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@josephrocca
josephrocca / stable_diffusion_jax-to-onnx.ipynb
Last active October 20, 2022 14:42
stable_diffusion_jax-to-onnx - scheduler_loop_body.ipynb
View stable_diffusion_jax-to-onnx.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@josephrocca
josephrocca / notebook.ipynb
Last active October 20, 2022 12:10
lyra-v2-soundstream-tflite-to-onnx.ipynb
View notebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@josephrocca
josephrocca / notebook.ipynb
Last active November 19, 2022 01:22
lyra-v2-soundstream-tflite-to-onnx.ipynb
View notebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@josephrocca
josephrocca / stable_diffusion_jax-to-onnx.ipynb
Last active October 18, 2022 19:17
stable_diffusion_jax-to-tflite --- decode_latents.ipynb
View stable_diffusion_jax-to-onnx.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.