The project was to detect traffic signs, based on the Megengine framework.

Overview

trafficsign

赛题

旷视AI智慧交通开源赛道,初赛1/177,复赛1/12。
本赛题为复杂场景的交通标志检测,对五种交通标志进行识别。

框架

megengine

算法方案

  • 网络框架

    • atss + resnext101_32x8d
  • 训练阶段

    • 图片尺寸
      最终提交版本输入图片尺寸为(1500,2100)

    • 多尺度训练(最终提交版本未采用)
      起初我们将短边设为(1024, 1056, 1088, 1120, 1152, 1184, 1216, 1248, 1280, 1312, 1344, 1376, 1408),随机选取短边后,长边按比例缩放,并使长边长度小于1800,从而进行多尺度训练,取得了很好的效果。 不过后期的mosaic和mixup在增强时对图片进行了缩放,实则隐含了多尺度训练,且效果优于上述方法,所以我们最终去掉了多尺度训练。

    • 数据增强

      • mosaic增强

        随机选择四张图片,对图片进行随机平移10%,尺度缩放(0.5,2.0),shear 0.1,最后将四张图片进行组合。

      • mixup增强

        随机选取两张图进行叠加,我们最终选用的比例是0.5 * 原图+0.5 * 新图片,同时其进行缩放(0.5,2.0)。

        下图为mosaic+mixup示例图:

        mosaic+mixup

      • 随机水平翻转

        直接对图片进行翻转,会导致第三个类别“arr_l”(左转线)和右转线混淆,故我们添加了class-aware的翻转,遇到有“arr_l”类的图片则不进行翻转。

      • 基于Albumentations库的各种增强(最终提交版本未采用)

        我们尝试了ShiftScaleRotate(验证集+0.5)、CLANE(验证集+1.0)、RandomBrightnessContrast等,但组合起来测试集提点欠佳,所以最后没用。

      • gridmask增强(最终提交版本未采用)

        生成一个和原图相同分辨率的mask(每个grid上全为0或全为1),然后将该mask与原图相乘得到一个图像。提点欠佳,所以没采用。

      • 类别平衡采样(最终提交版本未采用)

        使用类别平衡采样后,效果不是很好,这可能是因为数据集本身没有严重的类别不均衡。下面是我们统计的每个类别在图片中出现的频率。

        红灯 直行线 左转线 禁止行驶 禁止停车
        频率 0.356 0.228 0.201 0.257 0.485
  • 多尺度测试

    • 多尺度测试图片尺寸

      最后提交版本(2100,2700),(2100,2800),(2400,3200),如果继续增加尺度,map还会继续提高。

    • topk—nms

      对上述三个尺度生成的结果先进行nms,再将得到的结果框与剩下所有框进行topk—nms(保留与当前结果框iou大于0.85的topk的框,把这些框的坐标进行融合),参数设置vote_thresh=0.85, k=5。

  • 网络结构

    • 加上增强后,backbone从res50到res101再到resx101有稳定涨点。

    • 我们还在backbone部分尝试了dcn和gcnet,验证集收效甚微,最终没有采用。

模型训练与测试

  • 数据集位置
/path/to/ 
    |->traffic   
    |    |images     
    |    |annotations->|train.json     
    |    |             |val.json     
    |    |             |test.json      
  • 训练测试

在加上增强后,我们训练了36个epoch。

pip3 install --user -r requirements.txt

export PYTHONPATH=your_path/trafficsign:$PYTHONPATH

cd weights && wget https://data.megengine.org.cn/models/weights/atss_resx101_coco_2x_800size_45dot6_b3a91b36.pkl

python3 tools/train.py -n 4 -b 2 -f configs/atss_resx101_final.py -d your_datasetpath -w weights/atss_resx101_coco_2x_800size_45dot6_b3a91b36.pkl

python3 tools/test_final.py -n 4 -se 35 -f configs/atss_resx101_final.py -d your_datasetpath 

(-n 能抢到几张卡就写几吧qaq)

备注

以上提到的所有方法,无论最终是否采用,代码中均有实现。

感谢

https://github.com/MegEngine/Models/tree/master/official/vision/detection

https://github.com/MegEngine/YOLOX

Beginner-friendly repository for Hacktober Fest 2021. Start your contribution to open source through baby steps. 💜

Hacktober Fest 2021 🎉 Open source is changing the world – one contribution at a time! 🎉 This repository is made for beginners who are unfamiliar wit

Abhilash M Nair 32 Dec 11, 2022
Project of 'TBEFN: A Two-branch Exposure-fusion Network for Low-light Image Enhancement '

TBEFN: A Two-branch Exposure-fusion Network for Low-light Image Enhancement Codes for TMM20 paper "TBEFN: A Two-branch Exposure-fusion Network for Low

KUN LU 31 Nov 06, 2022
Python and Julia in harmony.

