def create_vse(vocabulary_path, recognized_visual_words=1000):
"""Create visual search engine with default configuration."""
ranker = SimpleRanker(hist_comparator=Intersection())
inverted_index = InvertedIndex(ranker=ranker, recognized_visual_words=recognized_visual_words)
bag_of_visual_words = BagOfVisualWords(extractor=cv2.xfeatures2d.SURF_create(),
matcher=cv2.BFMatcher(normType=cv2.NORM_L2),
vocabulary=load(vocabulary_path))
return VisualSearchEngine(inverted_index, bag_of_visual_words)
评论列表
文章目录