[CVPR 2022] Official Pytorch code for OW-DETR: Open-world Detection Transformer

Overview

OW-DETR: Open-world Detection Transformer (CVPR 2022)

[Paper]

Akshita Gupta*, Sanath Narayan*, K J Joseph, Salman Khan, Fahad Shahbaz Khan, Mubarak Shah

( 🌟 denotes equal contribution)

Introduction

Open-world object detection (OWOD) is a challenging computer vision problem, where the task is to detect a known set of object categories while simultaneously identifying unknown objects. Additionally, the model must incrementally learn new classes that become known in the next training episodes. Distinct from standard object detection, the OWOD setting poses significant challenges for generating quality candidate proposals on potentially unknown objects, separating the unknown objects from the background and detecting diverse unknown objects. Here, we introduce a novel end-to-end transformer-based framework, OW-DETR, for open-world object detection. The proposed OW-DETR comprises three dedicated components namely, attention-driven pseudo-labeling, novelty classification and objectness scoring to explicitly address the aforementioned OWOD challenges. Our OW-DETR explicitly encodes multi-scale contextual information, possesses less inductive bias, enables knowledge transfer from known classes to the unknown class and can better discriminate between unknown objects and background. Comprehensive experiments are performed on two benchmarks: MS-COCO and PASCAL VOC. The extensive ablations reveal the merits of our proposed contributions. Further, our model outperforms the recently introduced OWOD approach, ORE, with absolute gains ranging from $1.8%$ to $3.3%$ in terms of unknown recall on MS-COCO. In the case of incremental object detection, OW-DETR outperforms the state-of-the-art for all settings on PASCAL VOC.


Installation

Requirements

We have trained and tested our models on Ubuntu 16.0, CUDA 10.2, GCC 5.4, Python 3.7

conda create -n owdetr python=3.7 pip
conda activate owdetr
conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=10.2 -c pytorch
pip install -r requirements.txt

Compiling CUDA operators

cd ./models/ops
sh ./make.sh
# unit test (should see all checking is True)
python test.py

Dataset & Results

OWOD proposed splits



The splits are present inside data/VOC2007/OWOD/ImageSets/ folder. The remaining dataset can be downloaded using this link

The files should be organized in the following structure:

OW-DETR/
└── data/
    └── VOC2007/
        └── OWOD/
        	β”œβ”€β”€ JPEGImages
        	β”œβ”€β”€ ImageSets
        	└── Annotations

Results

Task1 Task2 Task3 Task4
Method U-Recall mAP U-Recall mAP U-Recall mAP mAP
ORE-EBUI 4.9 56.0 2.9 39.4 3.9 29.7 25.3
OW-DETR 7.5 59.2 6.2 42.9 5.7 30.8 27.8

Our proposed splits



The splits are present inside data/VOC2007/OWDETR/ImageSets/ folder. The remaining dataset can be downloaded using this link

The files should be organized in the following structure:

OW-DETR/
└── data/
    └── VOC2007/
        └── OWDETR/
        	β”œβ”€β”€ JPEGImages
        	β”œβ”€β”€ ImageSets
        	└── Annotations

Currently, Dataloader and Evaluator followed for OW-DETR is in VOC format.

Results

Task1 Task2 Task3 Task4
Method U-Recall mAP U-Recall mAP U-Recall mAP mAP
ORE-EBUI 1.5 61.4 3.9 40.6 3.6 33.7 31.8
OW-DETR 5.7 71.5 6.2 43.8 6.9 38.5 33.1

Training

Training on single node

To train OW-DETR on a single node with 8 GPUS, run

./run.sh

Training on slurm cluster

To train OW-DETR on a slurm cluster having 2 nodes with 8 GPUS each, run

sbatch run_slurm.sh

Evaluation

For reproducing any of the above mentioned results please run the run_eval.sh file and add pretrained weights accordingly.

Note: For more training and evaluation details please check the Deformable DETR reposistory.

License

This repository is released under the Apache 2.0 license as found in the LICENSE file.

Citation

If you use OW-DETR, please consider citing:

@inproceedings{gupta2021ow,
    title={OW-DETR: Open-world Detection Transformer}, 
    author={Gupta, Akshita and Narayan, Sanath and Joseph, KJ and 
    Khan, Salman and Khan, Fahad Shahbaz and Shah, Mubarak},
    booktitle={CVPR},
    year={2022}
}

Contact

Should you have any question, please contact πŸ“§ [email protected]

Acknowledgments:

OW-DETR builds on previous works code base such as Deformable DETR, Detreg, and OWOD. If you found OW-DETR useful please consider citing these works as well.

