Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
require 'nn' | |
require 'image' | |
require 'cutorch' | |
require 'cunn' | |
require 'cudnn' | |
-- adds first dummy dimension | |
function torch.Tensor:add_dummy() | |
local sz = self:size() | |
local new_sz = torch.Tensor(sz:size()+1) |
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
from __future__ import print_function | |
import threading | |
from joblib import Parallel, delayed | |
import Queue | |
# Fix print | |
_print = print | |
_rlock = threading.RLock() | |
def print(*args, **kwargs): | |
with _rlock: |
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
from __future__ import print_function | |
import threading | |
from joblib import Parallel, delayed | |
import Queue | |
import os | |
# Fix print | |
_print = print | |
_rlock = threading.RLock() | |
def print(*args, **kwargs): |
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
from joblib import Parallel, delayed | |
import Queue | |
import os | |
# Define number of GPUs available | |
N_GPU = 4 | |
# Put indices in queue | |
q = Queue.Queue(maxsize=N_GPU) | |
for i in range(N_GPU): |
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 random | |
from PIL import Image | |
import glob | |
import numpy as np | |
def get_sample_grid_(paths, grid_w=4, grid_h=4, imsize_w=256, imsize_h=256): | |
imgs = [] | |
for p in paths: | |
imgs.append(np.array(Image.open(p).convert('RGB').resize([imsize_w,imsize_h]))) |
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 numba | |
def FindLowAndHighIndices(x, m): | |
xf = np.floor(x) | |
l = np.clip(xf, 0, m-1).astype(int) | |
h = np.clip(xf + 1, 0, m-1).astype(int) | |
return l, h |
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
def imscatter(images, positions): | |
positions = np.array(positions) | |
bottoms = positions[:,1] - np.array([im.shape[1]/2.0 for im in images]) | |
tops = bottoms + np.array([im.shape[1] for im in images]) | |
lefts = positions[:,0] - np.array([im.shape[0]/2.0 for im in images]) | |
rigths = lefts + np.array([im.shape[0] for im in images]) | |
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
from flask import Flask, request, render_template | |
app = Flask(__name__, static_url_path='', static_folder='') | |
@app.route('/') | |
def root(): | |
return app.send_static_file('sr_set5.html') | |
@app.route('/readme') |
This file has been truncated, but you can view the full file.
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
<!DOCTYPE html> | |
<html> | |
<head><meta charset="utf-8" /> | |
<title>Feats_work-clean</title><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<style type="text/css"> | |
/*! | |
* | |
* Twitter Bootstrap |
OlderNewer