From 6af0854efa3693e0b38c936707966685ec3d0ae8 Mon Sep 17 00:00:00 2001 From: HyunJi Shin <74661937+shinhyunji36@users.noreply.github.com> Date: Wed, 7 Aug 2024 03:59:44 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90=20[i18n-KO]=20Translated=20`image?= =?UTF-8?q?=5Fto=5Fimage.md`=20to=20Korean=20(#32327)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: ko: tasks/image_to_image.md * feat: nmt draft * fix: manual edits * fix: resolve suggestions Co-authored-by: Jihun Lim <31366038+heuristicwave@users.noreply.github.com> Co-authored-by: Jiwook Han <33192762+mreraser@users.noreply.github.com> * fix: handle remaining suggestions Co-authored-by: Jiwook Han <33192762+mreraser@users.noreply.github.com> --------- Co-authored-by: Jihun Lim <31366038+heuristicwave@users.noreply.github.com> Co-authored-by: Jiwook Han <33192762+mreraser@users.noreply.github.com> --- docs/source/ko/_toctree.yml | 4 +- docs/source/ko/tasks/image_to_image.md | 132 +++++++++++++++++++++++++ 2 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 docs/source/ko/tasks/image_to_image.md diff --git a/docs/source/ko/_toctree.yml b/docs/source/ko/_toctree.yml index 73fa249591..6f04bddb8c 100644 --- a/docs/source/ko/_toctree.yml +++ b/docs/source/ko/_toctree.yml @@ -73,8 +73,8 @@ title: 제로샷(zero-shot) 이미지 분류 - local: tasks/monocular_depth_estimation title: 단일 영상 기반 깊이 추정 - - local: in_translation - title: (번역중) Image-to-Image + - local: tasks/image_to_image + title: Image-to-Image - local: in_translation title: (번역중) Image Feature Extraction - local: tasks/mask_generation diff --git a/docs/source/ko/tasks/image_to_image.md b/docs/source/ko/tasks/image_to_image.md new file mode 100644 index 0000000000..f76122f784 --- /dev/null +++ b/docs/source/ko/tasks/image_to_image.md @@ -0,0 +1,132 @@ + + +# Image-to-Image 작업 가이드 [[image-to-image-task-guide]] + +[[open-in-colab]] + +Image-to-Image 작업은 애플리케이션이 이미지를 입력받아 또 다른 이미지를 출력하는 작업입니다. 여기에는 이미지 향상(초고해상도, 저조도 향상, 빗줄기 제거 등), 이미지 복원 등 다양한 하위 작업이 포함됩니다. + +이 가이드에서는 다음을 수행하는 방법을 보여줍니다. +- 초고해상도 작업을 위한 image-to-image 파이프라인 사용, +- 파이프라인 없이 동일한 작업을 위한 image-to-image 모델 실행 + +이 가이드가 발표된 시점에서는, `image-to-image` 파이프라인은 초고해상도 작업만 지원한다는 점을 유의하세요. + +필요한 라이브러리를 설치하는 것부터 시작하겠습니다. + +```bash +pip install transformers +``` + +이제 [Swin2SR 모델](https://huggingface.co/caidas/swin2SR-lightweight-x2-64)을 사용하여 파이프라인을 초기화할 수 있습니다. 그런 다음 이미지와 함께 호출하여 파이프라인으로 추론할 수 있습니다. 현재 이 파이프라인에서는 [Swin2SR 모델](https://huggingface.co/caidas/swin2SR-lightweight-x2-64)만 지원됩니다. + +```python +from transformers import pipeline + +device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') +pipe = pipeline(task="image-to-image", model="caidas/swin2SR-lightweight-x2-64", device=device) +``` + +이제 이미지를 불러와 봅시다. + +```python +from PIL import Image +import requests + +url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/cat.jpg" +image = Image.open(requests.get(url, stream=True).raw) + +print(image.size) +``` +```bash +# (532, 432) +``` +
+
+