Comments
  • the results of task1

    the results of task1

    In Task1, my current class AP50 was 73.0, which was quite different from the results in the paper, and the U-recall was only 4.4. I don't know why. Can you upload the trained weight file?

    opened by aooating 17
  • The training schedule

    The training schedule

    Dear Author,

    In the paper, I see that every task is trained for 50 epochs and finetuned for 20 epochs as 13291a30151dcbb1fe48d3092ce85ce

    However, in configs/OWOD_new_split.sh, I see the training schedule is following a different setting as highlighted by the red boxes. e2489ae780a580596b7bbb8e7fb1c3a

    Is there anything I missed? Looking forward to your reply. Thanks.

    opened by luckychay 8
  • RuntimeError: CUDA out of memory.

    RuntimeError: CUDA out of memory.

    When I execute 'python test.py', I meet the problem

    • True check_forward_equal_with_pytorch_double: max_abs_err 8.67e-19 max_rel_err 2.35e-16
    • True check_forward_equal_with_pytorch_float: max_abs_err 4.66e-10 max_rel_err 1.13e-07
    • True check_gradient_numerical(D=30)
    • True check_gradient_numerical(D=32)
    • True check_gradient_numerical(D=64)
    • True check_gradient_numerical(D=71) Traceback (most recent call last): File "test.py", line 87, in check_gradient_numerical(channels, True, True, True) File "test.py", line 77, in check_gradient_numerical gradok = gradcheck(func, (value.double(), shapes, level_start_index, sampling_locations.double(), attention_weights.double(), im2col_step)) File "/home/long/miniconda3/envs/owdetr/lib/python3.7/site-packages/torch/autograd/gradcheck.py", line 423, in gradcheck nondet_tol=nondet_tol) File "/home/long/miniconda3/envs/owdetr/lib/python3.7/site-packages/torch/autograd/gradcheck.py", line 174, in get_analytical_jacobian jacobian_reentrant = make_jacobian(input, output.numel()) File "/home/long/miniconda3/envs/owdetr/lib/python3.7/site-packages/torch/autograd/gradcheck.py", line 31, in make_jacobian lambda x: x is not None, (make_jacobian(elem, num_out) for elem in input))) File "/home/long/miniconda3/envs/owdetr/lib/python3.7/site-packages/torch/autograd/gradcheck.py", line 31, in lambda x: x is not None, (make_jacobian(elem, num_out) for elem in input))) File "/home/long/miniconda3/envs/owdetr/lib/python3.7/site-packages/torch/autograd/gradcheck.py", line 28, in make_jacobian return input.new_zeros((input.nelement(), num_out), dtype=input.dtype, layout=torch.strided) RuntimeError: CUDA out of memory. Tried to allocate 1.88 GiB (GPU 0; 3.95 GiB total capacity; 1.88 GiB already allocated; 925.62 MiB free; 1.90 GiB reserved in total by PyTorch)

    Even I try the command on RTX3090 or A100, the problem is still here. Does this problem have bad influence in training and reference ?

    opened by kun-dragon 4
  • No such file or directory

    No such file or directory

    thank you for your code,but I ran into some problems.

    1. No such file or directory: '/OW-DETR/data/OWDETR/VOC2007/ImageSets/t4_ft_new_split.txt
    2. FileNotFoundError: [Errno 2] No such file or directory: '/proj/cvl/users/x_fahkh/akshita/Deformable-DETR/models/dino_resnet50_pretrain/dino_resnet50_pretrain.pth'
    3. The link is still disabled

    I didn't find these in the code or information you provided, can you please tell me where to find these files,thank you ~

    opened by Innary 3
  • RuntimeError: CUDA out of memory, in t1_train task.

    RuntimeError: CUDA out of memory, in t1_train task.

    Our gpu devices are RTX 2080TIs with only 11GB memory, but the training data requires 10-12GB GPU memory (as far as I know).

    Is there any configuration to reduce the runtime memory requirements?

    opened by lianghrx 1
  • Problems of OWOD proposed splits in Task 1

    Problems of OWOD proposed splits in Task 1

    Hello, when training with OWOD proposed splits, why are there 5 '0.0' in AP50? Task 1 "AP50 ": "['64.0', '32.8', '30.0', '26.5', '57.1', '38.1', '78.3', '43.1', '60.7', '45.9', '46.3', '42.9', '69.9', '0.0', '0.0', '0.0', '0.0', '0.0', '54.3', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.3']" owod

    opened by Wang0203 1
  • About ImageSets

    About ImageSets

    int the data/OWDETR/VOC2007/ImageSets/ files are: t1_train.txt t2_train.txt t2_ft.txt
    t3_train.txt t3_ft.txt t4_train.txt t4_ft.txt
    but int the 'OWOD_new_split.sh' file, '--train_set' parameters are: t1_train_new_split t2_train_new_split t2_ft_new_split t3_train_new_split t3_ft_new_split t4_train_new_split t4_ft_new_split

    I guess that we just need to add '_new_split' to the original file name in data/OWDETR/VOC2007/ImageSets/. Is that right

    opened by kun-dragon 1
  • how do you select K from M=200

    how do you select K from M=200

    In implementation details, you mentioned M=200, as the number of object queries. K from M for known object detection. From M-K object queries, the top k_u is set as 5 for detecting the pseudo-unknown objects, how do you set the number of K? Is K from the number of object-queries that the novel classifier output as non-zero, or it was empirically set as a fixed number?

    opened by luoyuchenmlcv 1
  • about the backbone

    about the backbone "DINO resnet50" and do IL

    code print("DINO resnet50") backbone = resnet50(pretrained=False, replace_stride_with_dilation=[False, False, dilation], norm_layer=norm_layer) if is_main_process(): state_dict = torch.load("/proj/cvl/users/x_fahkh/akshita/Deformable-DETR/models/dino_resnet50_pretrain/dino_resnet50_pretrain.pth") backbone.load_state_dict(state_dict, strict=False) in backbone.py
    I want to know how to get this pretrained model? use ImageNet or the first task's images? and I would like to ask if you are not using any incremental training paradigm (e.g. knowledge distillation) because I don't see the relevant part in the code. Thank you for such an excellent work.

    opened by Voyage-Wang 1
  • Foreground Objectness

    Foreground Objectness

    Dear authors,

    I compared your code with standard Deformable DETR and didn't find corresponding code of section 2.5.Foreground Objectness, could you please point out it for me? Thanks a lot!

    Best regards

    opened by luckychay 0
  • CVE-2007-4559 Patch

    CVE-2007-4559 Patch

    Patching CVE-2007-4559

    Hi, we are security researchers from the Advanced Research Center at Trellix. We have began a campaign to patch a widespread bug named CVE-2007-4559. CVE-2007-4559 is a 15 year old bug in the Python tarfile package. By using extract() or extractall() on a tarfile object without sanitizing input, a maliciously crafted .tar file could perform a directory path traversal attack. We found at least one unsantized extractall() in your codebase and are providing a patch for you via pull request. The patch essentially checks to see if all tarfile members will be extracted safely and throws an exception otherwise. We encourage you to use this patch or your own solution to secure against CVE-2007-4559. Further technical information about the vulnerability can be found in this blog.

    If you have further questions you may contact us through this projects lead researcher Kasimir Schulz.

    opened by TrellixVulnTeam 0
  • OWOD data split doesn't work.

    OWOD data split doesn't work.

    Hi, So I have been trying to implement the old TOWOD data split. I found that the images specified there are the VOC2007 classes. However, there is a bug where the classes defined at the top of "datasets/torchvision_datasets/open_world.py" are not the VOC2007 classes:

    VOC_CLASS_NAMES = [ "aeroplane","bicycle","bird","boat","bus","car", "cat","cow","dog","horse","motorbike","sheep","train", "elephant","bear","zebra","giraffe","truck","person" ]

    and missing: bottle, chair, dining table, potted plant, sofa, tv/monitor.

    Did you train on these classes when you report the results of task 1 table 1? did you use the VOC2007 classes? if so, could you upload the scripts you used?

    Thank you in advance

    opened by orrzohar 2
Owner
Akshita Gupta
Sem @IITR | Outreachy @mozilla | Research Engineer @IIAI
Akshita Gupta
[ICLR 2022] DAB-DETR: Dynamic Anchor Boxes are Better Queries for DETR

DAB-DETR This is the official pytorch implementation of our ICLR 2022 paper DAB-DETR. Authors: Shilong Liu, Feng Li, Hao Zhang, Xiao Yang, Xianbiao Qi

null 336 Dec 25, 2022
Official PyTorch implementation for Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder Transformers, a novel method to visualize any Transformer-based network. Including examples for DETR, VQA.

PyTorch Implementation of Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder Transformers 1 Using Colab Please notic

Hila Chefer 489 Jan 7, 2023
[CVPR 2022] CoTTA Code for our CVPR 2022 paper Continual Test-Time Domain Adaptation

CoTTA Code for our CVPR 2022 paper Continual Test-Time Domain Adaptation Prerequisite Please create and activate the following conda envrionment. To r

Qin Wang 87 Jan 8, 2023
Official code of the paper "Expanding Low-Density Latent Regions for Open-Set Object Detection" (CVPR 2022)

OpenDet Expanding Low-Density Latent Regions for Open-Set Object Detection (CVPR2022) Jiaming Han, Yuqiang Ren, Jian Ding, Xingjia Pan, Ke Yan, Gui-So

