resnet
keras-style API to ResNets (ResNet-50, ResNet-101, and ResNet-152)
Science Score: 10.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (6.7%) to scientific vocabulary
Repository
keras-style API to ResNets (ResNet-50, ResNet-101, and ResNet-152)
Basic Info
Statistics
- Stars: 25
- Watchers: 2
- Forks: 22
- Open Issues: 5
- Releases: 0
Metadata Files
README.md
ResNet
Overview
ResNet serves as an extension to Keras Applications to include - ResNet-101 - ResNet-152
The module is based on Felix Yu's implementation of ResNet-101 and ResNet-152, and his trained weights. Slight modifications have been made to make ResNet-101 and ResNet-152 have consistent API as those pre-trained models in Keras Applications. Code is also updated to Keras 2.0.
Installation
shell
pip install resnet
Usuage
```python import resnet import numpy as np from keras.preprocessing.image import loadimg, imgto_array
-------------------------------------
Load pre-trained models
-------------------------------------
resnet50 = resnet.ResNet50(weights='imagenet') resnet101 = resnet.ResNet101(weights='imagenet') resnet152 = resnet.ResNet152(weights='imagenet')
-------------------------------------
Helper functions
-------------------------------------
def pathtotensor(imagepath, targetsize): image = loadimg(imagepath, targetsize=targetsize) tensor = imgtoarray(image) tensor = np.expand_dims(tensor, axis=0) return tensor
-------------------------------------
Make predictions
-------------------------------------
imagepath = 'examples/images/dog.jpeg' imagetensor = pathtotensor(imagepath, (224, 224)) predresnet50 = np.argmax(resnet50.predict(imagetensor)) predresnet101 = np.argmax(resnet101.predict(imagetensor)) predresnet152 = np.argmax(resnet152.predict(image_tensor)) ```

The above dog image is predicted to have - 257: 'Great Pyrenees' by ResNet-50 - 257: 'Great Pyrenees' by ResNet-101 - 257: 'Great Pyrenees' by ResNet-152
Contact
If you have any questions or encounter any bugs, please contact the author (Feiyang Niu, statech.forums@gmail.com)
References
- He and etc 2015 Deep Residual Learning for Image Recognition arXiv:1512.03385
- Felix Yu's original implementation of ResNet-101 is found here and ResNet-152 here.
Owner
- Name: Feiyang Niu
- Login: statechular11
- Kind: user
- Repositories: 2
- Profile: https://github.com/statechular11
The perfect way to spend life is to be with the beloved one and make a positive change. That's why I believe in love & AI
GitHub Events
Total
Last Year
Dependencies
- keras >=2.0
- keras >=2.0