(results, image_dir, reconstruction=None, db_image_dir=None,
selected=[], n=1, seed=0, prefix=None, **kwargs)
| 54 | |
| 55 | |
| 56 | def visualize_loc(results, image_dir, reconstruction=None, db_image_dir=None, |
| 57 | selected=[], n=1, seed=0, prefix=None, **kwargs): |
| 58 | assert image_dir.exists() |
| 59 | |
| 60 | with open(str(results)+'_logs.pkl', 'rb') as f: |
| 61 | logs = pickle.load(f) |
| 62 | |
| 63 | if not selected: |
| 64 | queries = list(logs['loc'].keys()) |
| 65 | if prefix: |
| 66 | queries = [q for q in queries if q.startswith(prefix)] |
| 67 | selected = random.Random(seed).sample(queries, min(n, len(queries))) |
| 68 | |
| 69 | if reconstruction is not None: |
| 70 | if not isinstance(reconstruction, pycolmap.Reconstruction): |
| 71 | reconstruction = pycolmap.Reconstruction(reconstruction) |
| 72 | |
| 73 | for qname in selected: |
| 74 | loc = logs['loc'][qname] |
| 75 | visualize_loc_from_log( |
| 76 | image_dir, qname, loc, reconstruction, db_image_dir, **kwargs) |
| 77 | |
| 78 | |
| 79 | def visualize_loc_from_log(image_dir, query_name, loc, reconstruction=None, |
nothing calls this directly
no test coverage detected