Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qubvel/resnet_152
Pretrained on ImageNet ResNet-152 model in Keras
https://github.com/qubvel/resnet_152
keras pre-trained pretrained resnet-152
Last synced: 10 days ago
JSON representation
Pretrained on ImageNet ResNet-152 model in Keras
- Host: GitHub
- URL: https://github.com/qubvel/resnet_152
- Owner: qubvel
- Created: 2018-05-11T14:41:16.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-12T17:31:31.000Z (over 6 years ago)
- Last Synced: 2024-10-06T12:24:19.319Z (about 1 month ago)
- Topics: keras, pre-trained, pretrained, resnet-152
- Language: Python
- Homepage:
- Size: 110 KB
- Stars: 5
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ResNet-152 model for Keras
Reference:
- [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385)Extention of model taken [here](https://gist.github.com/flyyufelix/7e2eafb149f72f4d38dd661882c554a6).
Model made in Keras style with pretrained weights from ImageNet provided in release (load automatically during model initialization).### Example
##### Inference example for this picture:##### Code
```pythonimport numpy as np
from skimage.io import imread
from skimage.transform import resize
from keras.applications.imagenet_utils import decode_predictions
from keras.applications.imagenet_utils import preprocess_input
from model import ResNet152# create model
model = ResNet152()# define function for input preprocessing
def preprocess(x):
x = resize(x, (224,224), mode='constant') * 255
x = preprocess_input(x)
if x.ndim == 3:
x = np.expand_dims(x, 0)
return x# prepare image
img = imread('./imgs/cat.jpg')
x = preprocess(img)# make prediction and decode it
y = model.predict(x)
pred_title = decode_predictions(y, top=1)[0][0][1]# print result
print(pred_title)
### tiget_cat
```