Skip to content

《人工智能A》课程PJ,搭配使用数据增强达到deit_small上的较高的图像分类准确率

Notifications You must be signed in to change notification settings

zjyhhhher/AICourse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AICourse

《人工智能A》课程PJ,搭配使用数据增强达到deit_small上的较高的图像分类准确率

Installation

Our code base is developed and tested with PyTorch 1.7.0, TorchVision 0.8.1, CUDA 10.2, and Python 3.7.

conda create -n baseline python=3.7 -y
conda activate baseline
conda install pytorch==1.7.0 torchvision==0.8.1 cudatoolkit=10.2 -c pytorch
pip install -r requirements.txt 

Model

Loading pre-trained weights is allowed. You can use the pre-trained model under ImageNet-1k, while other datasets like ImageNet-21k, CC3M, LAION, etc., are not allowed.

Datasets

Five datasets are given in /remote-home/share/course23, which include: '10shot_cifar100_20200721','10shot_country211_20210924','10shot_food_101_20211007','10shot_oxford_iiit_pets_20211007','10shot_stanford_cars_20211007'

Run

The executable pretrained models are offered by timm. You can check and use the offered pretrained timm models.

python main.py --model $selected_model --batch-size 64 --data-path $path_to_dataset --output_dir output/$selected_model --epochs 50 --lr 1e-4 --weight-decay 0.01

There are three modes to execute the code.

  1. Operate on individual dataset seperately. You can change --dataset_list to achieve it.
  2. Operate on known datasets. The dataset which given images belong to will be offered. You can check the --known_data_source option.
  3. Operate on unknown datasets. The dataset which given image belong to will not be offered. You should predict both datasets that images belong to and images' corresponding labels. You can check the --unknown_data_source option.

After obtaining the checkpoint of certain modes, you should operate --test_only to produce a prediction json file pred_all.json. The file will be produced under your output directory.

python main.py --model $selected_model --batch-size 64 --data-path $path_to_dataset --output_dir output/$selected_model --epochs 50 --lr 1e-4 --weight-decay 0.01 --test_only --resume /path/of/your/trained/model

Submit

You should submit a zip file containing the pred_all.json file into the colab websit.

About

《人工智能A》课程PJ,搭配使用数据增强达到deit_small上的较高的图像分类准确率

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages