This file contains hidden or 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 pysrt | |
def srt_shift(shift, scale, input_file, output_file): | |
## the input srt file should be in utf-8 encoding | |
subs = pysrt.open(input_file) | |
print len(subs) |
This file contains hidden or 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 | |
from keras.datasets import cifar10 | |
from keras.layers import merge, Input | |
from keras.layers.convolutional import Convolution2D, ZeroPadding2D, AveragePooling2D | |
from keras.layers.core import Dense, Activation, Flatten, Dropout | |
from keras.layers.normalization import BatchNormalization | |
from keras.models import Model | |
from keras.preprocessing.image import ImageDataGenerator | |
from keras.utils import np_utils |
This file contains hidden or 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 lasagne as nn | |
Conv2DLayer = nn.layers.Conv2DDNNLayer | |
def inception_module(l_in, num_1x1, reduce_3x3, num_3x3, reduce_5x5, num_5x5, gain=1.0, bias=0.1): | |
""" | |
inception module (without the 3x3s1 pooling and projection because that's difficult in Theano right now) | |
""" | |
shape = l_in.get_output_shape() | |
out_layers = [] |