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

This is an unofficial implementation of the paper “Student-Teacher Feature Pyramid Matching for Unsupervised Anomaly Detection”.

This is an unofficial implementation of the paper “Student-Teacher Feature Pyramid Matching for Unsupervised Anomaly Detection”.

haifeng xia 32 Oct 26, 2022
Deduplicating Training Data Makes Language Models Better

Deduplicating Training Data Makes Language Models Better This repository contains code to deduplicate language model datasets as descrbed in the paper

Google Research 431 Dec 27, 2022
Pytorch implementation of paper Semi-supervised Knowledge Transfer for Deep Learning from Private Training Data

Pytorch implementation of paper Semi-supervised Knowledge Transfer for Deep Learning from Private Training Data

Hrishikesh Kamath 31 Nov 20, 2022
Optimal space decomposition based-product quantization for approximate nearest neighbor search

Optimal space decomposition based-product quantization for approximate nearest neighbor search Abstract Product quantization(PQ) is an effective neare

Mylove 1 Nov 19, 2021
Music Classification: Beyond Supervised Learning, Towards Real-world Applications

Music Classification: Beyond Supervised Learning, Towards Real-world Applications

104 Dec 15, 2022
This is the pytorch re-implementation of the IterNorm

IterNorm-pytorch Pytorch reimplementation of the IterNorm methods, which is described in the following paper: Iterative Normalization: Beyond Standard

Lei Huang 32 Dec 27, 2022
Ganilla - Official Pytorch implementation of GANILLA

GANILLA We provide PyTorch implementation for: GANILLA: Generative Adversarial Networks for Image to Illustration Translation. Paper Arxiv Updates (Fe

Samet Hi 462 Dec 05, 2022
Python Rapid Artificial Intelligence Ab Initio Molecular Dynamics

Python Rapid Artificial Intelligence Ab Initio Molecular Dynamics

14 Nov 06, 2022
A video scene detection algorithm is designed to detect a variety of different scenes within a video

Scene-Change-Detection - A video scene detection algorithm is designed to detect a variety of different scenes within a video. There is a very simple definition for a scene: It is a series of logical

1 Jan 04, 2022
This repo in the implementation of EMNLP'21 paper "SPARQLing Database Queries from Intermediate Question Decompositions" by Irina Saparina, Anton Osokin

SPARQLing Database Queries from Intermediate Question Decompositions This repo is the implementation of the following paper: SPARQLing Database Querie

Yandex Research 20 Dec 19, 2022
YOLOX-CondInst - Implement CondInst which is a instances segmentation method on YOLOX

YOLOX CondInst -- YOLOX 实例分割 前言 本项目是自己学习实例分割时,复现的代码. 通过自己编程,让自己对实例分割有更进一步的了解。 若想

DDGRCF 16 Nov 18, 2022
This repo contains source code and materials for the TEmporally COherent GAN SIGGRAPH project.

TecoGAN This repository contains source code and materials for the TecoGAN project, i.e. code for a TEmporally COherent GAN for video super-resolution

Nils Thuerey 5.2k Jan 02, 2023
Semi-Supervised Signed Clustering Graph Neural Network (and Implementation of Some Spectral Methods)

SSSNET SSSNET: Semi-Supervised Signed Network Clustering For details, please read our paper. Environment Setup Overview The project has been tested on

Yixuan He 9 Nov 24, 2022
An alarm clock coded in Python 3 with Tkinter

Tkinter-Alarm-Clock An alarm clock coded in Python 3 with Tkinter. Run python3 Tkinter Alarm Clock.py in a terminal if you have Python 3. NOTE: This p

CodeMaster7000 1 Dec 25, 2021
FedMM: Saddle Point Optimization for Federated Adversarial Domain Adaptation

This repository contains the code accompanying the paper " FedMM: Saddle Point Optimization for Federated Adversarial Domain Adaptation" Paper link: R

20 Jun 29, 2022
A2LP for short, ECCV2020 spotlight, Investigating SSL principles for UDA problems

Label-Propagation-with-Augmented-Anchors (A2LP) Official codes of the ECCV2020 spotlight (label propagation with augmented anchors: a simple semi-supe

20 Oct 27, 2022
[LREC] MMChat: Multi-Modal Chat Dataset on Social Media

MMChat This repo contains the code and data for the LREC2022 paper MMChat: Multi-Modal Chat Dataset on Social Media. Dataset MMChat is a large-scale d

Silver 47 Jan 03, 2023
PixelPick This is an official implementation of the paper "All you need are a few pixels: semantic segmentation with PixelPick."

PixelPick This is an official implementation of the paper "All you need are a few pixels: semantic segmentation with PixelPick." [Project page] [Paper

Gyungin Shin 59 Sep 25, 2022
LoveDA: A Remote Sensing Land-Cover Dataset for Domain Adaptive Semantic Segmentation

LoveDA: A Remote Sensing Land-Cover Dataset for Domain Adaptive Semantic Segmentation by Junjue Wang, Zhuo Zheng, Ailong Ma, Xiaoyan Lu, and Yanfei Zh

Payphone 8 Nov 21, 2022
A flag generation AI created using DeepAIs API

Vex AI or Vexiology AI is an Artifical Intelligence created to generate custom made flag design texts. It uses DeepAIs API. Please be aware that you must include your own DeepAI API key. See instruct

Bernie 10 Apr 06, 2022