Skip to content

Commit

Permalink
Adding timeUnit to view metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
marcverhagen committed Jan 25, 2024
1 parent 7be2e4e commit 297873f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def _annotate(self, mmif: Union[str, dict, Mmif], **parameters) -> Mmif:
predictions = self.classifier.process_video(vd.location)
timeframes = self.stitcher.create_timeframes(predictions)

new_view.new_contain(AnnotationTypes.TimeFrame, document=vd.id)
new_view.new_contain(
AnnotationTypes.TimeFrame, document=vd.id, timeUnit='milliseconds')
for tf in timeframes:
timeframe_annotation = new_view.new_annotation(AnnotationTypes.TimeFrame)
timeframe_annotation.add_property("start", tf.start)
Expand Down
2 changes: 1 addition & 1 deletion metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def appmetadata() -> AppMetadata:
)

metadata.add_input(DocumentTypes.VideoDocument, required=True)
metadata.add_output(AnnotationTypes.TimeFrame)
metadata.add_output(AnnotationTypes.TimeFrame, timeUnit='milliseconds')

# TODO: defaults are the same as in modeling/config/classifier.yml, which is possibly
# not a great idea, should perhaps read defaults from the configuration file. There is
Expand Down

0 comments on commit 297873f

Please sign in to comment.