This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import mathutils as mu | |
import bmesh | |
import bpy | |
ndir = "F:\ml\motion-diffusion-model\save\humanml_trans_enc_512\samples_humanml_trans_enc_512_000200000_seed10\\results.npy" | |
data = np.load(ndir, allow_pickle=True) | |
motions = data[()]['motion'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo %* | |
@echo off | |
magick %* input.jpg | |
F:\apps\esrgan\realesrgan-ncnn-vulkan.exe -i input.jpg -o esr_output.jpg -n realesrgan-x4plus | |
magick esr_output.jpg -scale 50%% esr\\%~n1.jpg | |
del input.jpg | |
del esr_output.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from pathlib import Path | |
#selo = bpy.context.selected_objects | |
#assert len(selo) > 0, "Need to select the camera root" | |
#mroot = selo[0] | |
#assert mroot.name == "mvgRoot" | |
mroot = bpy.data.objects['mvgRoot'] | |
image_folder = Path("D:\\art\\photo\\2022.6\\16") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OTFFT library | |
# http://wwwa.pikara.ne.jp/okojisan/otfft-en/optimization1.html | |
# This is +20-50% improvement | |
const thetaLutSize = 2048 | |
const thetaLut = static: | |
var arr: array[thetaLutSize, Complex[float]] | |
let step = 2.0*PI/float(thetaLutSize) | |
for k, v in mpairs(arr): | |
v = complex(cos(step * float(k)), -sin(step * float(k))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streams, std/base64, std/strformat | |
type | |
WavFile* = object | |
data*: seq[uint8] | |
size*: int | |
freq*: int | |
bits*: int | |
channels*: int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://news.ycombinator.com/item?id=26746537 | |
godmode2019 3 hours ago [–] | |
I think everyone was a txt file on their computer filled with FFmpeg commands. | |
Care to share yours? | |
stevens37 0 minutes ago [–] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mido import MidiFile | |
import mido | |
from collections import defaultdict | |
import time | |
import sys | |
filename = "Space Harrier.mid" | |
# filename = "Shovel.mid" | |
if len(sys.argv) == 2: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
for i in range(16): | |
print( | |
f"@{(i*16):08x} " | |
+ " ".join(f"{int(-math.cos((j+i*16)*math.pi*2/255)*127.1+128):02x}" for j in range(16)) | |
) | |
# for Xilinx Vivado FPGA purposes | |
# sin_table.mem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# l.py - A tiny interpreter for a lisp-like language with full | |
# lexical closures in Python | |
# | |
# Written by Ron Garret. Contributed to the public domain | |
# The global environment | |
# modification 2021 ambi, also public domain | |
globalenv = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
https://bottosson.github.io/posts/oklab/ | |
Lab | |
L=lightness | |
a=green/red | |
b=blue/yellow | |
Lab to lightness, chroma, hue (LCh) | |
C=sqrt(a**2+b**2) |