resnet-simple is a Python3 library that provides a well-documented and easy to use implementation of ResNet (and ResNetv1.5), together with its most basic use case of image classification.
Residual Network, more commonly known as ResNet, is a deep learning model that is most commonly used for image recogition and classification. It was first introduced by He et al. in the paper titled "Deep Residual Learning for Image Recognition". Each ResNet has multiple residual blocks that takes an input
This module allows you to choose between the original ResNet (v1) and the modified ResNet (v1.5), in which the latter enjoys a slight increase in accuracy at the expense of a slower performance. To do so, set downsample_3x3 = True
under the BottleNeck
/ResNet
class to use ResNetv1.5, and downsample_3x3 = False
for ResNetv1. This feature only works for ResNets that use BottleNeck blocks such as ResNet50, ResNet101 and ResNet152.
resnet-simple only supports python 3.7 and above. If you want to use resnet-simple for other versions of Python, do note that it may not function as intended.
Module is mainly tested on Google Colab (GPU) and Windows (CPU). Issues when setting up in other environments, or when using multiple GPU cores, are still relatively unknown.
The following libraries are compulsory in order to use resnet-simple, which is automatically installed together with it unless otherwise specified:
- tqdm
- torch
- safetensors
When pip installing resnet-simple, the following libraries will also be installed as they are used in our examples:
- matplotlib
- torchvision
- tensorboard
- scikit-learn (for Python 3.7, use version 1.0.2)
In command prompt on Windows,
pip install resnet-simple
In your python file,
from resnet_simple import *
I appreciate if you are able to contribute to this project as I am the only contributor for now. If you think that something is wrong with my code, you can open an issue and I'll try my best to resolve it!
The code from this module is re-implemented based on what was described in the following paper.
@inproceedings{inproceedings,
author = {He, Kaiming and Zhang, Xiangyu and Ren, Shaoqing and Sun, Jian},
year = {2016},
month = {06},
pages = {770-778},
title = {Deep Residual Learning for Image Recognition},
doi = {10.1109/CVPR.2016.90}
}@misc{he2015deep,
title={Deep Residual Learning for Image Recognition},
author={Kaiming He and Xiangyu Zhang and Shaoqing Ren and Jian Sun},
year={2015},
eprint={1512.03385},
archivePrefix={arXiv},
primaryClass={cs.CV}
}