RepMLP: Re-parameterizing Convolutions into Fully-connected Layers for Image Recognition

Overview

RepMLP

RepMLP: Re-parameterizing Convolutions into Fully-connected Layers for Image Recognition

Released the code of RepMLP together with an example of checking the equivalence between a training-time and an inference-time RepMLP.

Just check it by

python repmlp.py

Will be updated in several days.

Comments
  • Light Block is only 10% faster than Bottleneck?

    Light Block is only 10% faster than Bottleneck?

    Light Block is not fast as the paper says

    def test(network, p=True):
        x = torch.ones(128, 3, 224, 224).cuda()
        model = network.cuda()
        if p: print(model)
        model.eval()
        with torch.no_grad(): 
            # warm iters
            for i in range(20):
                y = model(x)
            # inference test 
            iters = 50
            start = time.time()
            for i in range(iters):
                y = model(x)
            end = time.time()
            print((end-start)/iters, 's')
        print(y.shape)
    
    if __name__ == "__main__":
        torch.backends.cudnn.benchmark=True
        test(create_RepMLPRes50_Base_224(deploy=True), False)
        test(create_RepMLPRes50_Light_224(deploy=True), False)
        test(create_RepMLPRes50_Bottleneck_224(deploy=True), False)
    

    with Titan XP

    Base: 17.1 ms
    Light Block: 16.9 ms
    Bottleneck: 18.6 ms 
    
    opened by LightToYang 2
  • Why not keep repmlp-resnet?

    Why not keep repmlp-resnet?

    This design of repmlp-resnet is different from the lastest repmlpnet, and it shows great face recognition accuracy.

    why not keep repmlp-resnet in this repo?

    opened by twmht 1
  • 请教一点代码问题

    请教一点代码问题

    关于在单位阵上做卷积,单位阵里有很多0啊,局部信息不会丢失嘛,(还是我理解错了) 比如这段代码里: https://github.com/DingXiaoH/RepMLP/blob/55c76774fb915b8cfde3c029fc68a60dfd5d1515/repmlp.py#L107 假设输入就是(1,1,3,3), groups=1, c_in=c_out=1, 就是简单地在一张(3,3)的图上做一个3x3卷积。 I = torch.eye(9).repeat(1,1).reshape(9,1,3,3) I = tensor([[[[1., 0., 0.], [0., 0., 0.], [0., 0., 0.]]], [[[0., 1., 0.], [0., 0., 0.], [0., 0., 0.]]], [[[0., 0., 1.], [0., 0., 0.], [0., 0., 0.]]], [[[0., 0., 0.], [1., 0., 0.], [0., 0., 0.]]], [[[0., 0., 0.], [0., 1., 0.], [0., 0., 0.]]], [[[0., 0., 0.], [0., 0., 1.], [0., 0., 0.]]], [[[0., 0., 0.], [0., 0., 0.], [1., 0., 0.]]], [[[0., 0., 0.], [0., 0., 0.], [0., 1., 0.]]], [[[0., 0., 0.], [0., 0., 0.], [0., 0., 1.]]]])

    在这个上面做卷积,I的形状是(9,1,3,3),每个(3,3)中只有一个值不为0,卷积后reshape回去,也只有对角元上不为0,这样做(9,9)x(9,1)的矩阵乘的话,相当与给(3,3)里的每一个元素乘了一个单独的值,也不是卷积吧。

    opened by hsm1997 0
  • How to convert the 1D model of RepMLP [B, C, H]

    How to convert the 1D model of RepMLP [B, C, H]

    Thank you very much for proposing an excellent model and sharing it publicly. Also congratulations on the publication of your results in CVPR. Since I want the RepMLP model should be on one-dimensional data, that is, the input is only [B, C, H]. Would like to ask if it is possible to provide a RepMLP model for such one-dimensional data?

    opened by kuaileyuandi 0
  • Why the size after average pooling of Global Perceptron be (1, 1)

    Why the size after average pooling of Global Perceptron be (1, 1)

    https://github.com/DingXiaoH/RepMLP/blob/main/repmlpnet.py#L49

    def forward(self, inputs):
            x = F.adaptive_avg_pool2d(inputs, output_size=(1, 1))
            x = self.fc1(x)
    

    according to the paper, it may should be (h, w)?

    opened by Lloyd-Pottiger 0
Owner
null
A facial recognition device is a device that takes an image or a video of a human face and compares it to another image faces in a database.

A facial recognition device is a device that takes an image or a video of a human face and compares it to another image faces in a database. The structure, shape and proportions of the faces are compared during the face recognition steps.

Pavankumar Khot 4 Mar 19, 2022
A curated list of resources for text detection/recognition (optical character recognition ) with deep learning methods.

