SJTU-ViSYS / FeatureBooster

FeatureBooster: Boosting Feature Descriptors with a Lightweight Neural Network (CVPR 2023)
Apache License 2.0
295 stars 14 forks source link

ERROR : HPatches-Sequences-Matching-Benchmark.ipynb #9

Closed molong-d closed 8 months ago

molong-d commented 10 months ago

Hello, thank you for sharing your excellent work. Let me ask the code about HPatches-Sequences-Matching-Benchmark. After feature extraction,i want to use HPatches-Sequences-Matching-Benchmark to analyze data results.I will decompress the resulting file and extract descriptors.npy and keypoints.npy. Rename it to ORB.npy and place it in the cache folder. But I encountered the following code error.Could you please help me check this error message. Did I make a mistake, but I really don't understand what file is needed as input for the HPatches Sequences Matching Benchmark ipynb code?

Please help me, thank you very much

code: for method in methods: output_file = os.path.join(cache_dir, method + '.npy') print(output_file) print(method) if method == 'hesaff': read_function = lambda seq_name, im_idx: parse_mat(loadmat(os.path.join(dataset_path, seq_name, '%d.ppm.hesaff' % im_idx), appendmat=False)) else: if method == 'delf' or method == 'delf-new': read_function = generate_read_function(method, extension='png') elif '+Boost-B' in method or (method.lower() == 'orb'): read_function = generate_read_function(method, type='binary') else: read_function = generate_read_function(method) if os.path.exists(output_file): print('Loading precomputed errors...') errors[method] = np.load(output_file, allow_pickle=True) else: errors[method] = benchmark_features(read_function) np.save(output_file, errors[method]) summary(errors[method][-1])

errors:

ValueError Traceback (most recent call last) /home/l/slam/vslam/FeatureBooster/hpatches_sequences/HPatches-Sequences-Matching-Benchmark.ipynb 单元格 15 line 2 18 errors[method] = benchmark_features(read_function) 19 np.save(output_file, errors[method]) ---> 20 summary(errors[method][-1])

/home/l/slam/vslam/FeatureBooster/hpatches_sequences/HPatches-Sequences-Matching-Benchmark.ipynb 单元格 15 line 2 1 def summary(stats): ----> 2 seq_type, n_feats, n_matches = stats 3 print('# Features: {:f} - [{:d}, {:d}]'.format(np.mean(n_feats), np.min(n_feats), np.max(n_feats))) 4 print('# Matches: Overall {:f}, Illumination {:f}, Viewpoint {:f}'.format( 5 np.sum(n_matches) / ((n_i + n_v) 5), 6 np.sum(n_matches[seq_type == 'i']) / (n_i 5), 7 np.sum(n_matches[seq_type == 'v']) / (n_v * 5)) 8 )

ValueError: too many values to unpack (expected 3)

Antu3heng commented 9 months ago

Hi, @molong-d.

After feature extraction,i want to use HPatches-Sequences-Matching-Benchmark to analyze data results.I will decompress the resulting file and extract descriptors.npy and keypoints.npy. Rename it to ORB.npy and place it in the cache folder.

The npy file is the result of HPatches evaluation, you don't need to create it by yourself. You just need to extract the feature following the instructions in feature-extraction. Then run the HPatches-Sequences-Matching-Benchmark.ipynb, and you can get the results in this jupyter notebook and the npy file in the cache folder.

Sorry for the late reply. Hope it helps.

molong-d commented 9 months ago

Thank you for the author's reply. I will try again. Thank you again. :)