RepVGG - Pytorch
Project description
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}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file repvgg-pytorch-1.0.1.tar.gz.
File metadata
- Download URL: repvgg-pytorch-1.0.1.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d62c24ef594ddf370884f7053e3f5e31d776db9e389a926b4b040c314790a1c4
|
|
| MD5 |
927decfb904f116feb66c47b80a5f663
|
|
| BLAKE2b-256 |
fbb3f22f67ae285cf7ae4fc27509e9a54e372b6788dbf2847933a5fbc509051e
|
File details
Details for the file repvgg_pytorch-1.0.1-py3-none-any.whl.
File metadata
- Download URL: repvgg_pytorch-1.0.1-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71eacf7b8909e1d9150b707a3a7f33da8ae1742c00de5c44c2232d32bb65888b
|
|
| MD5 |
ba19bf2cdf472020b64abc4c5ab1c45a
|
|
| BLAKE2b-256 |
f8a58aa50e61ed56e3e342761084b70dc2e823aaad1a3fe8a28fe85df68412e6
|