Skip to content

Commit

Permalink
* fix bugs in video_captioning_from_summarizer_mapper due to reorgani…
Browse files Browse the repository at this point in the history
…zation of meta and tags
  • Loading branch information
HYLcool committed Dec 27, 2024
1 parent 4110a1a commit 829a0c7
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,19 @@ def _process_single_sample(self, sample, rank=None):
temp_sample = {
self.text_key: chunk,
self.video_key: loaded_video_keys[offset:offset + vid_count],
Fields.meta: {}
}

captioned_text_list = []
# tag ops
for op in self.tag_op_list:
temp_sample = op.process(temp_sample, rank=rank)
if Fields.video_audio_tags in temp_sample:
if Fields.video_audio_tags in temp_sample[Fields.meta]:
captioned_text_list.extend(
temp_sample[Fields.video_audio_tags])
if Fields.video_frame_tags in temp_sample:
for tag_list in temp_sample[Fields.video_frame_tags]:
temp_sample[Fields.meta][Fields.video_audio_tags])
if Fields.video_frame_tags in temp_sample[Fields.meta]:
for tag_list in temp_sample[Fields.meta][
Fields.video_frame_tags]:
captioned_text_list.extend(tag_list[self.keep_tag_num])
# cap ops
for op in self.cap_op_list:
Expand Down

0 comments on commit 829a0c7

Please sign in to comment.