Skip to content
Tutorials5 min read

Potato로 이미지 분류하기

instance_display로 이미지를 표시하고 radio 및 multiselect 스키마로 라벨을 수집해 Potato에서 이미지 분류를 설정합니다. 품질 검사도 함께 다룹니다.

Potato Team

대부분의 컴퓨터 비전 프로젝트는 머지않아 라벨이 붙은 이미지 더미가 필요하고, 누군가는 그 라벨링을 해야 합니다. 제품 사진을 분류하든, 콘텐츠를 검수하든, 의료 영상을 분류하든, Potato가 인터페이스를 맡아 주므로 여러분은 라벨에 집중할 수 있습니다. 이 튜토리얼에서는 흔히 쓰는 설정들을 다룹니다. 단일 라벨 분류와 다중 라벨 분류, 중첩된 카테고리 구조, 그리고 이미지 작업의 신뢰성을 지켜 주는 품질 검사입니다.

이미지를 먼저 보여 주고, 그다음에 질문하기

Potato에서 분류와 그리기는 서로 다른 작업이며, 둘을 혼동하는 것이 흔한 첫 실수입니다. instance_display는 이미지를 화면에 띄웁니다. annotation_schemes는 질문을 던집니다. image_annotation 타입은 이미지 위에 박스와 마스크를 그리기 위한 것이므로, 분류 작업에서는 전혀 사용하지 않습니다.

yaml
annotation_task_name: "Product Image Classification"
task_dir: "."
 
data_files:
  - data/products.json
 
item_properties:
  id_key: product_id
  text_key: image_url
 
instance_display:
  fields:
    - key: image_url
      type: image
      label: "Product image"
      display_options:
        max_width: 600
        zoomable: true
 
annotation_schemes:
  - annotation_type: radio
    name: category
    description: "What type of product is shown?"
    labels:
      - Electronics
      - Clothing
      - Home & Garden
      - Sports & Outdoors
      - Books & Media
      - Other
    sequential_key_binding: true
 
output_annotation_dir: annotation_output/
export_annotation_format: jsonl

sequential_key_binding은 여섯 개의 라벨에 1부터 6까지의 키를 할당합니다. 한 번 보고 한 번 클릭하면 끝나는 작업에서는 처리 속도의 대부분이 키보드에서 나옵니다.

인터페이스는 이미지를 보여 주고 그 아래에 카테고리 라벨을 표시합니다.

카테고리 라벨과 키보드 단축키가 있는 이미지 분류 인터페이스분류 라벨과 키보드 단축키가 함께 표시된 제품 이미지를 보여 주는 이미지 주석 인터페이스

데이터 형식

data/products.json을 만듭니다.

json
{"product_id": "P001", "image_url": "/images/products/laptop.jpg"}
{"product_id": "P002", "image_url": "/images/products/tshirt.jpg"}
{"product_id": "P003", "image_url": "/images/products/garden_tools.jpg"}
{"product_id": "P004", "image_url": "https://example.com/images/basketball.jpg"}

이미지는 작업 디렉터리 아래의 로컬 경로이거나 절대 URL일 수 있습니다. text_key는 경로를 담고 있는 필드를 가리키며, 이 필드가 Potato가 표시 영역에 넘기는 필드입니다.

다중 라벨 분류

하나의 이미지가 동시에 여러 카테고리에 속하는 경우에는 multiselect를 사용하십시오.

yaml
annotation_schemes:
  - annotation_type: multiselect
    name: attributes
    description: "Select all attributes that apply to this image"
    labels:
      - Contains people
      - Outdoor scene
      - Indoor scene
      - Contains text
      - Product photo
      - Lifestyle photo
      - Close-up shot
      - Wide angle

중첩 카테고리

Potato에는 라디오 버튼용 중첩 라벨 타입이 없으므로, 2단계 분류 체계는 스키마 두 개로 구성합니다. 각 스키마에는 자체 labels가 필요하며, 하위 카테고리 목록은 모든 상위 카테고리를 포괄해야 합니다.

