|
| 1 | +--- |
| 2 | +layout: posts |
| 3 | +classes: wide |
| 4 | +title: "Simple Timepoints Stitcher (v3.0)" |
| 5 | +date: 2024-08-06T12:25:05+00:00 |
| 6 | +--- |
| 7 | +## About this version |
| 8 | + |
| 9 | +- Submitter: [keighrim](https://github.com/keighrim) |
| 10 | +- Submission Time: 2024-08-06T12:25:05+00:00 |
| 11 | +- Prebuilt Container Image: [ghcr.io/clamsproject/app-simple-timepoints-stitcher:v3.0](https://github.com/clamsproject/app-simple-timepoints-stitcher/pkgs/container/app-simple-timepoints-stitcher/v3.0) |
| 12 | +- Release Notes |
| 13 | + |
| 14 | + > Now can filter overlapping time frames |
| 15 | + > - via `allowOverlap` parameter (default is true to keep the backward compatibility) |
| 16 | + > - the filtering algorithm (based on https://github.com/clamsproject/app-swt-detection/blob/5092274d1ead64f21e0e3c2bbb7aa3ad4db75cd4/modeling/stitch.py#L88-L104) |
| 17 | + > - sort collected positive TP sequences based on their mean scores, regardless of the labels |
| 18 | + > - loop through the sorted seqs, if a seq in the loop does not include any "seen" TP, mark the seq as "final" and mark all the underlying TPs as "seen", otherwise skip that one. |
| 19 | + > - return the "final" frames, re-sorted by the start TPs |
| 20 | +
|
| 21 | +## About this app (See raw [metadata.json](metadata.json)) |
| 22 | + |
| 23 | +**Stitches a sequence of `TimePoint` annotations into a sequence of `TimeFrame` annotations, performing simple smoothing of short peaks of positive labels.** |
| 24 | + |
| 25 | +- App ID: [http://apps.clams.ai/simple-timepoints-stitcher/v3.0](http://apps.clams.ai/simple-timepoints-stitcher/v3.0) |
| 26 | +- App License: Apache 2.0 |
| 27 | +- Source Repository: [https://github.com/clamsproject/app-simple-timepoints-stitcher](https://github.com/clamsproject/app-simple-timepoints-stitcher) ([source tree of the submitted version](https://github.com/clamsproject/app-simple-timepoints-stitcher/tree/v3.0)) |
| 28 | + |
| 29 | + |
| 30 | +#### Inputs |
| 31 | +(**Note**: "*" as a property value means that the property is required but can be any value.) |
| 32 | + |
| 33 | +One of the following is required: [ |
| 34 | +- [http://mmif.clams.ai/vocabulary/AudioDocument/v1](http://mmif.clams.ai/vocabulary/AudioDocument/v1) (required) |
| 35 | +(of any properties) |
| 36 | + |
| 37 | +- [http://mmif.clams.ai/vocabulary/VideoDocument/v1](http://mmif.clams.ai/vocabulary/VideoDocument/v1) (required) |
| 38 | +(of any properties) |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | +] |
| 43 | +- [http://mmif.clams.ai/vocabulary/TimePoint/v4](http://mmif.clams.ai/vocabulary/TimePoint/v4) (required) |
| 44 | + - _timePoint_ = "*" |
| 45 | + - _classification_ = "*" |
| 46 | + |
| 47 | + > TimePoint annotations to be stitched. Must be "exhaustive" in that it should cover an entire single time period in the input document, with a uniform sample rate. |
| 48 | +
|
| 49 | + |
| 50 | +#### Configurable Parameters |
| 51 | +(**Note**: _Multivalued_ means the parameter can have one or more values.) |
| 52 | + |
| 53 | +- `labelMap`: optional, defaults to `[]` |
| 54 | + |
| 55 | + - Type: map |
| 56 | + - Multivalued: True |
| 57 | + |
| 58 | + |
| 59 | + > mapping of labels in the input annotations to new labels. Must be formatted as "IN_LABEL:OUT_LABEL" (with a colon). To pass multiple mappings, use this parameter multiple times. By default, all the input labels are passed as is, including any "negative" labels (with default value being no remapping at all). However, when at least one label is remapped, all the other "unset" labels are discarded as the negative label("-"). |
| 60 | +- `minTFDuration`: optional, defaults to `1000` |
| 61 | + |
| 62 | + - Type: integer |
| 63 | + - Multivalued: False |
| 64 | + |
| 65 | + |
| 66 | + > minimum duration of a TimeFrame in milliseconds |
| 67 | +- `minTPScore`: optional, defaults to `0.1` |
| 68 | + |
| 69 | + - Type: number |
| 70 | + - Multivalued: False |
| 71 | + |
| 72 | + |
| 73 | + > minimum score of a TimePoint to be considered as positive |
| 74 | +- `minTFScore`: optional, defaults to `0.5` |
| 75 | + |
| 76 | + - Type: number |
| 77 | + - Multivalued: False |
| 78 | + |
| 79 | + |
| 80 | + > minimum average score of TimePoints in a TimeFrame to be considered as positive |
| 81 | +- `labelMapPreset`: optional, defaults to `null` |
| 82 | + |
| 83 | + - Type: string |
| 84 | + - Multivalued: False |
| 85 | + - Choices: **_`null`_**, `swt-v4-4way`, `swt-v4-6way` |
| 86 | + |
| 87 | + |
| 88 | + > preset of label mappings. If not `null`, this parameter will override the `labelMap` parameter. Available presets are:<br/>- `null`: `None`<br/>- `swt-v4-4way`: `['B:bars', 'S:slate', 'I:chyron', 'N:chyron', 'Y:chyron', 'C:credits', 'R:credits']`<br/>- `swt-v4-6way`: `['B:bars', 'S:slate', 'I:chyron', 'N:chyron', 'Y:chyron', 'C:credits', 'R:credits', 'E:other_text', 'K:other_text', 'G:other_text', 'T:other_text', 'F:other_text', 'W:other_opening', 'L:other_opening', 'O:other_opening', 'M:other_opening']` |
| 89 | +- `allowOverlap`: optional, defaults to `true` |
| 90 | + |
| 91 | + - Type: boolean |
| 92 | + - Multivalued: False |
| 93 | + - Choices: `false`, **_`true`_** |
| 94 | + |
| 95 | + |
| 96 | + > Allow overlapping time frames |
| 97 | +- `pretty`: optional, defaults to `false` |
| 98 | + |
| 99 | + - Type: boolean |
| 100 | + - Multivalued: False |
| 101 | + - Choices: **_`false`_**, `true` |
| 102 | + |
| 103 | + |
| 104 | + > The JSON body of the HTTP response will be re-formatted with 2-space indentation |
| 105 | +- `runningTime`: optional, defaults to `false` |
| 106 | + |
| 107 | + - Type: boolean |
| 108 | + - Multivalued: False |
| 109 | + - Choices: **_`false`_**, `true` |
| 110 | + |
| 111 | + |
| 112 | + > The running time of the app will be recorded in the view metadata |
| 113 | +- `hwFetch`: optional, defaults to `false` |
| 114 | + |
| 115 | + - Type: boolean |
| 116 | + - Multivalued: False |
| 117 | + - Choices: **_`false`_**, `true` |
| 118 | + |
| 119 | + |
| 120 | + > The hardware information (architecture, GPU and vRAM) will be recorded in the view metadata |
| 121 | +
|
| 122 | + |
| 123 | +#### Outputs |
| 124 | +(**Note**: "*" as a property value means that the property is required but can be any value.) |
| 125 | + |
| 126 | +(**Note**: Not all output annotations are always generated.) |
| 127 | + |
| 128 | +- [http://mmif.clams.ai/vocabulary/TimeFrame/v5](http://mmif.clams.ai/vocabulary/TimeFrame/v5) |
| 129 | + - _timeUnit_ = "milliseconds" |
| 130 | + - _label_ = "*" |
| 131 | + - _representatives_ = "*" |
| 132 | + |
| 133 | + > Stitched TimeFrame annotations. Each TimeFrame annotation represents a continuous segment of timepoints and its `label` property is determined by the `labelMap` parameter (see `parameters` section). The `representatives` is a singleton list of the TimePoint annotation that has the highest score in the TimeFrame. |
0 commit comments