This file contains 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
#!/usr/bin/env python | |
# -*- coding:UTF-8 -*- | |
import torch | |
import torch.nn as nn | |
import torch.nn.init as init | |
def weight_init(m): | |
''' |
This file contains 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 torch | |
import torch.nn.functional as F | |
from torch.nn.parameter import Parameter | |
import numpy as np | |
class SpatialSoftmax(torch.nn.Module): | |
def __init__(self, height, width, channel, temperature=None, data_format='NCHW'): | |
super(SpatialSoftmax, self).__init__() | |
self.data_format = data_format |
This file contains 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
"""Simple example on how to log scalars and images to tensorboard without tensor ops. | |
License: Copyleft | |
""" | |
__author__ = "Jeasine Ma" | |
import tensorflow as tf | |
from PIL import Image | |
import numpy as np | |
from io import BytesIO |
This file contains 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
export CUDA_HOME=$HOME/tools/cuda-9.0 # change to your path | |
export CUDA_TOOLKIT_ROOT_DIR=$CUDA_HOME | |
export LD_LIBRARY_PATH="$CUDA_HOME/extras/CUPTI/lib64:$LD_LIBRARY_PATH" | |
export LIBRARY_PATH=$CUDA_HOME/lib64:$LIBRARY_PATH | |
export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH | |
export CFLAGS="-I$CUDA_HOME/include $CFLAGS" | |
export PATH="$CUDA_HOME/bin:$PATH" |
This file contains 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
java -jar notedup_patched.jar |
This file contains 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
#!/usr/bin/env python | |
# -*- coding:UTF-8 -*- | |
# File Name : face_morphing.py | |
# Creation Date : 04-04-2018 | |
# Created By : Jeasine Ma [jeasinema[at]gmail[dot]com] | |
import cv2 | |
import json | |
import numpy as np |
This file contains 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 torch | |
import numpy as np | |
import argparse | |
from torchvision import models | |
import matplotlib.pyplot as plt | |
import cv2 | |
import os | |
resnet = models.resnet50(pretrained=True) |
This file contains 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 matplotlib.pyplot as plt | |
from matplotlib.lines import Line2D | |
import seaborn as sns | |
import numpy as np | |
fig = plt.figure() | |
fig.set_size_inches(18, 3) | |
ax = fig.subplots(1) | |
label = ['Expert', 'Demo', 'Pre-train', 'POfD', 'Penalty', 'Penalty + Ann.', 'Ours'] | |
flatui = ["#9b59b6", "#999900", "#3498db", "#95a5a6", "#009900", "#fc9272", "#e74c3c"] | |
clrs = sns.color_palette(flatui) |
This file contains 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
{0: 'tench, Tinca tinca', | |
1: 'goldfish, Carassius auratus', | |
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias', | |
3: 'tiger shark, Galeocerdo cuvieri', | |
4: 'hammerhead, hammerhead shark', | |
5: 'electric ray, crampfish, numbfish, torpedo', | |
6: 'stingray', | |
7: 'cock', | |
8: 'hen', | |
9: 'ostrich, Struthio camelus', |
This file contains 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
% packages | |
\usepackage{amsmath,amsfonts,amssymb,amsthm} | |
\usepackage{hyperref} | |
\usepackage{xspace} | |
\usepackage{algorithm} | |
\usepackage{algorithmic} | |
\usepackage{color} | |
\usepackage{graphicx} | |
\usepackage{mathtools} | |
\usepackage{footmisc} |
NewerOlder