Skip to content

Commit

Permalink
fix bug of annotation file root in bmn (#4416)
Browse files Browse the repository at this point in the history
* fix bug of annotation file root

* fix bug of feature file not exists
  • Loading branch information
huangjun12 authored Mar 13, 2020
1 parent 9538969 commit d7fbd95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dygraph/bmn/bmn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MODEL:
prop_boundary_ratio: 0.5
num_sample: 32
num_sample_perbin: 3
anno_file: "../../PaddleCV/PaddleVideo/data/dataset/bmn/activitynet_1.3_annotations.json"
anno_file: "../../PaddleCV/video/data/dataset/bmn/activitynet_1.3_annotations.json"
feat_path: './fix_feat_100'

TRAIN:
Expand Down
6 changes: 5 additions & 1 deletion dygraph/bmn/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self, mode, cfg):

def get_dataset_dict(self):
assert (os.path.exists(self.feat_path)), "Input feature path not exists"
assert (os.listdir(self.feat_path)), "Input feature file not exists"
assert (os.listdir(self.feat_path)), "No feature file in feature path"
self.video_dict = {}
if self.mode == "infer":
annos = json.load(open(self.file_list))
Expand All @@ -64,6 +64,10 @@ def get_dataset_dict(self):
self.video_list.sort()
print("%s subset video numbers: %d" %
(self.subset, len(self.video_list)))
video_name_set = set(
[video_name + '.npy' for video_name in self.video_list])
assert (video_name_set.intersection(set(os.listdir(self.feat_path))) ==
video_name_set), "Input feature not exists in feature path"

def get_match_map(self):
match_map = []
Expand Down

0 comments on commit d7fbd95

Please sign in to comment.