diff --git a/docs/docs/Feed-Forward-Guide.md b/docs/docs/Feed-Forward-Guide.md index a9548f6c66e7..5385d5a69dde 100644 --- a/docs/docs/Feed-Forward-Guide.md +++ b/docs/docs/Feed-Forward-Guide.md @@ -310,3 +310,25 @@ a 1-to-1 correspondence with a MOG motion track. Refer to `runMogThenOcvFaceFeedForwardRegionTest()` in the [`TestSystemOnDiff`](https://github.com/openmpf/openmpf/blob/master/trunk/mpf-system-tests/src/test/java/org/mitre/mpf/mst/TestSystemOnDiff.java) class for a system test that demonstrates this behavior. + + +# Feed Forward All Tracks + +

EXPERIMENTAL: This feature is not fully implemented.

+ +The default feed-forward behavior will result in generating one sub-job per track generated in the previous stage. +Consider a scenario where you need to implement a tracking component that takes individual detections from a stage and +groups them into tracks. That component needs to accept all tracks from the previous stage as an input to the same +sub-job. + +Setting `FEED_FORWARD_ALL_TRACKS` to true will result in generating one sub-job that contains all the tracks generated +in the previous stage. Refer to the +[component.get_detections_from_all_video_tracks(video_job)](Python-Batch-Component-API.md#componentget_detections_from_all_video_tracksvideo_job) +section of the Python Batch Component API for more details. This property works in conjunction with the other +feed-forward properties discussed in the [Feed Forward Properties](#feed-forward-properties) section. + +Known limitations: + +- Only Python supported. +- Only video supported. +- Not tested with [triggers](Trigger-Guide.md). diff --git a/docs/docs/Python-Batch-Component-API.md b/docs/docs/Python-Batch-Component-API.md index 7502567d6c54..e44a5f8c26be 100644 --- a/docs/docs/Python-Batch-Component-API.md +++ b/docs/docs/Python-Batch-Component-API.md @@ -646,7 +646,7 @@ a static method, or a class method. #### mpf_component_api.VideoJob -Class containing data used for detection of objects in a video file. +Class containing data used for detection of objects in a video file. Contains at most one feed-forward track. * Members: @@ -713,7 +713,7 @@ Class containing data used for detection of objects in a video file. feed_forward_track None or mpf_component_api.VideoTrack - An mpf_component_api.VideoTrack from the previous pipeline stage. Provided when feed forward is enabled. See Feed Forward Guide. + An optional mpf_component_api.VideoTrack from the previous pipeline stage. Provided when feed forward is enabled. See Feed Forward Guide. @@ -733,6 +733,65 @@ they should only be used to specify properties that will not change throughout t of the service (e.g. Docker container). +#### component.get_detections_from_all_video_tracks(video_job) + +

EXPERIMENTAL: This feature is not fully implemented.

+ +Similar to `component.get_detections_from_video(video_job)`, but able to process multiple feed-forward tracks at once. +Refer to the [Feed Forward All Tracks](Feed-Forward-Guide.md#feed-forward-all-tracks) section of the Feed Forward Guide +to learn about the `FEED_FORWARD_ALL_TRACKS` property and how it affects feed-forward behavior. + +Known limitation: No multi-track `mpf_component_util.VideoCapture` support. + +* Method Definition: +```python +class MyComponent: + def get_detections_from_all_video_tracks(self, video_job): + return [mpf_component_api.VideoTrack(...), ...] +``` + +`get_detections_from_all_video_tracks`, like all get_detections_from_\* methods, can be implemented either as an +instance method, a static method, or a class method. + +* Parameters: + +| Parameter | Data Type | Description | +|-----------|---------------------------------------|-------------| +| video_job | `mpf_component_api.AllVideoTracksJob` | Object containing details about the work to be performed. + +* Returns: An iterable of `mpf_component_api.VideoTrack` + + +#### mpf_component_api.AllVideoTracksJob + +

EXPERIMENTAL: This feature is not fully implemented.

+ +Class containing data used for detection of objects in a video file. May contain multiple feed-forward tracks. + +Members are the same as `mpf_component_api.VideoJob` with the exception that `feed_forward_track` is replaced by +`feed_forward_tracks`. + +* Members: + + + + + + + + + + + + + + + + +
MemberData TypeDescription
feed_forward_tracksNone or List[mpf_component_api.VideoTrack]An optional list of mpf_component_api.VideoTrack objects from the previous pipeline stage. Provided when feed forward is enabled and FEED_FORWARD_ALL_TRACKS is true. See Feed Forward Guide.
+ + + #### mpf_component_api.VideoTrack Class used to store the location of detected objects in a video file. diff --git a/docs/site/Feed-Forward-Guide/index.html b/docs/site/Feed-Forward-Guide/index.html index 0da4f9854a64..45f0e6f297e5 100644 --- a/docs/site/Feed-Forward-Guide/index.html +++ b/docs/site/Feed-Forward-Guide/index.html @@ -124,6 +124,9 @@
  • Feed Forward Pipeline Examples
  • +
  • Feed Forward All Tracks
  • + +
  • @@ -523,6 +526,24 @@

    Feed Forward Pipeline Examples

    Refer to runMogThenOcvFaceFeedForwardRegionTest() in the TestSystemOnDiff class for a system test that demonstrates this behavior.

    +

    Feed Forward All Tracks

    +

    EXPERIMENTAL: This feature is not fully implemented.

    + +

    The default feed-forward behavior will result in generating one sub-job per track generated in the previous stage. +Consider a scenario where you need to implement a tracking component that takes individual detections from a stage and +groups them into tracks. That component needs to accept all tracks from the previous stage as an input to the same +sub-job.

    +

    Setting FEED_FORWARD_ALL_TRACKS to true will result in generating one sub-job that contains all the tracks generated +in the previous stage. Refer to the +component.get_detections_from_all_video_tracks(video_job) +section of the Python Batch Component API for more details. This property works in conjunction with the other +feed-forward properties discussed in the Feed Forward Properties section.

    +

    Known limitations:

    + diff --git a/docs/site/Python-Batch-Component-API/index.html b/docs/site/Python-Batch-Component-API/index.html index 620cbec38f64..2f03183ac4ce 100644 --- a/docs/site/Python-Batch-Component-API/index.html +++ b/docs/site/Python-Batch-Component-API/index.html @@ -881,7 +881,7 @@

    component.get_detections_fr
  • Returns: An iterable of mpf_component_api.VideoTrack
  • mpf_component_api.VideoJob

    -

    Class containing data used for detection of objects in a video file.

    +

    Class containing data used for detection of objects in a video file. Contains at most one feed-forward track.

    @@ -948,7 +948,7 @@

    mpf_component_api.VideoJob

    feed_forward_track None or mpf_component_api.VideoTrack - An mpf_component_api.VideoTrack from the previous pipeline stage. Provided when feed forward is enabled. See Feed Forward Guide. + An optional mpf_component_api.VideoTrack from the previous pipeline stage. Provided when feed forward is enabled. See Feed Forward Guide. @@ -967,6 +967,70 @@

    mpf_component_api.VideoJob

    possible to change the value of properties set via environment variables at runtime and therefore they should only be used to specify properties that will not change throughout the entire lifetime of the service (e.g. Docker container).

    +

    component.get_detections_from_all_video_tracks(video_job)

    +

    EXPERIMENTAL: This feature is not fully implemented.

    + +

    Similar to component.get_detections_from_video(video_job), but able to process multiple feed-forward tracks at once. +Refer to the Feed Forward All Tracks section of the Feed Forward Guide +to learn about the FEED_FORWARD_ALL_TRACKS property and how it affects feed-forward behavior.

    +

    Known limitation: No multi-track mpf_component_util.VideoCapture support.

    + +
    class MyComponent:
    +    def get_detections_from_all_video_tracks(self, video_job):
    +        return [mpf_component_api.VideoTrack(...), ...]
    +
    +

    get_detections_from_all_video_tracks, like all get_detections_from_* methods, can be implemented either as an +instance method, a static method, or a class method.

    + + + + + + + + + + + + + + + + +
    ParameterData TypeDescription
    video_jobmpf_component_api.AllVideoTracksJobObject containing details about the work to be performed.
    + +

    mpf_component_api.AllVideoTracksJob

    +

    EXPERIMENTAL: This feature is not fully implemented.

    + +

    Class containing data used for detection of objects in a video file. May contain multiple feed-forward tracks.

    +

    Members are the same as mpf_component_api.VideoJob with the exception that feed_forward_track is replaced by +feed_forward_tracks.

    + + + + + + + + + + + + + + + + +
    MemberData TypeDescription
    feed_forward_tracksNone or List[mpf_component_api.VideoTrack]An optional list of mpf_component_api.VideoTrack objects from the previous pipeline stage. Provided when feed forward is enabled and FEED_FORWARD_ALL_TRACKS is true. See Feed Forward Guide.
    +

    mpf_component_api.VideoTrack

    Class used to store the location of detected objects in a video file.