- Super SloMo: High Quality Estimation of Multiple Intermediate Frames for Video Interpolation [Paper]
- Huaizu Jiang, Deqing Sun, Varun Jampani, Ming-Hsuan Yang, Erik Learned-Miller, Jan Kautz
- CVPR 2018 (splotlight)
- Video frame synthesis using deep voxel flow [Paper] [Code]
- Z. Liu, R. Yeh, X. Tang, Y. Liu, and A. Agarwala.
- ICCV 2017
- Video frame interpolation via adaptive separable convolution. [Paper] [Code]
import cv2 | |
import numpy as np | |
import argparse | |
''' | |
usage: python click_heatmap.py <image file> | |
left-click: add point to heatmap | |
s: save image (000.png, 001.png, ...) | |
q: quit | |
r: reset |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torchvision.models as tmodels | |
from functools import partial | |
import collections | |
# dummy data: 10 batches of images with batch size 16 | |
dataset = [torch.rand(16,3,224,224).cuda() for _ in range(10)] |
import warnings | |
from skimage.measure import compare_ssim | |
from skimage.transform import resize | |
from scipy.stats import wasserstein_distance | |
from scipy.misc import imsave | |
from scipy.ndimage import imread | |
import numpy as np | |
import cv2 | |
## |
# encoding:utf8 | |
from scipy.io import loadmat | |
import pandas as pd | |
import numpy as np | |
mat_train = loadmat('devkit/cars_train_annos.mat') | |
mat_test = loadmat('devkit/cars_test_annos.mat') | |
meta = loadmat('devkit/cars_meta.mat') |
## GOAL: | |
## re-create a figure similar to Fig. 2 in Wilson et al. (2018), | |
## Nature 554: 183-188. Available from: | |
## https://www.nature.com/articles/nature25479#s1 | |
## | |
## combines a boxplot (or violin) with the raw data, by splitting each | |
## category location in two (box on left, raw data on right) | |
# initial set-up ---------------------------------------------------------- |
Here's a simple implementation of bilinear interpolation on tensors using PyTorch.
I wrote this up since I ended up learning a lot about options for interpolation in both the numpy and PyTorch ecosystems. More generally than just interpolation, too, it's also a nice case study in how PyTorch magically can put very numpy-like code on the GPU (and by the way, do autodiff for you too).
For interpolation in PyTorch, this open issue calls for more interpolation features. There is now a nn.functional.grid_sample()
feature but at least at first this didn't look like what I needed (but we'll come back to this later).
In particular I wanted to take an image, W x H x C
, and sample it many times at different random locations. Note also that this is different than upsampling which exhaustively samples and also doesn't give us fle
""" | |
in this script, we calculate the image per channel mean and standard | |
deviation in the training set, do not calculate the statistics on the | |
whole dataset, as per here http://cs231n.github.io/neural-networks-2/#datapre | |
""" | |
import numpy as np | |
from os import listdir | |
from os.path import join, isdir | |
from glob import glob |
#https://gist.github.com/stared/dfb4dfaf6d9a8501cd1cc8b8cb806d2e | |
class PlotLosses(keras.callbacks.Callback): | |
def __init__(self,imgs): | |
super(PlotLosses, self).__init__() | |
self.imgs=imgs | |
def on_train_begin(self, logs={}): | |
self.i = 0 | |
self.x = [] |