`.
### Examples
#### ROI Rules
* Create one ROI rule for the `teddy bear` label, which shows the same three frames as the simple frame filter (above).
View a screenshot
![Adding an ROI rule](../../img/hyperdatasets/frame_filtering_03.png)
* In the ROI rule, add a second label. Add `partially_occluded`. Only frames containing at least one ROI labeled as both
`teddy bear` and `partially_occluded` match the filter.
View a screenshot
![Add label to ROI rule](../../img/hyperdatasets/frame_filtering_04.png)
By opening a frame in the frame viewer, you can see an ROI labeled with both.
View a screenshot
![Labeled ROIs in frame viewer](../../img/hyperdatasets/frame_filtering_05.png)
#### Frame Rules
Filter by metadata using Lucene queries.
* Add a frame rule to filter by the metadata key `dangerous` for the value of `yes`.
View a screenshot
![Filter by metadata ](../../img/hyperdatasets/frame_filtering_08.png)
By opening a frame in the frame viewer, you can see the metadata.
View a screenshot
![Frame metadata in frame viewer](../../img/hyperdatasets/frame_filtering_09.png)
#### Source Rules
Filter by sources using Lucene queries.
* Add a source rule to filter for sources URIs with wildcards.
View a screenshot
![Filter by source](../../img/hyperdatasets/frame_filtering_10.png)
Lucene queries can also be used in ROI label filters and frame rules.
## Masks
Use the **MASKS** panel to select which masks to apply over the frame.
To view / hide a specific mask, click .
In order to view all masks, click **Show all** / **Hide all**.
Masks are applied over the image either by pixel segmentation or as an alpha channel:
* Pixel
segmentation - Class labels are mapped onto the mask according to their pixel value definitions, and each
class is assigned a unique color.
* Alpha
channel - Mask pixel values are translated to transparency. Additionally, a color can be applied to the mask to help
distinguish multiple masks. Click to select
a color.
To adjust the transparency of a mask, use its opacity slider.
### Labels
The **Active mask labels** section displays the color mapping of the mask labels.
The panel presents labels only from masks that are currently displayed.
**To modify a label's color and opacity:**
1. Click the colored circle next to the label
1. Select a new color
1. Adjust the opacity slider
1. Click **OK**
## Annotations
### Adding Frame Objects (Regions of Interest)
Annotate images and video by labeling regions of interest in Dataset version frames. You can create new annotations
and copy existing annotations.
#### Creating New Frame Objects
To draw a new annotation:
1. Click one of the following modes to choose what annotation to create:
* - Rectangle mode:
Click then drag the cursor to create a rectangle annotation on the frame.
* - Ellipse mode:
Click then drag the cursor to create an ellipse annotation on the frame.
* - Polygon mode:
Each click sets polygon vertices on the frame. Click again on the initial vertex to close the polygon.
* - Key points mode:
Each click adds a keypoint to the frame. After clicking the last keypoint, click
or Enter
to save the annotation. Click Esc
to cancel the annotation.
A new annotation is created.
1. In the newly created annotation, select or type-in a label(s). Click the circle in the label name to select a
different label color.
You can use the **Default ROI Label(s)** list to automatically set labels to all new annotations.
#### Copying Frame Objects
You can copy existing annotations, and paste them to any frame of your choice:
1. Click the annotation or bounded area in the frame.
1. Click
(copy annotation).
1. Navigate to the frame of your choice (you can remain in the same frame).
1. Click **PASTE**. The new annotation appears in the same location as the one you copied. You can paste the annotation
multiple times.
Copy all annotations in a frame by clicking the **COPY ALL** button.
### Annotation Actions
The following table describes the actions that can be performed on existing annotations. The frame editor automatically
saves changes when you move to another frame using the frame navigation controls
(, , , , , ,
or the arrow keys on the keyboard). Closing the frame editor will prompt you to save any changes.
| Icon (when applicable) | Action | Description |
|---|---|---|
|| Move annotation | Click on a bounded area and drag it. |
|| Resize annotation| Select an annotation, then click on a bounded area’s vertex and drag it. |
||Edit metadata|Hover over an annotation in the list and click the icon to open the edit window. Input the metadata dictionary in JSON format. This metadata is specific to the selected annotation, not the entire frame.|
||Lock / Unlock annotation |Click the button on a specific annotation to make it uneditable. You can also click the button on top of the annotations list to lock all annotations in the frame.|
||Delete annotation|Click the annotation or bounded area in the frame and then click the button to delete the annotation.|
||Show/hide all annotations |Click the button to view the frame without annotations. When annotations are hidden, they can’t be modified. |
||Delete label |In the relevant annotation, click **x** on the label you want to remove.|
### Frame Labels
You can add labels which describe the whole frame, with no specific coordinates.
**To add frame labels:**
1. Expand the **FRAME LABELS** area (below **OBJECTS**)
1. Click **+ Add new**
1. Enter a label(s)
## Frame Metadata
**To edit frame metadata:**
1. Expand the **FRAME METADATA** area
1. Click edit
which will open an editing window
1. Modify the metadata dictionary in JSON format