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.

Issues
  • 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
  • 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
WACV 2022 Paper - Is An Image Worth Five Sentences? A New Look into Semantics for Image-Text Matching

Is An Image Worth Five Sentences? A New Look into Semantics for Image-Text Matching Code based on our WACV 2022 Accepted Paper: https://arxiv.org/pdf/

Andres 8 Apr 28, 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 Jun 28, 2022
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 2.9k Jun 25, 2022
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 130 Jun 24, 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 201 Jun 11, 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) 883 Jun 25, 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 17 Jun 14, 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
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 199 Jun 18, 2022
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 15 Feb 15, 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 12 May 28, 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 114 Jun 10, 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
The world's simplest facial recognition api for Python and the command line

Face Recognition You can also read a translated version of this file in Chinese 简体中文版 or in Korean 한국어 or in Japanese 日本語. Recognize and manipulate fa

Adam Geitgey 45k Jun 21, 2022
MORAN: A Multi-Object Rectified Attention Network for Scene Text Recognition

MORAN: A Multi-Object Rectified Attention Network for Scene Text Recognition Python 2.7 Python 3.6 MORAN is a network with rectification mechanism for

Canjie Luo 591 Jun 18, 2022