MediaPipe Interactive Image Segmenter 태스크를 사용하면 이미지를 선택한 객체와 그 외 모든 항목이라는 두 영역으로 나눌 수 있습니다. 이 작업은 이미지에서 위치를 가져와 해당 위치에서 객체의 경계를 추정하고 객체의 영역을 정의하는 이미지 데이터를 반환합니다. 이 태스크를 사용하여 이미지에서 객체를 대화식으로 선택하고 출력을 사용하여 객체를 강조 표시하는 색상 오버레이나 주변 배경을 흐리게 처리하는 등의 효과를 이미지에 적용할 수 있습니다. 이 태스크는 머신러닝 (ML) 모델을 사용하여 이미지 데이터를 처리하며 단일 이미지, 동영상 파일 또는 연속 동영상 스트림에서 사용할 수 있습니다.
입력 이미지 처리 - 처리에는 이미지 회전, 크기 조절, 정규화, 색상 공간 변환이 포함됩니다.
태스크 입력
태스크 출력
이미지에 있는 객체의 관심 장소 좌표
처리할 이미지 파일
대화형 이미지 세그먼터는 설정된 구성 옵션에 따라 다음 중 하나 또는 둘 다를 포함할 수 있는 세분화된 이미지 데이터를 출력합니다.
CATEGORY_MASK: 세그먼트된 마스크가 uint8 형식 이미지로 포함된 목록입니다. 각 픽셀 값은 관심 영역에 있는 객체의 일부인지 여부를 나타냅니다.
CONFIDENCE_MASK: float32 형식의 픽셀 값이 있는 세분화된 마스크가 포함된 채널 목록입니다. 각 픽셀 값은 관심 영역에 있는 객체의 일부라는 신뢰도를 나타냅니다.
구성 옵션
이 태스크에는 다음과 같은 구성 옵션이 있습니다.
옵션 이름
설명
값 범위
기본값
output_category_mask
True로 설정하면 출력에 세분화 마스크가 uint8 이미지로 포함되며, 여기서 각 픽셀 값은 픽셀이 관심 영역에 있는 객체의 일부인지 여부를 나타냅니다.
{True, False}
False
output_confidence_masks
True로 설정하면 출력에 세분화 마스크가 부동 소수점 값 이미지로 포함됩니다. 여기서 각 부동 소수점 값은 픽셀이 관심 영역에 있는 객체의 일부라는 확신을 나타냅니다.
{True, False}
True
display_names_locale
가능한 경우 태스크 모델의 메타데이터에 제공된 표시 이름에 사용할 라벨의 언어를 설정합니다. 기본값은 영어의 경우 en입니다. TensorFlow Lite Metadata Writer API를 사용하여 맞춤 모델의 메타데이터에 현지화된 라벨을 추가할 수 있습니다.
언어 코드
en
모델
대화형 이미지 세그멘터는 두 개 이상의 ML 모델과 함께 사용할 수 있습니다. 이 작업으로 개발을 시작할 때는 타겟 플랫폼에 권장되는 기본 모델부터 시작하세요. 사용 가능한 다른 모델은 일반적으로 성능, 정확성, 해상도, 리소스 요구사항 간에 절충점을 찾으며 경우에 따라 추가 기능을 포함합니다.
MagicTouch 모델 (권장)
이 모델은 관심 영역의 이미지 좌표가 주어지면 세그먼트를 식별합니다.
이 모델은 맞춤 디코더와 함께 MobileNetV3 아키텍처와 유사한 컨볼루션 신경망을 사용합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-01-13(UTC)"],[],[],null,["# Interactive image segmentation task guide\n\nThe MediaPipe Interactive Image Segmenter task lets you divide an image into two regions: a selected\nobject and everything else. The task takes a location in an image, estimates the\nboundaries of an object at that location, and returns image data defining the\narea of the object. You can use this task to interactively select an object in\nan image and use the output to apply effects to the image, such as color\noverlays highlighting the object or blurring the background around it. This task\noperates on image data with a machine learning (ML) model and you can use it on\nsingle images, video files, or a continuous video stream.\n\n[Try it!arrow_forward](https://mediapipe-studio.webapps.google.com/demo/interactive_segmenter)\n\nGet Started\n-----------\n\nStart using this task by following one of these implementation guides for your\ntarget platform. These platform-specific guides walk you through a basic\nimplementation of this task, including a recommended model, and code example\nwith recommended configuration options:\n\n- **Android** - [Code example](https://github.com/googlesamples/mediapipe/blob/main/examples/interactive_segmentation/android) - [Guide](./android)\n- **Python** - [Code example](https://colab.sandbox.google.com/github/googlesamples/mediapipe/blob/main/examples/interactive_segmentation/python/interactive_segmenter.ipynb) - [Guide](./python)\n- **Web** - [Code example](https://codepen.io/mediapipe-preview/pen/ZEqzpRg) - [Guide](./web_js)\n\nTask details\n------------\n\nThis section describes the capabilities, inputs, outputs, and configuration\noptions of this task.\n\n### Features\n\n- **Input image processing** - Processing includes image rotation, resizing, normalization, and color space conversion.\n\n| Task inputs | Task outputs |\n|----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| - Point of interest coordinates for an object in an image - Image file to be processed | Interactive Image Segmenter outputs segmented image data, which can include one or both of the following, depending on the configuration options you set: - `CATEGORY_MASK`: a list containing a segmented mask as a uint8 format image. Each pixel value indicates if it is part of the object located at the area of interest. \u003c!-- --\u003e - `CONFIDENCE_MASK`: a list of channels containing a segmented mask with pixel values in float32 format. Each pixel value indicates the level of confidence that it is part of the object located at the area of interest. |\n\n### Configurations options\n\nThis task has the following configuration options:\n\n| Option Name | Description | Value Range | Default Value |\n|---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|---------------|\n| `output_category_mask` | If set to `True`, the output includes a segmentation mask as a uint8 image, where each pixel value indicates if the pixel is part of the object located at the area of interest. | {`True, False`} | `False` |\n| `output_confidence_masks` | If set to `True`, the output includes a segmentation mask as a float value image, where each float value represents the confidence that the pixel is part of the object located at the area of interest. | {`True, False`} | `True` |\n| `display_names_locale` | Sets the language of labels to use for display names provided in the metadata of the task's model, if available. Default is `en` for English. You can add localized labels to the metadata of a custom model using the [TensorFlow Lite Metadata Writer API](https://ai.google.dev/edge/lite/models/metadata_writer_tutorial) | Locale code | en |\n\nModels\n------\n\nThe Interactive Image Segmenter can be used with more than one ML model. Start with the\ndefault, recommended model for your target platform when you start developing\nwith this task. The other available models typically make trade-offs between\nperformance, accuracy, resolution, and resource requirements, and in some cases,\ninclude additional features.\n| **Attention:** This MediaPipe Solutions Preview is an early release. [Learn more](/edge/mediapipe/solutions/about#notice).\n\n### MagicTouch model (recommended)\n\nThis model identifies segments given image coordinates for an area of interest.\nThe model uses a Convolutional Neural Network, similar to a\n[MobileNetV3](https://www.kaggle.com/models?query=mobilenet-v3)\narchitecture, with a customized decoder.\n\n| Model name | Input shape | Quantization type | Model Card | Versions |\n|-----------------------------------------------------------------------------------------------------------------------------------|---------------|-------------------|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [MagicTouch](https://storage.googleapis.com/mediapipe-models/interactive_segmenter/magic_touch/float32/latest/magic_touch.tflite) | 512 x 512 x 4 | None (float32) | [info](https://storage.googleapis.com/mediapipe-assets/Model%20Card%20MagicTouch.pdf) | [Latest](https://storage.googleapis.com/mediapipe-models/interactive_segmenter/magic_touch/float32/latest/magic_touch.tflite) |\n\nTask benchmarks\n---------------\n\nHere's the task benchmarks for the whole pipeline based on the above\npre-trained models. The latency result is the average latency on Pixel 6 using\nCPU / GPU.\n\n| Model Name | CPU Latency | GPU Latency |\n|------------|-------------|-------------|\n| MagicTouch | 130.11ms | 67.25ms |"]]