Add hyperdataset advanced filter clarification (#457)

This commit is contained in:
pollfly 2023-01-29 15:04:41 +02:00 committed by GitHub
parent 1314e768e1
commit ac57629f5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 158 deletions

View File

@ -95,154 +95,6 @@ a dropdown list in the **Current Source** section.
![Frame dropdown menu in FrameGroup](../../img/hyperdatasets/framegroup_01.png)
## Filtering Frames
### Simple Frame Filtering
Simple frame filtering applies one annotation object (ROI) label and returns frames containing at least one annotation
with that label.
**To apply a simple frame filter:**
* In the **Version Browser**, choose a label on the label list.
For example:
* The **version browser** in the image below contains 101 frames.
<details className="cml-expansion-panel screenshot">
<summary className="cml-expansion-panel-summary">View a screenshot</summary>
<div className="cml-expansion-panel-content">
![Unfiltered version browser](../../img/hyperdatasets/frame_filtering_01.png)
</div>
</details>
<br/>
* A simple label filter for `teddy bear` shows three frames with each containing at least one ROI labeled `teddy bear`.
<details className="cml-expansion-panel screenshot">
<summary className="cml-expansion-panel-summary">View a screenshot</summary>
<div className="cml-expansion-panel-content">
![Filtered version browser](../../img/hyperdatasets/frame_filtering_02.png)
</div>
</details>
### Advanced Frame Filtering
Advanced frame filtering applies sophisticated filtering logic, which is composed of as many frame filters as needed,
where each frame filter can be a combination of ROI, frame, and source rules.
* ROI rules use include and exclude logic to match frames by ROI label; an ROI label can match frames containing at least
one annotation object (ROI) with all labels in the rule.
* Frame rules and source rules use Lucene queries with AND, OR, and NOT logic. Frame rules apply to frame metadata.
* Source rules apply to frame source information.
**To apply advanced filters:**
1. In the **Version Browser**, click **Switch to advanced filters**.
1. In a **FRAME FILTER**, create one of the following rules:
* ROI rule
* Choose **Include** or **Exclude**, select ROI labels, and optionally set the confidence level range.
* To switch from the ROI dropdown list to a Lucene query mode, click <img src="/docs/latest/icons/ico-edit.svg" alt="edit pencil" className="icon size-md space-sm" />.
* Frame rule - Enter a Lucene query using frame metadata fields in the format `meta.<key>:<value>`.
* Source rule - Enter a Lucene query using frame metadata fields in the format `sources.<key>:<value>`.
### Examples
#### ROI Rules
* Create one ROI rule for the `teddy bear` label, which shows the same three frames as the simple frame filter (above).
<details className="cml-expansion-panel screenshot">
<summary className="cml-expansion-panel-summary">View a screenshot</summary>
<div className="cml-expansion-panel-content">
![Adding an ROI rule](../../img/hyperdatasets/frame_filtering_03.png)
</div>
</details>
<br/>
* 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.
<details className="cml-expansion-panel screenshot">
<summary className="cml-expansion-panel-summary">View a screenshot</summary>
<div className="cml-expansion-panel-content">
![Add label to ROI rule](../../img/hyperdatasets/frame_filtering_04.png)
</div>
</details>
<br/>
By opening a frame in the frame viewer, you can see an ROI labeled with both.
<details className="cml-expansion-panel screenshot">
<summary className="cml-expansion-panel-summary">View a screenshot</summary>
<div className="cml-expansion-panel-content">
![Labeled ROIs in frame viewer](../../img/hyperdatasets/frame_filtering_05.png)
</div>
</details>
<br/>
#### Frame Rules
Filter by metadata using Lucene queries.
* Add a frame rule to filter by the metadata key `dangerous` for the value of `yes`.
<details className="cml-expansion-panel screenshot">
<summary className="cml-expansion-panel-summary">View a screenshot</summary>
<div className="cml-expansion-panel-content">
![Filter by metadata ](../../img/hyperdatasets/frame_filtering_08.png)
</div>
</details>
<br/>
By opening a frame in the frame viewer, you can see the metadata.
<details className="cml-expansion-panel screenshot">
<summary className="cml-expansion-panel-summary">View a screenshot</summary>
<div className="cml-expansion-panel-content">
![Frame metadata in frame viewer](../../img/hyperdatasets/frame_filtering_09.png)
</div>
</details>
<br/>
#### Source Rules
Filter by sources using Lucene queries.
* Add a source rule to filter for sources URIs with wildcards.
<details className="cml-expansion-panel screenshot">
<summary className="cml-expansion-panel-summary">View a screenshot</summary>
<div className="cml-expansion-panel-content">
![Filter by source](../../img/hyperdatasets/frame_filtering_10.png)
</div>
</details>
<br/>
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.

View File

@ -93,24 +93,39 @@ Simple frame filtering returns frames containing at least one annotation with a
Alternatively, a combination of ROI, frame, and source rules can be specified to apply more elaborate and specific
filters.
* ROI rules use include and exclude logic to match frames by ROI label; an ROI label can match frames containing at least
one annotation object (ROI) with all labels in the rule.
* Frame rules and source rules use Lucene queries with AND, OR, and NOT logic. Frame rules apply to frame metadata.
* Source rules apply to frame source information.
**To apply advanced filters:**
1. In the **FRAMES** tab, click **Advanced filters**.
1. In a **FRAME FILTER**, create one of the following rules:
* ROI rule
* Choose **Include** or **Exclude**, select ROI labels, and optionally set the confidence level range.
* To switch from the ROI dropdown list to a Lucene query mode, click <img src="/docs/latest/icons/ico-edit.svg" alt="Setting Gear" className="icon size-md space-sm" />.
* Frame rule - Enter a Lucene query using frame metadata fields in the format `meta.<key>:<value>`.
* Source rule - Enter a Lucene query using frame metadata fields in the format `sources.<key>:<value>`.
* ROI rule - Use "Include" and "Exclude" conditions to match frames by ROI label; frames match the rule when
containing at least one annotation object (ROI) with **all** labels in the rule. Click <img src="/docs/latest/icons/ico-code.svg" alt="Lucene query mode" className="icon size-md space-sm" />
to explicitly specify your rule with Lucene
* Frame rule - Query frame metadata. Enter a Lucene query of frame metadata fields in the format `meta.<key>:<value>`
(can use AND, OR, and NOT operators).
* Source rule - Query frame source information. Enter a Lucene query of frame metadata fields in the format
`sources.<key>:<value>` (can use AND, OR, and NOT operators).
A frame filter can contain a number of rules. For each frame filter, the rules are applied with a logical AND operator. For example, the dataset version in the image below has one filter. “Frame Filter 1” has two rules:
1. ROI rule - the frame must include an ROI with the `cat` label
2. Source rule - the frames must be 640 pixels wide.
The returned frames are those that match the first rule AND the second rule within the frame filter.
![Multiple rules filter](../../img/hyperdatasets/multiple_rules.png)
Create additional frame filters by clicking <img src="/docs/latest/icons/ico-add.svg" alt="Add new" className="icon size-md space-sm" />.
Multiple frame filters are applied with a logical OR operator.
For example, the dataset version in the image below has two frame filters. "Frame Filter 1" has the same two rules
described in the example above. "Frame Filter 2" specifies an ROI rule for the frame to contain an ROI with the label
`dog`. So the frames returned are those that match ALL of Frame Filter 1s rules OR ALL of Frame Filter 2s rules.
![Multiple filters](../../img/hyperdatasets/multiple_filters.png)
To clear all filters click <img src="/docs/latest/icons/ico-filter-reset.svg" alt="Clear filters" className="icon size-md" />.
### Filtering Examples
#### Filtering Examples
<details className="cml-expansion-panel screenshot">
<summary className="cml-expansion-panel-summary">ROI Rules</summary>

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB