Tutorials3 min read
Potatoによる画像分類
サムネイルプレビュー、ズームコントロール、マルチラベルサポートを備えた画像分類タスクの設定方法。
Potato Team·
Potatoによる画像分類
画像分類はコンピュータビジョンの基盤です。商品カテゴリシステム、コンテンツモデレーションパイプライン、医療画像分類器のいずれを構築する場合でも、Potatoは効率的な画像ラベリングに必要なツールを提供します。
学べること
- 画像アノテーションタスクの設定
- 単一ラベルとマルチラベルの分類
- 階層的なカテゴリ構造
- 画像タスクの品質管理
基本的な画像分類
シンプルな単一ラベル分類タスクから始めましょう。
設定
yaml
annotation_task_name: "Product Image Classification"
# Image data
data_files:
- data/products.json
item_properties:
id_key: product_id
text_key: image_url
# Classification labels
annotation_schemes:
- annotation_type: image_annotation
name: category
description: "What type of product is shown?"
labels:
- Electronics
- Clothing
- Home & Garden
- Sports & Outdoors
- Books & Media
- Other
keyboard_shortcuts:
Electronics: "1"
Clothing: "2"
"Home & Garden": "3"
"Sports & Outdoors": "4"
"Books & Media": "5"
Other: "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が使用できます。
マルチラベル分類
複数のカテゴリに属する画像の場合:
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
min_selections: 1
max_selections: 5階層的カテゴリ
複雑な分類体系にはネストされたラベルを使用:
yaml
annotation_schemes:
- annotation_type: radio
name: main_category
description: "Primary category"
labels:
- Apparel
- Electronics
- Home
- annotation_type: radio
name: subcategory
description: "Subcategory"
conditional:
depends_on: main_category
options:
Apparel:
- Tops
- Bottoms
- Footwear
- Accessories
Electronics:
- Phones
- Computers
- Audio
- Cameras
Home:
- Furniture
- Decor
- Kitchen
- Bedding画像品質評価
分類と並行して品質チェックを追加:
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
description: "Clear, well-lit, product is visible"
- name: Needs review
description: "Minor issues but potentially usable"
- name: Rejected
description: "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
conditional:
depends_on: image_quality
show_when: ["Needs review", "Rejected"]高度な画像設定
高度な画像表示カスタマイズには、アノテーションスキーム内のimage_annotationタイプを設定し、必要に応じてCSSやカスタムスタイリングを使用します。
完全な例
本番環境用の設定:
yaml
annotation_task_name: "E-commerce Image Classification"
data_files:
- data/images.json
item_properties:
id_key: sku
text_key: image_path
annotation_schemes:
- annotation_type: image_annotation
name: primary_category
description: "Select the main product category"
labels:
- Electronics
- Clothing & Accessories
- Home & Living
- Beauty & Personal Care
- Sports & Fitness
- Toys & Games
- Other
required: true
keyboard_shortcuts:
Electronics: "1"
"Clothing & Accessories": "2"
"Home & Living": "3"
"Beauty & Personal Care": "4"
"Sports & Fitness": "5"
"Toys & Games": "6"
Other: "7"
- annotation_type: multiselect
name: image_attributes
description: "Select all that apply"
labels:
- White background
- Lifestyle shot
- Multiple angles
- Model wearing/using
- Size reference included
- Brand visible
required: false
- annotation_type: radio
name: listing_ready
description: "Is this image ready for product listing?"
labels:
- Yes - Ready to publish
- No - Needs editing
- No - Reshoot required
required: true
annotation_guidelines:
title: "Image Classification Guidelines"
content: |
## Category Selection
Choose the most specific category that fits the product.
## Image Quality
- "Ready to publish": Clear, professional, meets standards
- "Needs editing": Good photo but needs cropping/color correction
- "Reshoot required": Fundamentally unsuitable画像アノテーションのヒント
- 一貫したモニター設定:キャリブレーションされたディスプレイの確保
- 明確なカテゴリ定義:ガイドラインにサンプル画像を含める
- エッジケースの処理:曖昧な画像の対処法を文書化
- 定期的なキャリブレーション:チームでサンプルをレビュー
次のステップ
- 物体検出のバウンディングボックスアノテーションを学ぶ
- セグメンテーションのポリゴンアノテーションを設定
- 時間的タスクのビデオアノテーションを探索
画像アノテーションの完全なドキュメントは/docs/features/image-annotationをご覧ください。