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

Unofficial Implementation of Oboe (SIGCOMM'18').

Oboe-Reproduce This is the unofficial implementation of the paper "Oboe: Auto-tuning video ABR algorithms to network conditions, Zahaib Akhtar, Yun Se

Tianchi Huang 13 Nov 04, 2022
Code to reproduce the results for Compositional Attention

Compositional-Attention This repository contains the official implementation for the paper Compositional Attention: Disentangling Search and Retrieval

Sarthak Mittal 58 Nov 30, 2022
N-HiTS: Neural Hierarchical Interpolation for Time Series Forecasting

N-HiTS: Neural Hierarchical Interpolation for Time Series Forecasting Recent progress in neural forecasting instigated significant improvements in the

Cristian Challu 82 Jan 04, 2023
PyTorch original implementation of Cross-lingual Language Model Pretraining.

XLM NEW: Added XLM-R model. PyTorch original implementation of Cross-lingual Language Model Pretraining. Includes: Monolingual language model pretrain

Facebook Research 2.7k Dec 27, 2022
Vehicle detection using machine learning and computer vision techniques for Udacity's Self-Driving Car Engineer Nanodegree.

Vehicle Detection Video demo Overview Vehicle detection using these machine learning and computer vision techniques. Linear SVM HOG(Histogram of Orien

hata 1.1k Dec 18, 2022
Implementation of 'lightweight' GAN, proposed in ICLR 2021, in Pytorch. High resolution image generations that can be trained within a day or two

512x512 flowers after 12 hours of training, 1 gpu 256x256 flowers after 12 hours of training, 1 gpu Pizza 'Lightweight' GAN Implementation of 'lightwe

Phil Wang 1.5k Jan 02, 2023
Our implementation used for the MICCAI 2021 FLARE Challenge titled 'Efficient Multi-Organ Segmentation Using SpatialConfiguartion-Net with Low GPU Memory Requirements'.

Efficient Multi-Organ Segmentation Using SpatialConfiguartion-Net with Low GPU Memory Requirements Our implementation used for the MICCAI 2021 FLARE C

Franz Thaler 3 Sep 27, 2022
Neural Geometric Level of Detail: Real-time Rendering with Implicit 3D Shapes (CVPR 2021 Oral)

Neural Geometric Level of Detail: Real-time Rendering with Implicit 3D Surfaces Official code release for NGLOD. For technical details, please refer t

659 Dec 27, 2022
Code release for "BoxeR: Box-Attention for 2D and 3D Transformers"

BoxeR By Duy-Kien Nguyen, Jihong Ju, Olaf Booij, Martin R. Oswald, Cees Snoek. This repository is an official implementation of the paper BoxeR: Box-A

Nguyen Duy Kien 111 Dec 07, 2022
Whisper is a file-based time-series database format for Graphite.

Whisper Overview Whisper is one of three components within the Graphite project: Graphite-Web, a Django-based web application that renders graphs and

Graphite Project 1.2k Dec 25, 2022
Inference code for "StylePeople: A Generative Model of Fullbody Human Avatars" paper. This code is for the part of the paper describing video-based avatars.

NeuralTextures This is repository with inference code for paper "StylePeople: A Generative Model of Fullbody Human Avatars" (CVPR21). This code is for

Visual Understanding Lab @ Samsung AI Center Moscow 18 Oct 06, 2022
Building blocks for uncertainty-aware cycle consistency presented at NeurIPS'21.

UncertaintyAwareCycleConsistency This repository provides the building blocks and the API for the work presented in the NeurIPS'21 paper Robustness vi

EML Tübingen 19 Dec 12, 2022
Understanding Convolutional Neural Networks from Theoretical Perspective via Volterra Convolution

nnvolterra Run Code Compile first: make compile Run all codes: make all Test xconv: make npxconv_test MNIST dataset needs to be downloaded, converted

1 May 24, 2022
This repository contains a Ruby API for utilizing TensorFlow.

tensorflow.rb Description This repository contains a Ruby API for utilizing TensorFlow. Linux CPU Linux GPU PIP Mac OS CPU Not Configured Not Configur

somatic labs 825 Dec 26, 2022
robomimic: A Modular Framework for Robot Learning from Demonstration

robomimic [Homepage]   [Documentation]   [Study Paper]   [Study Website]   [ARISE Initiative] Latest Updates [08/09/2021] v0.1.0: Initial code and pap

ARISE Initiative 178 Jan 05, 2023
Python package for visualizing the loss landscape of parameterized quantum algorithms.

orqviz A Python package for easily visualizing the loss landscape of Variational Quantum Algorithms by Zapata Computing Inc. orqviz provides a collect

Zapata Computing, Inc. 75 Dec 30, 2022
Paper Title: Heterogeneous Knowledge Distillation for Simultaneous Infrared-Visible Image Fusion and Super-Resolution

HKDnet Paper Title: "Heterogeneous Knowledge Distillation for Simultaneous Infrared-Visible Image Fusion and Super-Resolution" Email:

wasteland 11 Nov 12, 2022
A convolutional recurrent neural network for classifying A/B phases in EEG signals recorded for sleep analysis.

CAP-Classification-CRNN A deep learning model based on Inception modules paired with gated recurrent units (GRU) for the classification of CAP phases

Apurva R. Umredkar 2 Nov 25, 2022
Back to the Feature: Learning Robust Camera Localization from Pixels to Pose (CVPR 2021)

Back to the Feature with PixLoc We introduce PixLoc, a neural network for end-to-end learning of camera localization from an image and a 3D model via

Computer Vision and Geometry Lab 610 Jan 05, 2023
Meta-learning for NLP

Self-Supervised Meta-Learning for Few-Shot Natural Language Classification Tasks Code for training the meta-learning models and fine-tuning on downstr

IESL 43 Nov 08, 2022