• Stars
    star
    325
  • Rank 129,350 (Top 3 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Don't feel pain to use Deformable Convolution

PyTorch-Deformable-Convolution-v2

Don't feel pain to use Deformable Convolution v2(DCNv2)

If you are curious about how to visualize offset(red point), refer to offset_visualization.py

Usage

from dcn import DeformableConv2d

class Model(nn.Module):
    ...
    self.conv = DeformableConv2d(in_channels=32, out_channels=32, kernel_size=3, stride=1, padding=1)
    ...

Experiment

You can simply reproduce the results of my experiment on Google Colab.

Refer to experiment.ipynb!

Task

Scaled-MNIST Handwritten Digit Classification

Model

Simple CNN Model including 5 conv layers

class MNISTClassifier(nn.Module):
    def __init__(self,
                 deformable=False):

        super(MNISTClassifier, self).__init__()
        
        self.conv1 = nn.Conv2d(1, 32, kernel_size=3, stride=1, padding=1, bias=True)
        self.conv2 = nn.Conv2d(32, 32, kernel_size=3, stride=1, padding=1, bias=True)
        self.conv3 = nn.Conv2d(32, 32, kernel_size=3, stride=1, padding=1, bias=True)   
        conv = nn.Conv2d if deformable==False else DeformableConv2d
        self.conv4 = conv(32, 32, kernel_size=3, stride=1, padding=1, bias=True)
        self.conv5 = conv(32, 32, kernel_size=3, stride=1, padding=1, bias=True)
        
        self.pool = nn.MaxPool2d(2)
        self.gap = nn.AdaptiveAvgPool2d((1, 1))
        self.fc = nn.Linear(32, 10)
        
    def forward(self, x):
        x = torch.relu(self.conv1(x))
        x = self.pool(x) # [14, 14]
        x = torch.relu(self.conv2(x))
        x = self.pool(x) # [7, 7]
        x = torch.relu(self.conv3(x))
        x = torch.relu(self.conv4(x))
        x = torch.relu(self.conv5(x))
        x = self.gap(x)
        x = x.flatten(start_dim=1)
        x = self.fc(x)
        return x

Training

  • Optimizer: Adam
  • Learning Rate: 1e-3
  • Learning Rate Scheduler: StepLR(step_size=1, gamma=0.7)
  • Batch Size: 64
  • Epochs: 14
  • Augmentation: NONE

Test

In the paper, authors mentioned that the network's ability to model geometric transformation with DCNv2 is considerably enhanced.

I verified it with scale augmentation.

All images in the test set of MNIST dataset are augmented by scale augmentation(x0.5, x0.6, ..., x1.4, x1.5).

Results

Model Top-1 Accuracy(%)
w/o DCNv2 90.03%
w/ DCNv2 92.90%

References

mxnet implementation

To Do Lists

  • Support Onnx Conversion

More Repositories

1

Yolo_Label

GUI for marking bounded boxes of objects in images for training neural network YOLO
C++
336
star
2

PyTorch-Darknet53

PyTorch implementation of Darknet53
Python
106
star
3

SKNet-PyTorch

Nearly Perfect & Easily Understandable PyTorch Implementation of SKNet
Python
76
star
4

RTSP-Client-FFMPEG-OpenCV-ON-QT

RTSP Client Program using FFmpeg and OpenCV on Qt
C++
55
star
5

Custom-CNN-based-Image-Classification-in-PyTorch

Python
42
star
6

EDAR

PyTorch implementation of Deep Convolution Networks based on EDSR for Compression(Jpeg) Artifacts Reduction
Python
35
star
7

onepose

Human pose estimation within one line
Python
31
star
8

Modern-Cpp-NMS

A Modern C++ Implementation of NMS
C++
24
star
9

YOLOX-Backbone

yolox_backbone is a deep-learning library and a collection of YOLOX Backbone models.
Python
24
star
10

Num-Workers-Search

num_workers Search Algorithm for Fast PyTorch DataLoader
Python
21
star
11

Setup-for-Imagenet

Imagenet(for image classification, 2012) 데이터 μ…‹ λ‹€μš΄λ‘œλ“œ 및 정리 방법 정리
Batchfile
18
star
12

onnxruntime-cuda-cpp-example

Examples for inference models with ONNXRuntime and CUDA
Dockerfile
18
star
13

pytorch-backbone-benchmark

Benchmarks for popular neural network models supported by timm
Python
17
star
14

FFmpeg-Debug-VSCode-Windows

The guide to debug FFmpeg on Windows with VSCode
15
star
15

YOLOv3Tiny

PyTorch Implementation of YOLOv3Tiny
Python
13
star
16

TX2-JetPack-Installation-Guide-Kr

ν•œκΈ€λ‘œ μž‘μ„±λœ TX2 JetPack μ„€μΉ˜ κ°€μ΄λ“œμž…λ‹ˆλ‹€.
13
star
17

Learning-Rate-WarmUp

11
star
18

Explainable-YOLOv8

Visualize the low-level outputs of YOLOv8 to analyze and understand the areas where our model focuses. Specifically, illustrate which anchor points are activated to predict bounding boxes.
Python
11
star
19

qsort

Much faster than SORT(Simple Online and Realtime Tracking), a little worse than SORT
Python
10
star
20

image-knocker

Knock your images before you get stressed.
Python
10
star
21

Elastic-Distortion

Implementation of elastic distortion algorithm in C++ (Using OpenCV)
C++
8
star
22

BatchedFFmpeg

Process multiple videos with one line of ffmpeg command.
Python
8
star
23

plotbbox

A package to plot pretty bounding boxes for object detection task
Python
7
star
24

PicoDet-Backbone

PyTorch Implementation of Backbone of PicoDet
Python
7
star
25

Torch-Warmup

The easiest way to use learning rate warmup method on PyTorch
Jupyter Notebook
7
star
26

Practical-FFmpeg-Examples

Practical FFmpeg examples for beginners
C++
6
star
27

CSPDarknet53

Pytorch Implementation of CSPDarknet53
Python
5
star
28

developer0hye.github.io

JavaScript
4
star
29

Github-Actions-Tutorial

4
star
30

commitcleaner

Clean your all commit history in one line
Python
3
star
31

yolov8-tensorrt-inference-docker-image

Simply run your YOLOv8 faster by using TensorRT on a docker container
Python
3
star
32

PyTorch-ImageNet

PyTorch based Imagenet Training Code
Python
3
star
33

rotten-korean-romanizer

Python library for romanizing Korean text. Converts 'μ•ˆλ…•ν•˜μ„Έμš”' to 'annyeonghaseyo' and more.
Python
3
star
34

Windows10-Nvidia-Docker-WSL

Nvidia Docker on WSL(Windows10) Guide
3
star
35

Torch-BatchNorm-From-Scratch

2
star
36

My-FFMPEG-Scripts

Python
2
star
37

googletest-hello-world

CMake
2
star
38

2019_Kwangwoon_Univ_CE_DS_Project_1

2019년도 κ΄‘μš΄λŒ€ν•™κ΅ 컴퓨터정보곡학뢀 데이터 ꡬ쑰 섀계 및 μ‹€μŠ΅ 1μ°¨ ν”„λ‘œμ νŠΈ μŠ€μΌˆλ ˆν†€ μ½”λ“œ
C++
2
star
39

PyTorch-DLA

Pytorch Implementation of Deep Layer Aggregation Networks
Python
2
star
40

ViT

Python
2
star
41

Papers-Yonghye-reads

읽은 λ…Όλ¬Έλ“€ 정리
2
star
42

Algo-0hye

λ°±μ€€ 온라인 저지 λΏŒμ…”λΏŒμ…”
C++
2
star
43

TinyFCOS

TinyFCOS
1
star
44

PyTorch-Lightning-CenterNet

Python
1
star
45

ROPNet

CNN Based Rectangular Objects Pose Estimation
1
star
46

PyTorch-YOLOF-DilatedEncoder

PyTorch implementation of DilatedEncoder proposed in YOLOF
Python
1
star
47

ColabxPytorch-Image-Classfier

ColabXPytorch-Image-Classfier
Jupyter Notebook
1
star
48

Imagination

An Open Source Deep Learning Framework for Image Processing
1
star
49

YOLO-Helper

Python
1
star
50

Image-Processing-Template

1
star
51

VideoLightFormer

PyTorch Implementation of VideoLightFormer
Python
1
star
52

AVLTree-CPP

C++ implementation of AVLTree
C++
1
star
53

YOLO-Label-Crop

Python
1
star
54

CV

test
1
star
55

Genetic-Piecewise-Linear-Approximation

Coursework Project: GPLA(Genetic Piecewise Linear Approximation)
C++
1
star
56

actions-cpp-hello-world

CMake
1
star
57

yolov8-vs-yolo11

The average precision per class for the YOLOv8 and YOLO11 pre-trained on the COCO dataset
Python
1
star
58

pre-commit-tutorial

Python
1
star
59

ML_Lab

ML_Lab
C++
1
star
60

English-Study

λ°©ν•™λ™μ•ˆμ˜ μ˜μ–΄ 곡뢀 기둝, 2019-06-20 ~ 2019-08-30
1
star
61

Precision-and-Recall-Kr

Precision κ³Ό Recall 에 λŒ€ν•œ 이해λ₯Ό λ•κ³ μž μž‘μ„±ν•œ μžλ£Œμž…λ‹ˆλ‹€.
1
star
62

2018-Turtlebot3-Autorace-ROBIT

Kwangwoon University ROBIT software for the 2018 Turtlebot3 Autorace
C++
1
star
63

Color-Space-3D-Visualization

Visualize the Color Space in 3D using Plotly on Google Colab.
1
star
64

hello-pre-commit-and-black-world

Python
1
star
65

LinkedList

κ΄‘μš΄λŒ€ν•™κ΅/2018년도 1ν•™κΈ°/객체지ν–₯ν”„λ‘œκ·Έλž˜λ° 섀계 및 μ‹€μŠ΅/ 3μ°¨ 과제/1. Singly Linked List implementation with templates
C++
1
star
66

Basic-Data-Structures-Implmentation

기본적인 자료 ꡬ쑰에 λŒ€ν•œ c++ κ΅¬ν˜„ μ½”λ“œμž…λ‹ˆλ‹€.
C++
1
star
67

CMT

Python
1
star