Giter Club home page Giter Club logo

repvgg-packaged's Introduction

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}
}

repvgg-packaged's People

Contributors

asad-ismail avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.