Giter VIP home page Giter VIP logo

asgnet's Introduction

ASGNet

The code is for the paper "Adaptive Prototype Learning and Allocation for Few-Shot Segmentation" (accepted to CVPR 2021) [arxiv]

Overview

  • data/ includes config files and train/validation list files
  • model/ includes related model and module
  • tool/ includes training and testing scripts
  • util/ includes data processing, seed initialization

Usage

Requirements

python==3.7, torch==1.6, scipy, opencv-python, tensorboardX

Dataset

Prepare related datasets: Pascal-5i (VOC 2012, SBD) and COCO-20i (COCO 2014)

Pre-trained models

  • Pre-trained backbones and models can be found in Google Driver
  • Download backbones and put the pth files under initmodel/ folder

Test and Train

  • Specify the path of datasets and pre-trained models in the data/config file
  • Use the following command
    sh tool/test.sh|train.sh {data} {model} {split_backbone}
    

E.g. Test ASGNet with ResNet50 on the split 0 of PASCAL-5i:

sh tool/test.sh pascal asgnet split0_resnet50

Citation

Please consider citing the paper if you find it useful:

@inproceedings{li2021AdaptivePL,
  title={Adaptive Prototype Learning and Allocation for Few-Shot Segmentation},
  author={Gen Li and Varun Jampani and Laura Sevilla-Lara and Deqing Sun and Jonghyun Kim and Joongkyu Kim},
  booktitle={CVPR},
  year={2021}
}

References

The code is based on semseg and PFENet. Thanks for their great work!

asgnet's People

Contributors

reagan1311 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

asgnet's Issues

datasets

Dear author:
When I use the Pascal-5i dataset,label image is colorful,after label_class = np.unique(label).tolist(),it can't be satisfied in the sub_list

TypeError: 'int' object is not iterable

Hello, thanks for work!
I have some problem when I try to train the model with pascal set. I follow the step show in the github page, and run:
sh tool/train.sh pascal asgnet split0_resnet50
but I get the error as follow:

[2022-02-22 16:10:06,166 INFO train.py line 329 19996] >>>>>>>>>>>>>>>> Start Evaluation >>>>>>>>>>>>>>>> Traceback (most recent call last): File "/opt/conda/envs/dual_learning/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/opt/conda/envs/dual_learning/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/tool/train.py", line 450, in <module> main() File "/home/tool/train.py", line 91, in main main_worker(args.train_gpu, args.ngpus_per_node, args) File "/home/tool/train.py", line 207, in main_worker loss_val, mIoU_val, mAcc_val, allAcc_val, class_miou = validate(val_loader, model, criterion) File "/home/tool/train.py", line 421, in validate allAcc = sum(intersection_meter.sum) / (sum(target_meter.sum) + 1e-10) TypeError: 'int' object is not iterable

I try to solve this, and I found the "intersection_meter.sum" belongs to "int" type, which leads to the error. As normal, the 'intersection_meter.sum' should be a list or array? Where ma'y I go wrong?
Thanks a lot1

model

Hello,I want to konw if the pretained models in Google Drive is the best.pth in training.
Because I ues it in test.py,loss is 0.66.

The mIoU of split0 is lower than that in the paper

Thank for sharing your code. When I run the training by
sh tools/train.sh pascal asgnet split0_resnet50
with your default setting and run the testing by
sh tools/test.sh pascal asgnet split0_resnet50
using the checkpoint final.pth, I get the miou of 0.5389 which is much lower than 58.84 in the paper. Do I miss some steps ?

how to prepare the datasets?

Hello, I'm sorry to disturb you, but I am a beginner and I have encountered some problems when preparing the COCO and PASCAL data sets.

  1. After I downloaded the VOC2012 data set, I found that there were only about 2000 pictures, but there were more than 5000 data in ASGNet/data/lists/pascal/voc_sbd_merge_noduplicate.txt. And then, I think maybe I should use VOC2012Aug, but there are more than 10000 pictures in VOC2012Aug.
  2. I downloaded the COCO data train/test/val in the warehouse link and decompressed them, but I did not find the data label.
    I will be very happy if I can get your help, thank you.

View the result in the original image

When I want to view the prediction results of the pictures in the test set, I found that the code I wrote to draw the output results on the original pictures always has bugs and ambiguities. Can I get the code that compares the results in the paper?

When I am performing image inference, the input is the image to be detected and a picture of the target class and its mask picture, then how can I use a picture to quickly detect different pictures, what I actually want to say is: how It is better to detect unknown pictures, not that I can only use one picture for verification.

Hope to provide an idea

The 5-shot evaluation is problematic

Hi, thanks for your work.

I have reproduced the 1-shot results that are close to the ones in your paper.

However, when I directly test the model trained with 1-shot in the 5-shot evaluation setting, the result is far from yours.

For example, on fold 0, the 1-shot result is 59.2 and 5-shot I only got 43.73.

Could you help fix this issue?

Thankyou.

Project request

Hello, first of all, I would like to express my compliments to this network structure you proposed. I think your paper has given me a lot of help, because I am still a beginner and cannot fully implement the project, so I hope you can give me a complete project, I want to see the complete running effect of this project, and hope to get your reply

Category settings in training and testing

微信图片_20210914154940
Hello thanks for making the code available.

I have a question. Why are the classes in the configuration file set to 2? These are two specific categories? Or does it have a special meaning?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.