Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#
# Run this script from the location of ideepcolor.py
#
# TODO: search for any py 3 version
PYTHON="python3"
CAFFE_FILES="./caffe_files"
MODELS="./models"
@SleepProgger
SleepProgger / Python_timer_context manager.py
Last active June 9, 2017 21:03
because i am too lazy to write it everytime again
from time import time as now, sleep
class Timer:
def __init__(self, msg=None, times=1):
self.times = times
self.msg = msg
def __enter__(self):
self.start = now()
return self
@ECHO OFF
REM For general infos see http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
REM Set the path here if your ffmpeg executable is somewhere else as in the current directory
SET ffmpeg_path=ffmpeg.exe
SET palette=%TMP%\palette.png
SET subtitlefile=subtitle.ass
if not exist "%ffmpeg_path%" echo "Can't find ffmpeg.exe" & goto done
@SleepProgger
SleepProgger / video2gif_debug.bat
Last active September 29, 2018 02:50
video2gif_debug.bat
@ECHO OFF
REM For general infos see http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
REM Set the path here if your ffmpeg executable is somewhere else as in the current directory
SET ffmpeg_path=ffmpeg.exe
SET palette=%TMP%\palette.png
SET subtitlefile=subtitle.ass
if not exist "%ffmpeg_path%" echo "Can't find ffmpeg.exe" & goto done
#!/bin/sh
if [ -z "$STEAMDIR" ]; then
STEAMDIR="$HOME/.steam/steam/steamapps"
fi
if [ -z "$PROTON_VERSION" ]; then
PROTON_VERSION="Proton 3.16"
fi
'''
Crude script to analyze which CPU features are used by a given executable/library.
Created on Jun 2, 2019
@author: SleepProgger
'''
import json
import argparse
import sys

// TODO: add all tf functions // TODO: sort by name

// For those cases a TILE impl isn't possible/useful base class to use CPU operations

class CPU_operation(ptile.Operation):
    def __init__(self, inputs, outputs, name=None, side_effects=None):
        self._inputs = inputs
        super(CPU_operation, self).__init__(None, [], outputs, name=name, side_effects=side_effects)
#!/usr/bin/env python3
from keras.layers import Input, LeakyReLU, Conv2D
from keras.engine import InputSpec, Layer
from keras.models import Model as KerasModel
import keras.backend as K
import numpy as np
if K.backend() == "plaidml.keras.backend":
import plaidml
import plaidml.op
'''
Created on Nov 2, 2018
@author: nope
'''
import time
import json
import os
CLIENT_ID = os.environ.get('IMGUR_API_KEY', None)