MubarizZaffar / VPR-Bench

This repository contains the codebase and all the relevant information for our IJCV paper on VPR-Bench: An open-source Visual Place Recognition Evaluation Framework
MIT License
126 stars 17 forks source link

On-Demand Image reading #8

Open doraemon96 opened 2 years ago

doraemon96 commented 2 years ago

It seems that currently images are being read into memory all at once and then processed. This has caused more than one experiment of mine to fill the memory, for example for more than 6000 1080p images.

Wouldn't it be better to read images on-demand, when they need to be processed?

This could even be achieved by creating a class (could even derive of cv2.Mat) that works with images and reads them only when their contents need to be accessed.

MubarizZaffar commented 2 years ago

Yes, you are right. I think this is easily do-able. I will look into it after my on-going submission. Have you already solved this on your end?

doraemon96 commented 2 years ago

I have not. I'm trying to get to a solution that won't involve rewriting every compute_map_features function, but I'm not so sure that's possible because of the list-exclusive functions called (like len)

doraemon96 commented 2 years ago

For the future, I believe it's more pythonic to do for i,e in enumerate(list) rather than for i in range(len(list)), plus that would work with generators as well as lists. I might simply change that in every compute_map_features and replace ref_images_list with a generator.

edit: About the former, it seems it's only the case for CoHOG's compute_map_features