Skip to content

Instantly share code, notes, and snippets.

@tm157
tm157 / calc_percep.py
Last active March 21, 2019 03:51
Calculate Perceptual Similarity Loss between image in a folder
from models import dist_model as dm
from util import util
import os
import ipdb
import glob
import csv
import cv2
import skimage.io as sio
class PercepSimilarity:
class bcolors(object):
Endc='\033[0m'
Bold='\033[1m'
Underlined='\033[4m'
Blink='\033[5m'
Inverted='\033[7m'
Hidden='\033[8m'
Black='\033[30m'
Red='\033[31m'
@tm157
tm157 / logger.py
Created February 8, 2019 19:18
Logger file for tensorflow with pytorch
import tensorflow as tf
from torch.autograd import Variable
import numpy as np
import scipy.misc
import os
import torch
try:
from StringIO import StringIO # Python 2.7
except ImportError:
@tm157
tm157 / setup.sh
Created October 13, 2018 17:32
Setting up a new machines with all the requirements
# ==== first setup Vundle ====
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
# Now goto the home folder
cd
# now clone your dotfiles
git clone git@github.com:tm157/dotfiles.git
# now link the appropriate files
@tm157
tm157 / requirements.txt
Last active May 4, 2019 21:39
requirements file for setting up a python environment (I will keep on adding things to it as and when I remember them)
tensorflow-gpu==1.8.0
torch
cython
torchvision
opencv-python
transforms3D
scikit-learn
pycocotools
scikit-image
h5py
h1 { font-family: monaco, Consolas, "Lucida Console", monospace; font-size: 24px; font-style: normal; font-variant: normal; font-weight: bold; line-height: 26px; } h3 { font-family: monaco, Consolas, "Lucida Console", monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; line-height: 15px; } p { font-family: monaco, Consolas, "Lucida Console", monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; line-height: 20px; } blockquote { font-family: monaco, Consolas, "Lucida Console", monospace; font-size: 21px; font-style: normal; font-variant: normal; font-weight: 400; line-height: 30px; } pre { font-family: monaco, Consolas, "Lucida Console", monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; line-height: 18px; }
t.prefs_.set('color-palette-overrides',["#002831", "#d11c24", "#6cbe6c", "#a57706", "#2176c7", "#c61c6f", "#259286", "#eae3cb", "#006488", "#f5163b", "#51ef84", "#b27e28", "#178ec8", "#e24d8e", "#00b39e", "#fcf4dc"]);
t.prefs_.set('foreground-color', "#b2b2b2");
t.prefs_.set('background-color', "#262626");
t.prefs_.set('cursor-color', 'rgba(208,208,208,0.5)');