Skip to content

InveloperJihyeok/Computer-Vision-2025

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Computer Vision Final Project

Model Code

  • 공식 Github Repo Clone
git clone https://github.com/facebookresearch/mae.git
  • main_linprobe.py 파일 수정

Pretrained ViT Base Model

  1. 공식 Github Repo에서 모델 다운로드: https://dl.fbaipublicfiles.com/mae/finetune/mae_finetuned_vit_base.pth
  2. 실행 파일들과 같은 경로에 둠

Dataset

  1. Huggingface api 활용을 위해 token 발급
  2. .env 파일 생성 후 TOKEN, DATA_PATH 변수 설정
  3. process_data.py 실행
  4. DATA_PATH의 폴더명 'validation'을 'vali'로 변경

Extra Analysis

  • analysis.ipynb 실행

Linear Probing Baseline

OMP_NUM_THREADS=1 torchrun --nproc_per_node=2 main_linprobe.py \
    --batch_size 512 \
    --model vit_base_patch16 --cls_token \
    --finetune ${PRETRAIN_CHKPT} \
    --epochs 90 \
    --blr 0.1 \
    --weight_decay 0.0 \
    --dist_eval --data_path ${IMAGENET_DIR} \
    --num_workers 32 \
    --output_dir ./output_linprobe_linear \
    --log_dir ./output_dir_linear \
    --head_type linear

Linear Probing MLP ver.

OMP_NUM_THREADS=1 torchrun --nproc_per_node=2 main_linprobe.py \
    --batch_size 512 \
    --model vit_base_patch16 --cls_token \
    --finetune ${PRETRAIN_CHKPT} \
    --epochs 90 \
    --blr 0.1 \
    --weight_decay 0.0 \
    --dist_eval --data_path ${IMAGENET_DIR} \
    --num_workers 32 \
    --output_dir ./output_linprobe_mlp \
    --log_dir ./output_dir_mlp \
    --head_type mlp

Linear Probing Transformer Block ver.

OMP_NUM_THREADS=1 torchrun --nproc_per_node=2 main_linprobe.py \
    --batch_size 512 \
    --model vit_base_patch16 --cls_token \
    --finetune ${PRETRAIN_CHKPT} \
    --epochs 90 \
    --blr 0.1 \
    --weight_decay 0.0 \
    --dist_eval --data_path ${IMAGENET_DIR} \
    --num_workers 32 \
    --output_dir ./output_linprobe_tf \
    --log_dir ./output_dir_tf \
    --head_type transformer

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors