DeepTrial / Few-shot-Object-Detection-via-Feature-Reweighting

25 stars 9 forks source link
detection few-shot pascal-voc

Few-shot Object Detection via Feature Reweighting (Remake Version)

This repo is the remake version for the original code of https://github.com/bingykang/Fewshot_Detection .

If any problems, open an issue!

What I Have Done:

Additional Details:

dataset dir

In this code, you have to prepare dataset as the original code did. Please remember to change the root dir of text file in the ./data/ path, such as voc_traindict_bbox_1shot.txt.

result of k-shot k=1,2,5,10

the base training part is always the same for different k, but the finetune part is different. To check the result of k-shot(k=1,2,5,10), you have to find the file: ./cfg/metatune.data

find the code meta = data/voc_traindict_bbox_5shot.txt and change the num 5 to 1 or others.

why proposal is decreased to 0?

Don't worry! It will increase after several epochs.

memory usage / cuda out of memory

Since the detection part is based on yolov2, multi-scale training is used. After the beginning few epochs(maybe 20), the input shape will change from (416,416) to (512,512) or random shape. Choose an adaptive batch size is very important!.

Original Readme

Implementation for the paper:

Few-shot Object Detection via Feature Reweighting, ICCV 2019

Bingyi Kang*, Zhuang Liu*, Xin Wang, Fisher Yu, Jiashi Feng and Trevor Darrell (* equal contribution)

Our code is based on https://github.com/marvis/pytorch-yolo2 and developed with Python 2.7 & PyTorch 0.3.1.

Training our model on VOC

Prepare dataset

You may want to generate new few-shot datasets Change the ''DROOT'' varibale in scripts/gen_fewlist.py to $DATA_ROOT

python scripts/gen_fewlist.py # might be different with ours

Base Training

Few-shot Tuning

Citation

@inproceedings{kang2019few,
  title={Few-shot Object Detection via Feature Reweighting},
  author={Kang, Bingyi and Liu, Zhuang and Wang, Xin and Yu, Fisher and Feng, Jiashi and Darrell, Trevor},
  booktitle={ICCV},
  year={2019}
}