Skip to content

Commit 727969a

Browse files
clnowackijrobble
andauthored
Update Quality Selection Guide (#183)
Co-authored-by: Jeff Robble <jrobble@mitre.org>
1 parent 2d6ed79 commit 727969a

7 files changed

Lines changed: 69 additions & 81 deletions

File tree

docs/docs/CPP-Streaming-Component-API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Process a single video frame for the current segment.
177177

178178
Must return true when the component begins generating the first track for the current segment. After it returns true, the Component Executable will ignore the return value until the component begins processing the next segment.
179179

180-
If the `job_properties` map contained in the `MPFStreamingVideoJob` struct passed to the component constructor contains a `QUALITY_SELECTION_THRESHOLD` entry, then this function should only return true for a detection with a quality value that meets or exceeds that threshold. Refer to the [Quality Selection Guide](Quality-Selection-Guide/index.html). After the Component Executable invokes `EndSegment()` to retrieve the segment tracks, it will discard detections that are below the threshold. If all the detections in a track are below the threshold, then the entire track will be discarded.
180+
If the `job_properties` map contained in the `MPFStreamingVideoJob` struct passed to the component constructor contains a `CONFIDENCE_THRESHOLD` entry, then this function should only return true for a detection with a quality value that meets or exceeds that threshold. After the Component Executable invokes `EndSegment()` to retrieve the segment tracks, it will discard detections that are below the threshold. If all the detections in a track are below the threshold, then the entire track will be discarded. [NOTE: In the future the C++ Streaming Component API may be updated to support `QUALITY_SELECTION_THRESHOLD` instead of `CONFIDENCE_THRESHOLD`.]
181181

182182
Note that this function may not be invoked for every frame in the current segment. For example, if `FRAME_INTERVAL = 2`, then this function will only be invoked for every other frame since those are the only ones that need to be processed.
183183

docs/docs/Quality-Selection-Guide.md

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ example, a face detection component may generate detections with a `DESCRIPTOR_M
1818
quality of the face embedding and how useful it is for reidentification. The Workflow Manager will search the
1919
`detection_properties` map in each detection and track for that key and use the corresponding value as the detection
2020
quality. The value associated with this property must be an integer or floating point value, where higher values
21-
indicate higher quality.
22-
23-
One exception is when this property is set to `CONFIDENCE` and no `CONFIDENCE` property exists in the
24-
`detection_properties` map. Then the `confidence` member of each detection and track is used instead.
21+
indicate higher quality. The one exception is that if this property is set to `CONFIDENCE`, then the `confidence` member
22+
of each detection and track is used to determine quality.
2523

2624
The primary way in which OpenMPF uses detection quality is to determine the track "exemplar", which is the highest
2725
quality detection in the track. For components that do not compute a quality value, or where all detections have
@@ -48,23 +46,18 @@ the `QUALITY_SELECTION_THRESHOLD`, then only that many artifacts will be extract
4846
# Hybrid Quality Selection
4947

5048
In some cases, there may be a detection property that a component would like to use as a measure of quality but it
51-
doesn't lend itself to simple thresholding. For example, a face detector might be able to calculate the face pose, and
52-
would like to select faces that are in the most frontal pose as the highest quality detections. The yaw of the face pose
53-
may be used to indicate this, but if it's values are between, say, -90 degrees and +90 degrees, then the highest quality
54-
detection would be the one with a value of yaw closest to 0. This violates the need for the quality selection property
55-
to take on a range of values where the highest value indicates the highest quality.
56-
57-
Another use case might be where the component would like to choose detections based on a set of quality values, or
58-
properties. Continuing with the face pose example, the component might like to designate the detection with pose closest
59-
to frontal as the highest quality, but would also like to assign high quality to detections where the pose is closest to
60-
profile, meaning values of yaw closest to -90 or +90 degrees.
61-
62-
In both of these cases, the component can create a custom detection property that is used to rank these detections as it
63-
sees fit. It could use a detection property called `RANK`, and assign values to that property to rank the detections
64-
from lowest to highest quality. In the example of the face detector wanting to use the yaw of the face pose, the
65-
detection with a value of yaw closest to 0 would be assigned a `RANK` property with the highest value, then the
66-
detections with values of yaw closest to +/-90 degrees would be assigned the second and third highest values of `RANK`.
67-
Detections without the `RANK` property would be treated as having the lowest possible quality value. Thus, the track
68-
exemplar would be the face with the frontal pose, and the `ARTIFACT_EXTRACTION_POLICY_TOP_QUALITY_COUNT` property could
69-
be set to 3, so that the frontal and two profile pose detections would be kept as track artifacts.
49+
doesn't lend itself to simple thresholding, perhaps because its value is not linearly increasing, or it is not numeric. The
50+
component can in this case create a custom property that represents the quality of detections using a numerical value that
51+
corresponds to the ordering of the detections from low to high quality.
52+
53+
As a simple example, a face detector might be able to calculate the face pose and would like to select for artifact
54+
extraction the face that is closest to frontal pose, and the two that are closest to left and right profile pose. If the face
55+
detector computes the yaw with values between -90 degrees and +90 degrees, then the numerical order of those values would
56+
not produce the desired result. In this case, the component could create a custom detection property called `RANK`, and
57+
assign values to that property that orders the detections from highest to lowest quality. The face detection component would
58+
assign the highest value of `RANK` to the detection with a value of yaw closest to 0, and the detections with values of yaw
59+
closest to +/-90 degrees would be assigned the second and third highest values of `RANK`. Detections without the `RANK`
60+
property would be treated as having the lowest possible quality value. Thus, the track exemplar would be the face with the
61+
frontal pose, and the `ARTIFACT_EXTRACTION_POLICY_TOP_QUALITY_COUNT` property would be set to 3, so that the frontal and
62+
two profile pose detections would be kept as track artifacts in addition to the exemplar.
7063

docs/site/CPP-Streaming-Component-API/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ <h3 id="beginsegmentvideosegmentinfo">BeginSegment(VideoSegmentInfo)</h3>
449449
<h3 id="processframemat">ProcessFrame(Mat ...)</h3>
450450
<p>Process a single video frame for the current segment.</p>
451451
<p>Must return true when the component begins generating the first track for the current segment. After it returns true, the Component Executable will ignore the return value until the component begins processing the next segment.</p>
452-
<p>If the <code>job_properties</code> map contained in the <code>MPFStreamingVideoJob</code> struct passed to the component constructor contains a <code>QUALITY_SELECTION_THRESHOLD</code> entry, then this function should only return true for a detection with a quality value that meets or exceeds that threshold. Refer to the <a href="../Quality-Selection-Guide/index.html">Quality Selection Guide</a>. After the Component Executable invokes <code>EndSegment()</code> to retrieve the segment tracks, it will discard detections that are below the threshold. If all the detections in a track are below the threshold, then the entire track will be discarded.</p>
452+
<p>If the <code>job_properties</code> map contained in the <code>MPFStreamingVideoJob</code> struct passed to the component constructor contains a <code>CONFIDENCE_THRESHOLD</code> entry, then this function should only return true for a detection with a quality value that meets or exceeds that threshold. After the Component Executable invokes <code>EndSegment()</code> to retrieve the segment tracks, it will discard detections that are below the threshold. If all the detections in a track are below the threshold, then the entire track will be discarded. [NOTE: In the future the C++ Streaming Component API may be updated to support <code>QUALITY_SELECTION_THRESHOLD</code> instead of <code>CONFIDENCE_THRESHOLD</code>.]</p>
453453
<p>Note that this function may not be invoked for every frame in the current segment. For example, if <code>FRAME_INTERVAL = 2</code>, then this function will only be invoked for every other frame since those are the only ones that need to be processed.</p>
454454
<p>Also, it may not be invoked for the first nor last frame in the segment. For example, if <code>FRAME_INTERVAL = 3</code> and the segment size is 10, then it will be invoked for frames {0, 3, 6, 9} for the first segment, and frames {12, 15, 18} for the second segment.</p>
455455
<ul>

docs/site/Quality-Selection-Guide/index.html

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,8 @@ <h1 id="quality-selection-properties">Quality Selection Properties</h1>
259259
quality of the face embedding and how useful it is for reidentification. The Workflow Manager will search the
260260
<code>detection_properties</code> map in each detection and track for that key and use the corresponding value as the detection
261261
quality. The value associated with this property must be an integer or floating point value, where higher values
262-
indicate higher quality.</p>
263-
<p>One exception is when this property is set to <code>CONFIDENCE</code> and no <code>CONFIDENCE</code> property exists in the
264-
<code>detection_properties</code> map. Then the <code>confidence</code> member of each detection and track is used instead.</p>
262+
indicate higher quality. The one exception is that if this property is set to <code>CONFIDENCE</code>, then the <code>confidence</code> member
263+
of each detection and track is used to determine quality.</p>
265264
<p>The primary way in which OpenMPF uses detection quality is to determine the track "exemplar", which is the highest
266265
quality detection in the track. For components that do not compute a quality value, or where all detections have
267266
identical quality, the Workflow Manager will choose the first detection in the track as the exemplar.</p>
@@ -281,23 +280,19 @@ <h1 id="quality-selection-properties">Quality Selection Properties</h1>
281280
the <code>QUALITY_SELECTION_THRESHOLD</code>, then only that many artifacts will be extracted.</p>
282281
<h1 id="hybrid-quality-selection">Hybrid Quality Selection</h1>
283282
<p>In some cases, there may be a detection property that a component would like to use as a measure of quality but it
284-
doesn't lend itself to simple thresholding. For example, a face detector might be able to calculate the face pose, and
285-
would like to select faces that are in the most frontal pose as the highest quality detections. The yaw of the face pose
286-
may be used to indicate this, but if it's values are between, say, -90 degrees and +90 degrees, then the highest quality
287-
detection would be the one with a value of yaw closest to 0. This violates the need for the quality selection property
288-
to take on a range of values where the highest value indicates the highest quality.</p>
289-
<p>Another use case might be where the component would like to choose detections based on a set of quality values, or
290-
properties. Continuing with the face pose example, the component might like to designate the detection with pose closest
291-
to frontal as the highest quality, but would also like to assign high quality to detections where the pose is closest to
292-
profile, meaning values of yaw closest to -90 or +90 degrees.</p>
293-
<p>In both of these cases, the component can create a custom detection property that is used to rank these detections as it
294-
sees fit. It could use a detection property called <code>RANK</code>, and assign values to that property to rank the detections
295-
from lowest to highest quality. In the example of the face detector wanting to use the yaw of the face pose, the
296-
detection with a value of yaw closest to 0 would be assigned a <code>RANK</code> property with the highest value, then the
297-
detections with values of yaw closest to +/-90 degrees would be assigned the second and third highest values of <code>RANK</code>.
298-
Detections without the <code>RANK</code> property would be treated as having the lowest possible quality value. Thus, the track
299-
exemplar would be the face with the frontal pose, and the <code>ARTIFACT_EXTRACTION_POLICY_TOP_QUALITY_COUNT</code> property could
300-
be set to 3, so that the frontal and two profile pose detections would be kept as track artifacts.</p>
283+
doesn't lend itself to simple thresholding, perhaps because its value is not linearly increasing, or it is not numeric. The
284+
component can in this case create a custom property that represents the quality of detections using a numerical value that
285+
corresponds to the ordering of the detections from low to high quality.</p>
286+
<p>As a simple example, a face detector might be able to calculate the face pose and would like to select for artifact
287+
extraction the face that is closest to frontal pose, and the two that are closest to left and right profile pose. If the face
288+
detector computes the yaw with values between -90 degrees and +90 degrees, then the numerical order of those values would
289+
not produce the desired result. In this case, the component could create a custom detection property called <code>RANK</code>, and
290+
assign values to that property that orders the detections from highest to lowest quality. The face detection component would
291+
assign the highest value of <code>RANK</code> to the detection with a value of yaw closest to 0, and the detections with values of yaw
292+
closest to +/-90 degrees would be assigned the second and third highest values of <code>RANK</code>. Detections without the <code>RANK</code>
293+
property would be treated as having the lowest possible quality value. Thus, the track exemplar would be the face with the
294+
frontal pose, and the <code>ARTIFACT_EXTRACTION_POLICY_TOP_QUALITY_COUNT</code> property would be set to 3, so that the frontal and
295+
two profile pose detections would be kept as track artifacts in addition to the exemplar.</p>
301296

302297
</div>
303298
</div>

docs/site/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,5 +400,5 @@ <h1 id="overview">Overview</h1>
400400

401401
<!--
402402
MkDocs version : 0.17.5
403-
Build Date UTC : 2024-03-25 21:18:57
403+
Build Date UTC : 2024-03-29 13:21:30
404404
-->

0 commit comments

Comments
 (0)