yaml
annotation_schemes:
  - annotation_type: radio
    name: main_category
    description: "Primary category"
    labels:
      - Apparel
      - Electronics
      - Home
 
  - annotation_type: radio
    name: subcategory
    description: "Subcategory within the primary category"
    labels:
      - Tops
      - Bottoms
      - Footwear
      - Phones & Tablets
      - Computers
      - Audio
      - Furniture
      - Kitchen
      - Decor

두 번째 목록이 길어지면 hierarchical_multiselect가 두 개의 스키마 대신 하나의 위젯으로 묶어 줍니다.

분류와 함께 하는 품질 검사

yaml
annotation_schemes:
  - annotation_type: radio
    name: category
    description: "Product category"
    labels: [Electronics, Clothing, Home, Other]
 
  - annotation_type: radio
    name: image_quality
    description: "Is this image suitable for the product catalog?"
    labels:
      - name: Approved
        tooltip: "Clear, well-lit, product is visible"
      - name: Needs review
        tooltip: "Minor issues but potentially usable"
      - name: Rejected
        tooltip: "Poor quality, wrong product, or inappropriate"
 
  - annotation_type: multiselect
    name: quality_issues
    description: "If not approved, what issues are present?"
    labels:
      - Blurry or out of focus
      - Poor lighting
      - Wrong product shown
      - Watermark or text overlay
      - Inappropriate content
      - Multiple products in frame

라벨별 안내 문구는 tooltip에 넣습니다. 라벨이 읽는 키가 바로 이것입니다. 라벨에 description:으로 적으면 그 텍스트는 주석자가 볼 수 있는 어디에도 표시되지 않습니다.

전체 예시

yaml
annotation_task_name: "E-commerce Image Classification"
task_dir: "."
 
data_files:
  - data/images.json
 
item_properties:
  id_key: sku
  text_key: image_path
 
instance_display:
  fields:
    - key: image_path
      type: image
      label: "Product image"
      display_options:
        max_width: 700
        zoomable: true
 
annotation_schemes:
  - annotation_type: radio
    name: primary_category
    description: "Select the main product category"
    labels:
      - Electronics
      - Clothing & Accessories
      - Home & Living
      - Beauty & Personal Care
      - Sports & Fitness
      - Toys & Games
      - Other
    sequential_key_binding: true
 
  - annotation_type: multiselect
    name: image_attributes
    description: "Select all that apply"
    labels:
      - White background
      - Lifestyle shot
      - Multiple angles
      - Model wearing or using
      - Size reference included
      - Brand visible
    label_requirement:
      required: false
 
  - annotation_type: radio
    name: listing_ready
    description: "Is this image ready for the product listing?"
    labels:
      - Ready to publish
      - Needs editing
      - Reshoot required
    label_requirement:
      required: true
 
annotation_instructions: |
  ## Image Classification Guidelines
 
  ### Category selection
  Choose the most specific category that fits the product.
 
  ### Image quality
  - Ready to publish: clear, professional, meets standards
  - Needs editing: good photo that needs cropping or color correction
  - Reshoot required: fundamentally unsuitable
 
output_annotation_dir: annotation_output/
export_annotation_format: jsonl

이미지 주석을 위한 팁

색과 밝기는 모니터마다 다르므로, 그것이 중요한 작업이라면 주석자들이 어느 정도 보정된 디스플레이를 쓰고 있는지 확인하십시오. 카테고리를 말로 설명하기보다 가이드라인에 예시 이미지를 넣으십시오. 그림 한 장이 한 문단보다 더 많은 논쟁을 정리합니다. 애매한 이미지를 어떻게 처리할지 적어 두십시오. 애매한 이미지는 반드시 나오기 때문입니다. 그리고 가끔씩 팀이 같은 묶음을 라벨링하고 비교하게 하여, 편차가 일찍 잡히도록 하십시오.

구현 세부 사항은 이미지 주석 문서를 참고하십시오.

다음 단계


전체 이미지 주석 문서는 이미지 주석에서 확인하십시오.