Skip to content

Commit

Permalink
Rename unav100 -> unav100-subset
Browse files Browse the repository at this point in the history
  • Loading branch information
hokuto-munakata committed Sep 20, 2024
1 parent 0418e95 commit 1133a92
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dset_name: unav100
dset_name: unav100-subset
clip_length: 1
train_path: null
eval_path: null
File renamed without changes.
4 changes: 2 additions & 2 deletions training/cg_detr_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def __getitem__(self, index):
else:
model_inputs["saliency_pos_labels"], model_inputs["saliency_neg_labels"], model_inputs["saliency_all_labels"] = \
self.get_saliency_labels_all(meta["relevant_clip_ids"], meta["saliency_scores"], ctx_l)
elif self.dset_name in ['charades', 'tacos', 'activitynet', 'clotho-moment', 'unav100', 'tut2017']: ## charades, tacos, nlq
elif self.dset_name in ['charades', 'tacos', 'activitynet', 'clotho-moment', 'unav100-subset', 'tut2017']: ## charades, tacos, nlq
model_inputs["saliency_pos_labels"], model_inputs["saliency_neg_labels"], model_inputs["saliency_all_labels"] = \
self.get_saliency_labels_sub_as_query(meta["relevant_windows"][0], meta["duration"], ctx_l) # only one gt
else:
Expand Down Expand Up @@ -458,7 +458,7 @@ def _get_audio_feat_by_vid(self, vid):
raise NotImplementedError
_feat = l2_normalize_np_array(_feat) # normalize?
a_feat_list.append(_feat)
elif self.dset_name in ['clotho-moment', 'unav100', 'tut2017']:
elif self.dset_name in ['clotho-moment', 'unav100-subset', 'tut2017']:
if self.a_feat_types == "clap":
_feat_path = join(_feat_dir, f"{vid}.npz")
_feat = np.load(_feat_path)["features"][:self.max_a_l].astype(np.float32)
Expand Down
6 changes: 3 additions & 3 deletions training/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def __getitem__(self, index):
model_inputs["saliency_pos_labels"], model_inputs["saliency_neg_labels"], model_inputs["saliency_all_labels"] = \
self.get_saliency_labels_all(meta["relevant_clip_ids"], meta["saliency_scores"], ctx_l)

elif self.dset_name in ['charades', 'tacos', 'activitynet', 'clotho-moment', 'unav100', 'tut2017']:
elif self.dset_name in ['charades', 'tacos', 'activitynet', 'clotho-moment', 'unav100-subset', 'tut2017']:
model_inputs["saliency_pos_labels"], model_inputs["saliency_neg_labels"], model_inputs["saliency_all_labels"] = \
self.get_saliency_labels_sub_as_query(meta["relevant_windows"][0], ctx_l)
else:
Expand Down Expand Up @@ -241,7 +241,7 @@ def get_pos_mask(self, meta, ctx_l):
else:
mask[pos_idx] = 1

if self.dset_name in ['charades', 'tacos', 'activitynet', 'clotho-moment', 'unav100', 'tut2017']:
if self.dset_name in ['charades', 'tacos', 'activitynet', 'clotho-moment', 'unav100-subset', 'tut2017']:
mask = mask[:ctx_l]

return mask
Expand Down Expand Up @@ -480,7 +480,7 @@ def _get_audio_feat_by_vid(self, vid):
raise NotImplementedError
_feat = l2_normalize_np_array(_feat) # normalize?
a_feat_list.append(_feat)
elif self.dset_name in ['clotho-moment', 'unav100', 'tut2017']:
elif self.dset_name in ['clotho-moment', 'unav100-subset', 'tut2017']:
if self.a_feat_types == "clap":
_feat_path = join(_feat_dir, f"{vid}.npz")
_feat = np.load(_feat_path)["features"][:self.max_a_l].astype(np.float32)
Expand Down
6 changes: 3 additions & 3 deletions training/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def compute_mr_results(epoch_i, model, eval_loader, opt, criterion=None):
min_w_l=2, max_w_l=150, move_window_method="left",
process_func_names=("clip_ts", "round_multiple")
)
elif opt.dset_name in ['charades', 'clotho-moment', 'unav100', 'tut2017']:
elif opt.dset_name in ['charades', 'clotho-moment', 'unav100-subset', 'tut2017']:
post_processor = PostProcessorDETR(
clip_length=opt.clip_length, min_ts_val=0, max_ts_val=150,
min_w_l=2, max_w_l=60, move_window_method="left",
Expand Down Expand Up @@ -409,8 +409,8 @@ def check_valid_combination(dataset, feature):
choices=['moment_detr', 'qd_detr', 'eatr', 'cg_detr', 'uvcom', 'tr_detr', 'taskweave_hd2mr', 'taskweave_mr2hd'],
help='model name. select from [moment_detr, qd_detr, eatr, cg_detr, uvcom, tr_detr, taskweave_hd2mr, taskweave_mr2hd]')
parser.add_argument('--dataset', '-d', type=str, required=True,
choices=['activitynet', 'charades', 'qvhighlight', 'qvhighlight_pretrain', 'tacos', 'tvsum', 'youtube_highlight', 'clotho-moment', 'unav100', 'tut2017'],
help='dataset name. select from [activitynet, charades, qvhighlight, qvhighlight_pretrain, tacos, tvsum, youtube_highlight, clotho-moment, unav100, tut2017]')
choices=['activitynet', 'charades', 'qvhighlight', 'qvhighlight_pretrain', 'tacos', 'tvsum', 'youtube_highlight', 'clotho-moment', 'unav100-subset', 'tut2017'],
help='dataset name. select from [activitynet, charades, qvhighlight, qvhighlight_pretrain, tacos, tvsum, youtube_highlight, clotho-moment, unav100-subset, tut2017]')
parser.add_argument('--feature', '-f', type=str, required=True,
choices=['resnet_glove', 'clip', 'clip_slowfast', 'clip_slowfast_pann', 'i3d_clip', 'clap'],
help='feature name. select from [resnet_glove, clip, clip_slowfast, clip_slowfast_pann, i3d_clip, clap].'
Expand Down

0 comments on commit 1133a92

Please # to comment.