Skip to content

Instantly share code, notes, and snippets.

@4re
4re / hdr2sdr.py
Last active September 6, 2021 07:15
from vapoursynth import core, RGBS, YUV444PS
__version__ = '1.1.1'
def hdr2sdr(clip, source_peak=1000, ldr_nits=100, output_foramt=YUV420P8, input_range='limited', output_range='limited', dither='error_diffusion'):
"""Converts HDR footage to SDR.
https://forum.doom9.org/showthread.php?p=1800667#post1800667
Args:
@RenSys
RenSys / Theano -Shared Variables.py
Last active June 22, 2018 12:09
Theano -Shared Variables
from theano import shared, function
from theano import tensor as T
# (theano Tutorial)[http://deeplearning.net/software/theano/tutorial/examples.html]
state = shared(0)
inc = T.iscalar('inc')
accumulator = function([inc], state, updates=[(state, state + inc)])
# up to here
@RenSys
RenSys / Theano - Multiple Outputs.py
Last active June 22, 2018 12:09
Theano - Multiple Outputs
from theano import function
from theano import tensor as T
# (theano Tutorial)[http://deeplearning.net/software/theano/tutorial/examples.html]
# create a symbolic matrix
x, y = T.dmatrices('x', 'y')
diff_output = x - y
abs_diff_output = abs(diff_output)
diff_squared_output = diff_output**2
@RenSys
RenSys / Theano - Matrices Sigmoidal Transfer.py
Last active June 22, 2018 12:08
Theano - Matrices Sigmoidal Transfer
from theano import function
from theano import tensor as T
# (theano Tutorial)[http://deeplearning.net/software/theano/tutorial/examples.html]
# create a symbolic matrix
x = T.dmatrix('x')
# Method 1
# symbolic function
@jedypod
jedypod / storefunc.py
Created March 9, 2017 02:28 — forked from fredrikaverpil/storefunc.py
Store function on Nuke NoOp (or on nuke.root()) node and have it made available upon loading of script
"""Store function on node
Usage example:
.. code-block::
# Control node
ctrl_node_name = 'MY_SCRIPT_NODE' # if None, store on nuke.root()
# Define your functions and add them to the dictionary
@RenSys
RenSys / Sympy - Symbolic Probability using Dice.ipynb
Created March 8, 2017 03:08
Sympy - Symbolic Probability using Dice.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fredrikaverpil
fredrikaverpil / storefunc.py
Last active September 15, 2023 13:31
Store function on Nuke NoOp (or on nuke.root()) node and have it made available upon loading of script
"""Store function on node
Usage example:
.. code-block::
# Control node
ctrl_node_name = 'MY_SCRIPT_NODE' # if None, store on nuke.root()
# Define your functions and add them to the dictionary
@meetmangukiya
meetmangukiya / fn-ls.py
Created February 24, 2017 18:21
List functions and methods of classes in a python file
import ast
import sys
import os
with open(os.path.abspath(sys.argv[-1])) as f:
fc = f.read()
for i in filter(lambda x: isinstance(x, ast.FunctionDef), ast.parse(fc).body):
print(i.name)
@RenSys
RenSys / Standard - Logging.py
Created February 22, 2017 05:31
Standard - Logging
import logging
logger = logging.getLogger(__file__)
logging.basicConfig(format='%(asctime)s [%(levelname)s] %(message)s',
level=logging.DEBUG)
class Bank(object):
"""docstring for Bank"""
def __init__(self, inital_deposit):
Version 1
From 0.000000 1.000000
Length 4096
Components 1
{
1.3793103448276E-1
1.3983263082880E-1
1.4173422717484E-1
1.4363582352088E-1
1.4553741986692E-1