Skip to content
ModelListedExternal
Download

HW 202337458 Backbone Swin Replacement

커스텀 Backbone 모델 교체 실습 과제입니다.

KindOtherVersionRevision 2d1a8e5

Model source

Kind
Other
File size
105 MB
Version
vRevision 2d1a8e5
Updated
Sep 17, 2026
Downloads
0
Source
Hugging Face

Source description

HW-202337458-backbone-swin-replacement

Assignment

커스텀 Backbone 모델 교체 실습 과제입니다.

Student

  • Student ID: 202337458
  • Hugging Face ID: hf-june

Backbone Replacement

  • 기존 Backbone: ViT
  • 교체 Backbone: Swin Transformer
  • 사용 모델: microsoft/swin-tiny-patch4-window7-224

Required Code Included

  • register_for_auto_class
  • AutoConfig
  • AutoModel

Files

  • modeling_custom_swin.py
  • backbone_swin_replacement.ipynb
  • custom_swin_model/
  • test_result.json
  • README.md

How to Use

import torch
from modeling_custom_swin import CustomBackboneConfig, CustomSwinImageClassifier

config = CustomBackboneConfig()
model = CustomSwinImageClassifier(config)

pixel_values = torch.randn(2, 3, 224, 224)
labels = torch.tensor([0, 1])

outputs = model(pixel_values=pixel_values, labels=labels)
print(outputs.loss)
print(outputs.logits.shape)

Expected Output

torch.Size([2, 2])

Sources

1 source
Hugging FacePrimaryVersion 2d1a8e5c62c8b1db1993d19f831d60e7b818e190
huggingface.co/hf-june/HW-202337458-backbone-swin-replacement/tree/2d1a8e5c62c8b1db1993d19f831d60e7b818e190

Verified Sep 17

Model artifacts

1 artifact

custom_swin_model/model.safetensors

safetensors · 105 MB · SHA-256 dceeab3d416c…2562 · Hugging Face

Download

Source excerpts

2 excerpts

--- license: apache-2.0 tags: - backbone - swin-transformer - image-classification - automodel - homework --- # HW-202337458-backbone-swin-replacement ## Assignment 커스텀 Backbone 모델 교체 실습 과제입니다. ## Student - Student ID: 202337458 - Hugging Face ID: hf-june ## Backbone Replacement - 기존 Backbone: ViT - 교체 Backbone: Swin Transformer - 사용 모델: microsoft/swin-tiny-patch4-window7-224 ## Required Code Included - register_for_auto_class - AutoConfig - AutoModel ## Files - modeling_custom_swin.py - backbone_swin_replacement.ipynb - custom_swin_model/ - test_result.json - README.md ## How to Use ```python import torch from modeling_custom_swin import CustomBackboneConfig, CustomSwinImageClassifier config = CustomBackboneConfig() model = CustomSwinImageClassifier(config) pixel_values = torch.randn(2, 3, 224, 224) labels = torch.tensor([0, 1]) outputs = model(pixel_values=pixel_values, labels=labels) print(outputs.loss) print(outputs.logits.shape) ``` ## Expected Output ```text torch.Size([2, 2]) ```

Source context: 0 downloads · 0 likes · Pipeline image-classification · Repo hf-june/HW-202337458-backbone-swin-replacement