Skip to content

Instantly share code, notes, and snippets.

@jl1990
jl1990 / resnet-152_keras.py
Created November 3, 2018 17:16 — forked from mvoelk/resnet-152_keras.py
Resnet-152 pre-trained model in Keras 2.0
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import copy
from keras.layers import Input, Dense, Conv2D, MaxPooling2D, AveragePooling2D, ZeroPadding2D, Flatten, Activation, add
from keras.optimizers import SGD
from keras.layers.normalization import BatchNormalization
from keras.models import Model
@jl1990
jl1990 / readme.md
Created November 3, 2018 17:16 — forked from flyyufelix/readme.md
Resnet-152 pre-trained model in Keras

ResNet-152 in Keras

This is an Keras implementation of ResNet-152 with ImageNet pre-trained weights. I converted the weights from Caffe provided by the authors of the paper. The implementation supports both Theano and TensorFlow backends. Just in case you are curious about how the conversion is done, you can visit my blog post for more details.

ResNet Paper:

Deep Residual Learning for Image Recognition.
Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun
arXiv:1512.03385
@jl1990
jl1990 / Step.java
Created August 18, 2018 01:53
Pipeline design pattern
public interface Step<I, O>
{
O execute(I value);
default <A> Step<I, A> pipe(Step<O, A> source) {
return input -> source.execute(execute(input));
}
static <I, O> Step<I, O> of(Step<I, O> source) {
return source;