awesome-deep-text-detection-recognition A curated list of awesome deep learning based papers on text detection and recognition. Text Detection Papers

null 2.4k Jan 8, 2023
Text recognition (optical character recognition) with deep learning methods.

What Is Wrong With Scene Text Recognition Model Comparisons? Dataset and Model Analysis | paper | training and evaluation data | failure cases and cle

Clova AI Research 3.2k Jan 4, 2023
Sign Language Recognition service utilizing a deep learning model with Long Short-Term Memory to perform sign language recognition.

Sign Language Recognition Service This is a Sign Language Recognition service utilizing a deep learning model with Long Short-Term Memory to perform s

Martin Lønne 1 Jan 8, 2022
Official PyTorch implementation for "Mixed supervision for surface-defect detection: from weakly to fully supervised learning"

Mixed supervision for surface-defect detection: from weakly to fully supervised learning [Computers in Industry 2021] Official PyTorch implementation

ViCoS Lab 169 Dec 30, 2022
Use Convolutional Recurrent Neural Network to recognize the Handwritten line text image without pre segmentation into words or characters. Use CTC loss Function to train.

Handwritten Line Text Recognition using Deep Learning with Tensorflow Description Use Convolutional Recurrent Neural Network to recognize the Handwrit

sushant097 224 Jan 7, 2023
Slice a single image into multiple pieces and create a dataset from them

OpenCV Image to Dataset Converter Slice a single image of Persian digits into mu

Meysam Parvizi 14 Dec 29, 2022
Converts an image into funny, smaller amongus characters

SussyImage Converts an image into funny, smaller amongus characters Demo Mona Lisa | Lona Misa (Made up of AmongUs characters) API I've also added an

Dhravya Shah 14 Aug 18, 2022
Extract tables from scanned image PDFs using Optical Character Recognition.

ocr-table This project aims to extract tables from scanned image PDFs using Optical Character Recognition. Install Requirements Tesseract OCR sudo apt

Abhijeet Singh 209 Dec 6, 2022
A general list of resources to image text localization and recognition 场景文本位置感知与识别的论文资源与实现合集 シーンテキストの位置認識と識別のための論文リソースの要約

Scene Text Localization & Recognition Resources Read this institute-wise: English, 简体中文. Read this year-wise: English, 简体中文. Tags: [STL] (Scene Text L

Karl Lok (Zhaokai Luo) 901 Dec 11, 2022
Isearch (OSINT) 🔎 Face recognition reverse image search on Instagram profile feed photos.

isearch is an OSINT tool on Instagram. Offers a face recognition reverse image search on Instagram profile feed photos.

Malek salem 20 Oct 25, 2022
Image Recognition Model Generator

Takes a user-inputted query and generates a machine learning image recognition model that determines if an inputted image is or isn't their query

Christopher Oka 1 Jan 13, 2022
Deskew is a command line tool for deskewing scanned text documents. It uses Hough transform to detect "text lines" in the image. As an output, you get an image rotated so that the lines are horizontal.

Deskew by Marek Mauder https://galfar.vevb.net/deskew https://github.com/galfar/deskew v1.30 2019-06-07 Overview Deskew is a command line tool for des

Marek Mauder 127 Dec 3, 2022
An advanced 2D image manipulation with features such as edge detection and image segmentation built using OpenCV

OpenCV-ToothPaint3-Advanced-Digital-Image-Editor This application named ‘Tooth Paint’ version TP_2020.3 (64-bit) or version 3 was developed within a w

JunHong 1 Nov 5, 2021
This pyhton script converts a pdf to Image then using tesseract as OCR engine converts Image to Text

Script_Convertir_PDF_IMG_TXT Este script de pyhton convierte un pdf en Imagen luego utilizando tesseract como motor OCR convierte la Imagen a Texto. p

alebogado 1 Jan 27, 2022
Thresholding-and-masking-using-OpenCV - Image Thresholding is used for image segmentation

Image Thresholding is used for image segmentation. From a grayscale image, thresholding can be used to create binary images. In thresholding we pick a threshold T.

Grace Ugochi Nneji 3 Feb 15, 2022
Turn images of tables into CSV data. Detect tables from images and run OCR on the cells.

Table of Contents Overview Requirements Demo Modules Overview This python package contains modules to help with finding and extracting tabular data fr

Eric Ihli 311 Dec 24, 2022
Tools for manipulating and evaluating the hOCR format for representing multi-lingual OCR results by embedding them into HTML.

hocr-tools About About the code Installation System-wide with pip System-wide from source virtualenv Available Programs hocr-check -- check the hOCR f

OCRopus 285 Dec 8, 2022