diff --git a/docs/source/ko/_toctree.yml b/docs/source/ko/_toctree.yml index e4e9189bda..cfac2fd70d 100644 --- a/docs/source/ko/_toctree.yml +++ b/docs/source/ko/_toctree.yml @@ -83,8 +83,8 @@ title: (번역중) Object detection - local: in_translation title: (번역중) Zero-shot object detection - - local: in_translation - title: (번역중) Zero-shot image classification + - local: tasks/zero_shot_image_classification + title: 제로샷(zero-shot) 이미지 분류 - local: in_translation title: (번역중) Depth estimation title: (번역중) 컴퓨터 비전 diff --git a/docs/source/ko/tasks/zero_shot_image_classification.mdx b/docs/source/ko/tasks/zero_shot_image_classification.mdx new file mode 100644 index 0000000000..199c089007 --- /dev/null +++ b/docs/source/ko/tasks/zero_shot_image_classification.mdx @@ -0,0 +1,140 @@ + + +# 제로샷(zero-shot) 이미지 분류[[zeroshot-image-classification]] + +[[open-in-colab]] + +제로샷(zero-shot) 이미지 분류는 특정 카테고리의 예시가 포함된 데이터를 학습되지 않은 모델을 사용해 이미지 분류를 수행하는 작업입니다. + +일반적으로 이미지 분류를 위해서는 레이블이 달린 특정 이미지 데이터로 모델 학습이 필요하며, 이 모델은 특정 이미지의 특징을 레이블에 "매핑"하는 방법을 학습합니다. +새로운 레이블이 있는 분류 작업에 이러한 모델을 사용해야 하는 경우에는, 모델을 "재보정"하기 위해 미세 조정이 필요합니다. + +이와 대조적으로, 제로샷 또는 개방형 어휘(open vocabulary) 이미지 분류 모델은 일반적으로 대규모 이미지 데이터와 해당 설명에 대해 학습된 멀티모달(multimodal) 모델입니다. +이러한 모델은 제로샷 이미지 분류를 포함한 많은 다운스트림 작업에 사용할 수 있는 정렬된(aligned) 비전 언어 표현을 학습합니다. + +이는 이미지 분류에 대한 보다 유연한 접근 방식으로, 추가 학습 데이터 없이 새로운 레이블이나 학습하지 못한 카테고리에 대해 모델을 일반화할 수 있습니다. +또한, 사용자가 대상 개체에 대한 자유 형식의 텍스트 설명으로 이미지를 검색할 수 있습니다. + +이번 가이드에서 배울 내용은 다음과 같습니다: + +* 제로샷 이미지 분류 파이프라인 만들기 +* 직접 제로샷 이미지 분류 모델 추론 실행하기 + +시작하기 전에 필요한 라이브러리가 모두 설치되어 있는지 확인하세요: + +```bash +pip install -q transformers +``` + +## 제로샷(zero-shot) 이미지 분류 파이프라인[[zeroshot-image-classification-pipeline]] + +[`pipeline`]을 활용하면 가장 간단하게 제로샷 이미지 분류를 지원하는 모델로 추론해볼 수 있습니다. +[Hugging Face Hub에 업로드된 체크포인트](https://huggingface.co/models?pipeline_tag=zero-shot-image-classification&sort=downloads)에서 파이프라인을 인스턴스화합니다. + +```python +>>> from transformers import pipeline + +>>> checkpoint = "openai/clip-vit-large-patch14" +>>> detector = pipeline(model=checkpoint, task="zero-shot-image-classification") +``` + +다음으로, 분류하고 싶은 이미지를 선택하세요. + +```py +>>> from PIL import Image +>>> import requests + +>>> url = "https://unsplash.com/photos/g8oS8-82DxI/download?ixid=MnwxMjA3fDB8MXx0b3BpY3x8SnBnNktpZGwtSGt8fHx8fDJ8fDE2NzgxMDYwODc&force=true&w=640" +>>> image = Image.open(requests.get(url, stream=True).raw) + +>>> image +``` + +
+
+