From d7fbd956b8694d9c402ef5fe05b1d75112357d4b Mon Sep 17 00:00:00 2001 From: huangjun12 <2399845970@qq.com> Date: Fri, 13 Mar 2020 16:54:44 +0800 Subject: [PATCH] fix bug of annotation file root in bmn (#4416) * fix bug of annotation file root * fix bug of feature file not exists --- dygraph/bmn/bmn.yaml | 2 +- dygraph/bmn/reader.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dygraph/bmn/bmn.yaml b/dygraph/bmn/bmn.yaml index e16fa53b..dbcb2f64 100644 --- a/dygraph/bmn/bmn.yaml +++ b/dygraph/bmn/bmn.yaml @@ -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: diff --git a/dygraph/bmn/reader.py b/dygraph/bmn/reader.py index 11209fee..d76ff5e5 100644 --- a/dygraph/bmn/reader.py +++ b/dygraph/bmn/reader.py @@ -48,7 +48,7 @@ class BMNReader(): 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)) @@ -64,6 +64,10 @@ class BMNReader(): 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 = [] -- GitLab