Skip to content

Latest commit

 

History

History
176 lines (126 loc) · 5.23 KB

select-areas.md

File metadata and controls

176 lines (126 loc) · 5.23 KB

Object selection in an image

This section describes how to add the area selection editor to an image and speed up task completion with shortcuts. If you just need to insert a picture, read the Inserting images section.

Add the area selection editor {#add-select}

To allow Tolokers to select areas in pictures, use the field.image-annotation component.

{
  "view": {
    "type": "field.image-annotation",
    "data": {
      "type": "data.output",
      "path": "path"
    },
    "image": "url"
  }
}

image

Configure labeling modes {#shapes}

The component offers three labeling modes: rectangle, polygon, and point markup. All three modes are available by default. You can choose to use just one or two of them.

{% list tabs %}

  • Rectangles

    To allow Tolokers to select areas only with rectangles, add the rectangle key to the shapes property and set its value to true.

    {
      "shapes": {
        "rectangle": true
      }
    }

    image

  • Polygons

    To allow Tolokers to select areas only with polygons, add the polygon key to the shapes property and set its value to true.

    {
      "shapes": {
        "polygon": true
      }
    }

    image

  • Points

    To allow Tolokers to select areas only with points, add the point key to the shapes property and set its value to true.

    {
      "shapes": {
        "point": true
      }
    }

    image

{% endlist %}

Classify areas {#labels}

You can allow Tolokers to select objects by type. For example, you may want all cars selected in the picture to be labeled as one type, and all road signs as another.

{
  "labels": [{
      "label": "Option 1",
      "value": "value1"
    },
    {
      "label": "Option 2",
      "value": "value2"
    }
  ]
}

image

For each new object of the labels property, a button is added to the editor that allows Tolokers to select the corresponding area type. Different values of the value property let Tolokers label areas with different colors.

Add keyboard shortcuts {#hotkeys}

To help Tolokers work faster, you can add keyboard shortcuts using the plugin.field.image-annotation.hotkeys component. Shortcuts can be assigned to the up and down arrows (up,down), numbers, and Latin letters.

If you install the shortcut plugin without assigning keys, they are assigned automatically.

image

You can change them as described below. If you don't need some of the shortcuts, leave their value fields empty.

{% list tabs %}

  • Select area types

    If you use at least two types of areas in your task, list the shortcuts for them in the array of the labels property, separating them with commas. They will be assigned to the area selection buttons in the order they are displayed.

    {
      "type": "plugin.field.image-annotation.hotkeys",
      "labels": [
          "1",
          "2"
      ]
    }

    image

  • Select labeling modes

    You can let Tolokers switch between different labeling modes using shortcuts. Add the corresponding key to the modes property and assign a shortcut to it:

    • select: For selecting shapes and points.
    • point: For selecting areas using points.
    • rectangle: For selecting areas using rectangles.
    • polygon: For selecting areas using polygons.
    {
      "type": "plugin.field.image-annotation.hotkeys",
      "modes": {
        "select": "q",
        "point": "w",
        "rectangle": "e",
        "polygon": "r"
      }
    }

    image

  • Confirm or cancel area creation

    You can set up shortcuts to let Tolokers confirm or cancel area creation. Assign shortcuts to properties:

    • confirm: Confirm.
    • cancel: Cancel.
    {
      "type": "plugin.field.image-annotation.hotkeys",
      "confirm": "x",
      "cancel": "z"
    }

    image

{% endlist %}

Create a task {#create-task}

To create a template for area selection tasks, use the following components:

image

{% include contact-support %}