csuhan 64 Jan 7, 2023
Code for "Neural 3D Scene Reconstruction with the Manhattan-world Assumption" CVPR 2022 Oral

News 05/10/2022 To make the comparison on ScanNet easier, we provide all quantitative and qualitative results of baselines here, including COLMAP, COL

ZJU3DV 365 Dec 30, 2022
Official source code of Fast Point Transformer, CVPR 2022

Fast Point Transformer Project Page | Paper This repository contains the official source code and data for our paper: Fast Point Transformer Chunghyun

null 182 Dec 23, 2022
[CVPR2021 Oral] UP-DETR: Unsupervised Pre-training for Object Detection with Transformers

UP-DETR: Unsupervised Pre-training for Object Detection with Transformers This is the official PyTorch implementation and models for UP-DETR paper: @a

dddzg 430 Dec 23, 2022
PED: DETR for Crowd Pedestrian Detection

PED: DETR for Crowd Pedestrian Detection Code for PED: DETR For (Crowd) Pedestrian Detection Paper PED: DETR for Crowd Pedestrian Detection Installati

null 36 Sep 13, 2022
Official implementation of the ICCV 2021 paper "Conditional DETR for Fast Training Convergence".

The DETR approach applies the transformer encoder and decoder architecture to object detection and achieves promising performance. In this paper, we handle the critical issue, slow training convergence, and present a conditional cross-attention mechanism for fast DETR training. Our approach is motivated by that the cross-attention in DETR relies highly on the content embeddings and that the spatial embeddings make minor contributions, increasing the need for high-quality content embeddings and thus increasing the training difficulty.

null 281 Dec 30, 2022
Voxel Set Transformer: A Set-to-Set Approach to 3D Object Detection from Point Clouds (CVPR 2022)

Voxel Set Transformer: A Set-to-Set Approach to 3D Object Detection from Point Clouds (CVPR2022)[paper] Authors: Chenhang He, Ruihuang Li, Shuai Li, L

Billy HE 141 Dec 30, 2022
Pytorch implementation for "Large-Scale Long-Tailed Recognition in an Open World" (CVPR 2019 ORAL)

Large-Scale Long-Tailed Recognition in an Open World [Project] [Paper] [Blog] Overview Open Long-Tailed Recognition (OLTR) is the author's re-implemen

Zhongqi Miao 761 Dec 26, 2022
Official implementation for "Style Transformer for Image Inversion and Editing" (CVPR 2022)

Style Transformer for Image Inversion and Editing (CVPR2022) https://arxiv.org/abs/2203.07932 Existing GAN inversion methods fail to provide latent co

Xueqi Hu 153 Dec 2, 2022
Moment-DETR code and QVHighlights dataset

Moment-DETR QVHighlights: Detecting Moments and Highlights in Videos via Natural Language Queries Jie Lei, Tamara L. Berg, Mohit Bansal For dataset de

Jie Lei 雷杰 133 Dec 22, 2022
Sound-guided Semantic Image Manipulation - Official Pytorch Code (CVPR 2022)

?? Sound-guided Semantic Image Manipulation (CVPR2022) Official Pytorch Implementation Sound-guided Semantic Image Manipulation IEEE/CVF Conference on

CVLAB 58 Dec 28, 2022
Official implementation of "Can You Spot the Chameleon? Adversarially Camouflaging Images from Co-Salient Object Detection" in CVPR 2022.

Jadena Official implementation of "Can You Spot the Chameleon? Adversarially Camouflaging Images from Co-Salient Object Detection" in CVPR 2022. arXiv

Qing Guo 13 Nov 29, 2022
Imposter-detector-2022 - HackED 2022 Team 3IQ - 2022 Imposter Detector

HackED 2022 Team 3IQ - 2022 Imposter Detector By Aneeljyot Alagh, Curtis Kan, Jo

Joshua Ji 3 Aug 20, 2022
The 7th edition of NTIRE: New Trends in Image Restoration and Enhancement workshop will be held on June 2022 in conjunction with CVPR 2022.

NTIRE 2022 - Image Inpainting Challenge Important dates 2022.02.01: Release of train data (input and output images) and validation data (only input) 2

AndrΓ©s Romero 37 Nov 27, 2022
Deformable DETR is an efficient and fast-converging end-to-end object detector.

Deformable DETR: Deformable Transformers for End-to-End Object Detection.

null 2k Jan 5, 2023
Open-source code for Generic Grouping Network (GGN, CVPR 2022)

Open-World Instance Segmentation: Exploiting Pseudo Ground Truth From Learned Pairwise Affinity Pytorch implementation for "Open-World Instance Segmen

Meta Research 99 Dec 6, 2022