def main(): selector = FPSReductionKS(n=3) extractors = [ ColorLayoutFE(), AutoEncoderFE.load_autoencoder(model_name='../features/model'), ] for extractor in extractors: tags, features = group_features(selector=selector, extractor=extractor) x = range(features.shape[1]) mean = np.mean(features, axis=0) std = np.std(features, axis=0) mins = np.min(features, axis=0) maxs = np.max(features, axis=0) plt.figure() plt.title(f'{selector.name()} - {extractor.name()}') plt.errorbar(x, mean, std, fmt='.b', ecolor='r', capsize=3) plt.plot(x, maxs, 'g') plt.plot(x, mins, 'y') plt.legend([ 'max', 'min', ]) plt.xlabel('features') plt.ylabel('value') plt.show() return
def main(): selectors = [ FPSReductionKS(n=3), MaxHistDiffKS(frames_per_window=1), ] extractors = [ ColorLayoutFE(), AutoEncoderFE(dummy=True), ] indexes = [ LinearIndex(dummy=True), KDTreeIndex(dummy=True, trees=5), SGHIndex(dummy=True, projections=10), ] lshs = [ LSHIndex(dummy=True, projections=5, tables=10), # color layout LSHIndex(dummy=True, projections=3, tables=10), # auto encoder ] for selector in selectors: read_selection_log(selector, extractors) for extractor in extractors: read_extraction_log(extractor, selectors) for index in indexes: read_index_logs(selectors, extractors, index) for i in range(len(lshs)): read_index_logs(selectors, [extractors[i]], lshs[i]) read_detection_log() return
def main(): selectors = [ FPSReductionKS(n=3), # MaxHistDiffKS(frames_per_window=1), ] extractors = [ ColorLayoutFE(), AutoEncoderFE(dummy=True, model_name='model'), ] indexes = [ # LinearIndex(dummy=True, k=100), KDTreeIndex(dummy=True, trees=5, k=100), # SGHIndex(dummy=True, projections=14, tables=2, k=100), # LSHIndex(dummy=True, projections=14, k=100), ] for selector in selectors: for extractor in extractors: for index in indexes: find_copies( video_name='385', selector=selector, extractor=extractor, index=index, ) return
def main(): videos = ['417', '143', '215', '385', '178', '119-120', ] selectors = [ FPSReductionKS(n=3), MaxHistDiffKS(frames_per_window=1), ] extractors = [ ColorLayoutFE(), AutoEncoderFE(dummy=True), ] indexes = [ LinearIndex(dummy=True), KDTreeIndex(dummy=True, trees=5), SGHIndex(dummy=True, projections=10), LSHIndex(dummy=True, projections=5, tables=10), # color layout LSHIndex(dummy=True, projections=3, tables=10), # auto encoder ] datasets = [ (selectors[0], extractors[0], indexes[0],), # linear # (selectors[0], extractors[0], indexes[1],), # kdtree # (selectors[0], extractors[0], indexes[2],), # sgh # (selectors[0], extractors[0], indexes[3],), # lsh # (selectors[0], extractors[1], indexes[0],), # linear # (selectors[0], extractors[1], indexes[1],), # kdtree # (selectors[0], extractors[1], indexes[2],), # sgh # (selectors[0], extractors[1], indexes[4],), # lsh # (selectors[1], extractors[0], indexes[1],), # kdtree # (selectors[1], extractors[0], indexes[2],), # sgh # (selectors[1], extractors[0], indexes[3],), # lsh # (selectors[1], extractors[1], indexes[1],), # kdtree # (selectors[1], extractors[1], indexes[2],), # sgh # (selectors[1], extractors[1], indexes[4],), # lsh ] for video in videos: for selector, extractor, index in datasets: evaluate_duplicates( video_name=video, selector=selector, extractor=extractor, index=index, ) return
def main(): selectors = [ FPSReductionKS(n=3), MaxHistDiffKS(frames_per_window=1), ] extractors = [ ColorLayoutFE(), AutoEncoderFE.load_autoencoder(model_name='features/model'), ] for selector in selectors: for extractor in extractors: extract_features_videos(selector=selector, extractor=extractor, force=True) return
def main(): max_missing_streak = 6 min_duration = 5 max_offset = 2 videos = ['119-120', '143', '178', '215', '385', '417', ] selectors = [ # FPSReductionKS(n=3), MaxHistDiffKS(frames_per_window=1), ] extractors = [ ColorLayoutFE(), AutoEncoderFE(dummy=True), ] indexes = [ LinearIndex(dummy=True), KDTreeIndex(dummy=True, trees=5), SGHIndex(dummy=True, projections=10), # LSHIndex(dummy=True, projections=5, tables=10), # color layout # LSHIndex(dummy=True, projections=3, tables=10), # auto encoder ] for selector in selectors: for extractor in extractors: for index in indexes: for video_name in videos: find_copies( video_name=video_name, selector=selector, extractor=extractor, index=index, max_missing_streak=max_missing_streak, min_duration=min_duration, max_offset=max_offset, force=True, ) return