Skip to content

Instantly share code, notes, and snippets.

import numpy as np
import functools
import vapoursynth as vs
import random
from vapoursynth import core
mscale = 1
pad = 32
#Makes a horizontal or vertical grayscale, FP32 gradient ramp VS clip
#White is on the right/bottom, black is on the left/top
@AlphaAtlas
AlphaAtlas / Preview
Last active November 16, 2019 03:09
import mvsfunc as mvs
import vapoursynth as vs
from vapoursynth as core
import mvsfunc as mvf
from glob import glob
smallimagenames = glob.glob("some path to glob")
bigimagenames = glob.glob("some other path to glob")
if len(input1) != len(input2):
raise Exception("Input folders don't have the same number of images!")
#Run on https://colab.research.google.com/ for free!
import os, tempfile, shutil, sys
%cd /
#mount gdrive
googpath = os.path.abspath(os.path.join("gdrive", "My Drive"))
if not os.path.isdir(googpath):
from google.colab import drive
drive.mount('/gdrive')
#!/bin/bash -c "$(curl -sL https://git.io/vokNn)"
!sudo dpkg --add-architecture i386
@AlphaAtlas
AlphaAtlas / Scale.vpy
Created November 13, 2019 18:53
PNG Scaling
#Downscale it with the highest possible quality, and write the full frame and image to disk
#Can run wit this: https://github.com/theChaosCoder/vapoursynth-portable-FATPACK/releases/\
import mvsfunc as mvf
import muvsfunc as muf
import xvs as xvs
import vapoursynth as vs
from vapoursynth import core
@AlphaAtlas
AlphaAtlas / ME1Auto.vpy
Last active November 10, 2019 21:50
Example ME1 Upscaling Script
#Import stuff here. Comment out what you don't need.
#import mxnet as mx
import mvsfunc as mvf
import muvsfunc as muf
import Alpha_VSFunctions as avsfunc
#import fvsfunc as fvf
import havsfunc as haf
import G41Fun as G41
#import lostfunc as lof
#import kagefunc as kage
@AlphaAtlas
AlphaAtlas / GetTrainingImages.vpy
Last active November 1, 2021 12:09
Grabs 1 frame from each scene in a list of videos, downscales them using CUDA or SSIM_downsample, writes images to disk. Useful for getting training data!
#Grabs 1 frame from each detected scene in a list of videos
#Downscale it with the highest possible quality, and write the full frame and image to disk
#Useful for getting training data from videos!
#Requires python, vapoursynth, muvsfunc, and mvsfunc, knlmeans, dpid, mvtools
#Or better yet, just unzip this: https://github.com/theChaosCoder/vapoursynth-portable-FATPACK/releases/tag/r2
#Just benchmark this script under the script tab in VSEdit.
#Or run 'vspipe "Path/To/NameOfScript.vpy" .'
import mvsfunc as mvf
// ----------------------------------------------------------------------
// These are basic usings. Always let them be here.
// ----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// ----------------------------------------------------------------------
// These are RimWorld-specific usings. Activate/Deactivate what you need:
Initialize engine version: 5.6.5f1 (2cac56bf7bb6)
Forcing GfxDevice: Null
NullGfxDevice:
Version: NULL 1.0 [1.0]
Renderer: Null Device
Vendor: Unity Technologies
Begin MonoManager ReloadAssembly
Platform assembly: C:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll (this message is harmless)
Loading C:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll into Unity Child Domain
Platform assembly: C:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp-firstpass.dll (this message is harmless)