Repvgg-packaged 🎁
A Python-packaged version of RepVGG: Making VGG-style ConvNets Great Again 🚀. The main contribution of this repo is to provide an easy-to-use backbone for RepVGG, which can be effortlessly used for downstream computer vision tasks
This project is based on the excellent original RepVGG implementation by authors Ding, Xiaohan et al. 🌟:
Install
$ pip install repvgg-pytorch
RepVGG
Usage for Training
import torch
from repvgg_pytorch import get_RepVGG_func_by_name
from repvgg_pytorch import repvgg_model_convert
repvgg_name="RepVGG-A0-backbone"
model_builder=get_RepVGG_func_by_name(repvgg_name)
model=model_builder(deploy=False)
x=torch.randn((1,3,512,512))
out=model(x) # (1, 512, 64, 64]
# Save the converted model for deployment
deploy_model = repvgg_model_convert(model, save_path='RepVGG_deploy.pth')
Usage for Deployment
import torch
from repvgg_pytorch import get_RepVGG_func_by_name
repvgg_name="RepVGG-A0-backbone"
model_builder=get_RepVGG_func_by_name(repvgg_name)
model=model_builder(deploy=True)
model.eval()
model.load_state_dict(torch.load('RepVGG_deploy.pth'))
x=torch.randn((1,3,512,512))
out=model(x) # (1, 512, 64, 64)
RepVGG Plus
Usage for Training
import torch
from repvgg_pytorch.repvgg import get_RepVGG_func_by_name
from repvgg_pytorch import repvgg_model_convert
repvgg_name="RepVGG-A0-backbone"
model_builder=get_RepVGG_func_by_name(repvgg_name)
model=model_builder(deploy=False)
x=torch.randn((1,3,512,512))
out=model(x) # (1, 512, 64, 64]
# Save the converted model for deployment
deploy_model = repvgg_model_convert(model, save_path='RepVGGplus_deploy.pth')
Usage for Deployment
import torch
from repvgg_pytorch.repvgg import get_RepVGG_func_by_name
repvgg_name="RepVGG-A0-backbone"
model_builder=get_RepVGG_func_by_name(repvgg_name)
model=model_builder(deploy=True)
model.eval()
model.load_state_dict(torch.load('RepVGGplus_deploy.pth'))
x=torch.randn((1,3,512,512))
out=model(x) # (1, 320, 64, 64)
References
@inproceedings{ding2021repvgg,
title={Repvgg: Making vgg-style convnets great again},
author={Ding, Xiaohan and Zhang, Xiangyu and Ma, Ningning and Han, Jungong and Ding, Guiguang and Sun, Jian},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={13733--13742},
year={2021}
}
Metadata
Release files for repvgg-pytorch 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| repvgg-pytorch-1.0.1.tar.gz | 9.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| repvgg_pytorch-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.2 kB
Release files / repvgg-pytorch-1.0.1.tar.gz
| Download URL | repvgg-pytorch-1.0.1.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d62c24ef594ddf370884f7053e3f5e31d776db9e389a926b4b040c314790a1c4
|
|
BLAKE2b-256 checksum How to use checksums |
fbb3f22f67ae285cf7ae4fc27509e9a54e372b6788dbf2847933a5fbc509051e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|
Release files / repvgg_pytorch-1.0.1-py3-none-any.whl
| Download URL | repvgg_pytorch-1.0.1-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71eacf7b8909e1d9150b707a3a7f33da8ae1742c00de5c44c2232d32bb65888b
|
|
BLAKE2b-256 checksum How to use checksums |
f8a58aa50e61ed56e3e342761084b70dc2e823aaad1a3fe8a28fe85df68412e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|