PythonCall & JuliaCall Bringing Python® and Julia together in seamless harmony: Call Python code from Julia and Julia code from Python via a symmetric

Christopher Rowley 414 Jan 07, 2023
Cosine Annealing With Warmup

CosineAnnealingWithWarmup Formulation The learning rate is annealed using a cosine schedule over the course of learning of n_total total steps with an

zhuyun 4 Apr 18, 2022
Codes for our paper The Stem Cell Hypothesis: Dilemma behind Multi-Task Learning with Transformer Encoders published to EMNLP 2021.

The Stem Cell Hypothesis Codes for our paper The Stem Cell Hypothesis: Dilemma behind Multi-Task Learning with Transformer Encoders published to EMNLP

Emory NLP 5 Jul 08, 2022
StarGAN2 for practice

StarGAN2 for practice This version of StarGAN2 (coined as 'Post-modern Style Transfer') is intended mostly for fellow artists, who rarely look at scie

vadim epstein 87 Sep 24, 2022
Lecture materials for Cornell CS5785 Applied Machine Learning (Fall 2021)

Applied Machine Learning (Cornell CS5785, Fall 2021) This repo contains executable course notes and slides for the Applied ML course at Cornell and Co

Volodymyr Kuleshov 103 Dec 31, 2022
Graph Representation Learning via Graphical Mutual Information Maximization

GMI (Graphical Mutual Information) Graph Representation Learning via Graphical Mutual Information Maximization (Peng Z, Huang W, Luo M, et al., WWW 20

93 Dec 29, 2022
Python implementation of "Multi-Instance Pose Networks: Rethinking Top-Down Pose Estimation"

MIPNet: Multi-Instance Pose Networks This repository is the official pytorch python implementation of "Multi-Instance Pose Networks: Rethinking Top-Do

Rawal Khirodkar 57 Dec 12, 2022
Goal of the project : Detecting Temporal Boundaries in Sign Language videos

MVA RecVis course final project : Goal of the project : Detecting Temporal Boundaries in Sign Language videos. Sign language automatic indexing is an

Loubna Ben Allal 6 Dec 21, 2022
Predictive Modeling on Electronic Health Records(EHR) using Pytorch

Predictive Modeling on Electronic Health Records(EHR) using Pytorch Overview Although there are plenty of repos on vision and NLP models, there are ve

81 Jan 01, 2023
XViT - Space-time Mixing Attention for Video Transformer

XViT - Space-time Mixing Attention for Video Transformer This is the official implementation of the XViT paper: @inproceedings{bulat2021space, title

Adrian Bulat 33 Dec 23, 2022
Galactic and gravitational dynamics in Python

Gala is a Python package for Galactic and gravitational dynamics. Documentation The documentation for Gala is hosted on Read the docs. Installation an

Adrian Price-Whelan 101 Dec 22, 2022
Adaptive Graph Convolution for Point Cloud Analysis

Adaptive Graph Convolution for Point Cloud Analysis This repository contains the implementation of AdaptConv for point cloud analysis. Adaptive Graph

64 Dec 21, 2022
Moving Object Segmentation in 3D LiDAR Data: A Learning-based Approach Exploiting Sequential Data

LiDAR-MOS: Moving Object Segmentation in 3D LiDAR Data This repo contains the code for our paper: Moving Object Segmentation in 3D LiDAR Data: A Learn

Photogrammetry & Robotics Bonn 394 Dec 29, 2022
Unrestricted Facial Geometry Reconstruction Using Image-to-Image Translation

Unrestricted Facial Geometry Reconstruction Using Image-to-Image Translation [Arxiv] [Video] Evaluation code for Unrestricted Facial Geometry Reconstr

Matan Sela 242 Dec 30, 2022
A complete end-to-end demonstration in which we collect training data in Unity and use that data to train a deep neural network to predict the pose of a cube. This model is then deployed in a simulated robotic pick-and-place task.

Object Pose Estimation Demo This tutorial will go through the steps necessary to perform pose estimation with a UR3 robotic arm in Unity. You’ll gain

Unity Technologies 187 Dec 24, 2022
Deep Unsupervised 3D SfM Face Reconstruction Based on Massive Landmark Bundle Adjustment.

(ACMMM 2021 Oral) SfM Face Reconstruction Based on Massive Landmark Bundle Adjustment This repository shows two tasks: Face landmark detection and Fac

BoomStar 51 Dec 13, 2022
Implementation of our paper 'RESA: Recurrent Feature-Shift Aggregator for Lane Detection' in AAAI2021.

RESA PyTorch implementation of the paper "RESA: Recurrent Feature-Shift Aggregator for Lane Detection". Our paper has been accepted by AAAI2021. Intro

137 Jan 02, 2023
AFL binary instrumentation

E9AFL --- Binary AFL E9AFL inserts American Fuzzy Lop (AFL) instrumentation into x86_64 Linux binaries. This allows binaries to be fuzzed without the

242 Dec 12, 2022