Skip to content

Instantly share code, notes, and snippets.

View loretoparisi's full-sized avatar
🐍
NightShift

Loreto Parisi loretoparisi

🐍
NightShift
View GitHub Profile
@loretoparisi
loretoparisi / REPRO_CONDA_SETUP.md
Created August 25, 2022 22:09 — forked from lmmx/REPRO_CONDA_SETUP.md
Demo of Stable Diffusion usage, storing the prompt in metadata https://twitter.com/permutans/status/1562471438501548034
@loretoparisi
loretoparisi / stablediffusionwalk.py
Created August 25, 2022 10:49 — forked from karpathy/stablediffusionwalk.py
hacky stablediffusion code for generating videos
"""
stable diffusion dreaming
creates hypnotic moving videos by smoothly walking randomly through the sample space
example way to run this script:
$ python stablediffusionwalk.py --prompt "blueberry spaghetti" --name blueberry
to stitch together the images, e.g.:
$ ffmpeg -r 10 -f image2 -s 512x512 -i blueberry/frame%06d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p blueberry.mp4
@loretoparisi
loretoparisi / index.html
Created November 19, 2021 22:53 — forked from Lakerfield/index.html
Print ZPL from browser
<!DOCTYPE html>
<html>
<head>
<title>Print Inventory Labels at Papa's</title>
<style>
* {
box-sizing: border-box;
}
@loretoparisi
loretoparisi / stripJSON.js
Created April 22, 2021 15:32 — forked from usmansbk/stripJSON.js
Recursively remove json keys in an array
/**
* @function stripJSON
* @desc - This function removes selected object keys
* @param {Object} json - JavaScript object to strip
* @param {Object[]} keys - array of selected keys (string)
* @return {Object} - deep copy of object without keys
*/
function stripJSON(json, keys) {
if (json === null || json === undefined) return json;
let obj = {}, key;
@loretoparisi
loretoparisi / test.js
Created October 2, 2020 16:21
TFJS Test for EfficientDet Models
const fs = require('fs');
const path = require('path');
const log = require('@vladmandic/pilogger');
const tf = require('@tensorflow/tfjs');
const tfnode = require('@tensorflow/tfjs-node');
function getTensorFromImage(path) {
if (!fs.existsSync(path)) return null;
const data = fs.readFileSync(path);
const tfimage = tfnode.node.decodeImage(data);
@loretoparisi
loretoparisi / ec2instances.md
Created April 10, 2020 16:30 — forked from julien-c/ec2instances.md
simple markdown table of AWS instance types with vCPU/RAM/price (us-east-1)
API Name Memory vCPUs Physical Processor Network Performance Linux On Demand cost Linux Reserved cost
a1.2xlarge 16.0 GiB 8 vCPUs AWS Graviton Processor Up to 10 Gigabit $148.92 monthly $93.80 monthly
a1.4xlarge 32.0 GiB 16 vCPUs AWS Graviton Processor Up to 10 Gigabit $297.84 monthly $187.61 monthly
a1.large 4.0 GiB 2 vCPUs AWS Graviton Processor Up to 10 Gigabit $37.23 monthly $23.43 monthly
a1.medium 2.0 GiB 1 vCPUs AWS Graviton Processor Up to 10 Gigabit $18.61 monthly $11.75 monthly
a1.metal 32.0 GiB 16 vCPUs AWS Graviton Processor Up to 10 Gigabit $297.84 monthly $187.61 monthly
a1.xlarge 8.0 GiB 4 vCPUs AWS Graviton Processor Up to 10 Gigabit $74.46 monthly $46.93 monthly
c1.medium 1.7 GiB 2 vCPUs Intel Xeon Family Moderate $94.90 monthly $66.43 monthly
@loretoparisi
loretoparisi / mixout.py
Created January 10, 2020 20:22 — forked from stephenroller/mixout.py
Example of mixout on generic modules.
#!/usr/bin/env python3
"""
Example of a generic Mixout implementation. (Lee et al., 2019).
https://arxiv.org/abs/1909.11299
Implementation by Stephen Roller (https://stephenroller.com).
Example output:
@loretoparisi
loretoparisi / mixout.py
Created January 10, 2020 20:22 — forked from stephenroller/mixout.py
Example of mixout on generic modules.
#!/usr/bin/env python3
"""
Example of a generic Mixout implementation. (Lee et al., 2019).
https://arxiv.org/abs/1909.11299
Implementation by Stephen Roller (https://stephenroller.com).
Example output:
<?php
/*
Plugin Name: Custom Registration Fields
Plugin URI:
Description:
Version: 0.1
Author: CSSIgniter
Author URI:
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@loretoparisi
loretoparisi / get_available_gpus.py
Created April 16, 2018 15:56 — forked from jovianlin/get_available_gpus.py
Get List of Devices in TensorFlow
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
get_available_gpus()