• Stars
    star
    136
  • Rank 267,670 (Top 6 %)
  • Language
    Python
  • Created over 4 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A pytorch implementation of "Domain-Adaptive Few-Shot Learning"

Introduction

The framework is implemented and tested with Ubuntu 16.04, CUDA 8.0/9.0, Python 3, Pytorch 0.4/1.0/1.1, NVIDIA TITANX GPU.

Requirements

  • Cuda & Cudnn & Python & Pytorch

    This project is tested with CUDA 8.0/9.0, Python 3, Pytorch 0.4/1.0, NVIDIA TITANX GPUs.

    Please install proper CUDA and CUDNN version, and then install Anaconda3 and Pytorch. Almost all the packages we use are covered by Anaconda.

  • My settings

    source ~/anaconda3/bin/activate (python 3.6.5)
      (base)  pip list
      torch                              0.4.1
      torchvision                        0.2.2.post3
      numpy                              1.18.1
      numpydoc                           0.8.0
      numba                              0.42.0
      opencv-python                      4.0.0.21

Data preparation

Download and unzip the datasets: MiniImageNet, TieredImageNet, DomainNet.

Here we provide the datasets of target domain in Google Drive, miniImageNet, tieredImageNet.

Format: (E.g. mini-imagenet)

MINI_DIR/
  --  train/
      --  n01532829/
      --  n01558993/
      ...
  --  train_new_domain/
  --  val/
  --  val_new_domain/
  --  test/
  --  test_new_domain/

Training

First set the dataset path MINI_DIR/, TIERED_DIR/, DOMAIN_DIR/ for the three datasets.

For each dataset, we use its training set to train a pre-trained model (e.g. tiered-imagenet).

cd pretrain/
python -u main_resnet.py --epochs 50 --batch_size 1024  --dir_path TIERED_DIR 2>&1 | tee log.txt &

We then use the corresponding pre-trained model to train on each dataset. (e.g. mini-imagenet)

python -u train_cross.py --gpu_id 0 --net ResNet50 --dset mini-imagenet --s_dset_path MINI_DIR --fsl_test_path MINI_DIR --shot 5 --train-way 16 --pretrained 'mini_checkpoint.pth.tar' --output_dir mini_way_16

Testing

python -u test.py --load MODEL_PATH --root MINI_DIR

More Repositories

1

davit

[ECCV 2022]Code for paper "DaViT: Dual Attention Vision Transformer"
Python
323
star
2

D4LCN

A pytorch implementation of "D4LCN: Learning Depth-Guided Convolutions for Monocular 3D Object Detection" CVPR 2020
Python
313
star
3

weibo_analysis

The python crawler which automatically crawls the original microblogs and pictures of the specified user, analyzes the microblogs, and displays them in the form of html charts.
HTML
145
star
4

HR-NAS

HR-NAS: Searching Efficient High-Resolution Neural Architectures with Lightweight Transformers (CVPR21 Oral)
Python
138
star
5

Pytorch-Topology-Aware-Delineation

A pytorch implementation of "Beyond the Pixel-Wise Loss for Topology-Aware Delineation"
Python
46
star
6

VRDP

[NeurIPS 2021] Dynamic Visual Reasoning by Learning Differentiable Physics Models from Video and Language
Python
45
star
7

NCP

Learning Versatile Neural Architectures by Propagating Network Codes
Python
38
star
8

DependencyViT

Visual Dependency Transformers: Dependency Tree Emerges from Reversed Attention (CVPR 2023)
32
star
9

CamNet

A pytorch implementation of "CamNet: Coarse-to-Fine Retrieval for Camera Re-Localization, ICCV 2019"
Python
29
star
10

CV_paper

26
star
11

Pytorch-Instance-Lane-Segmentation

A pytorch implementation of "Towards End-to-End Lane Detection: an Instance Segmentation Approach"
Python
22
star
12

ECL

Embodied Concept Learner: Self-supervised Learning of Concepts and Mapping through Instruction Following (CoRL 2022)
11
star
13

DIPL

Domain-Invariant Projection Learning for Zero-Shot Recognition
MATLAB
7
star
14

Pytorch-Image-Retrieval

A pytorch implementation of "Deep Learning of Binary Hash Codes for Fast Image Retrieval, CVPRW 2015"
Python
6
star
15

thinning_Zhan-Suen

a fast parallel algorithm for thinning digital patterns implemented in python
Python
6
star
16

Doubly-Robust-Self-Training

Python
6
star
17

caffe2pytorch2caffe

lane_segmentation, convert caffemodel to pytorch and reverse
Python
2
star
18

ECCV_youtube-vos_workshop_5st

Python
1
star
19

weight_predict

ζ–°η”Ÿε„Ώδ½“ι‡ι’„ζ΅‹
Python
1
star
20

ECCV_autonue_workshop_2rd

Python
1
star