Skip to content

Commit 76899cf

Browse files
committed
Add description.
1 parent de200e1 commit 76899cf

2 files changed

Lines changed: 35 additions & 6 deletions

File tree

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,21 @@ This executes two steps:
189189

190190
:three: __Obtain the evaluation results:__
191191

192-
- validation queries: the script print the localization recall.
193-
- test queries: combine results for all locations / devices in a single zip file using `python -m lamar.combine_results --cab_phone_path poses_CAB_phone.txt [...] --output_dir ./result/` and submit the zip to the [benchmark page](https://www.codabench.org/competitions/7918/).
192+
_Validation queries:_ the script print the localization recall.
193+
194+
_Test queries:_
195+
- Combine results for all locations / devices in a single zip file using
196+
197+
```
198+
python -m lamar.combine_results \
199+
--cab_phone_path path/to/poses_CAB_phone.txt [...] \
200+
--description path/to/description.txt \
201+
--output_dir ./result/
202+
```
203+
204+
- Submit the zip to the [benchmark page](https://www.codabench.org/competitions/7918/).
205+
206+
:warning: Any public entries should have a name and valid link on the leaderboard. The description file should contain details about the submission (i.e, what methods, what thresholds / hyperparameters, ...).
194207

195208
:four: __Workflow:__ the benchmarking pipeline is designed such that
196209
- the mapping and localization process is split into modular steps listed in [`lamar/tasks/`](./lamar/tasks/)

lamar/combine_results.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55

66
from . import logger
77

8+
def assert_valid_txt_path(path: Path):
9+
"""Assert that the path is valid."""
10+
assert path.exists(), f"Path does not exist: {path}"
11+
assert path.is_file(), f"Path is not a file: {path}"
12+
assert path.suffix == ".txt", f"Expected .txt file, got {path.suffix}"
13+
14+
815
if __name__ == '__main__':
916
parser = argparse.ArgumentParser(
1017
description="Combine estimated poses from multiple scenes / devices in a zip file for evaluation."
@@ -45,14 +52,21 @@
4552
default=None,
4653
help="File containing the HGE HoloLens estimated poses.",
4754
)
55+
parser.add_argument(
56+
"--description_path",
57+
type=Path,
58+
required=True,
59+
help="Path to a text file containing description of the submission.",
60+
)
4861
parser.add_argument(
4962
"--output_dir",
5063
type=Path,
51-
help="Output directory where the zip will be saved.",
5264
required=True,
65+
help="Output directory where the zip will be saved.",
5366
)
5467
args = parser.parse_args().__dict__
5568
output_dir = args.pop("output_dir")
69+
description_path = args.pop("description_path")
5670

5771
# Generate timestamp for the zip file name.
5872
timestamp = datetime.datetime.now().strftime("%Y.%m.%d_%H.%M.%S")
@@ -62,6 +76,10 @@
6276
logger.info(f"Creating zip file at {zip_filename}")
6377
output_dir.mkdir(parents=True, exist_ok=True)
6478
with zipfile.ZipFile(zip_filename, "w", zipfile.ZIP_DEFLATED) as zipf:
79+
# Add the description file to the zip.
80+
logger.info(f"Adding description file from {description_path} to zip")
81+
assert_valid_txt_path(description_path)
82+
zipf.write(description_path, arcname="description.txt")
6583
for name, path in args.items():
6684
split = name.split("_")
6785
assert len(split) == 3
@@ -70,9 +88,7 @@
7088
if path is None:
7189
logger.warning(f"No path provided for [{split}], skipping...")
7290
continue
73-
assert path.exists()
74-
assert path.is_file()
75-
assert path.suffix == ".txt", f"Expected .txt file, got {path.suffix}"
7691
logger.info(f"Adding [{split}] file from {path} to zip")
92+
assert_valid_txt_path(path)
7793
zipf.write(path, arcname=f"{split[0].upper()}_query_{split[1]}.txt")
7894
logger.info(f"Successfully created zip file at {zip_filename}")

0 commit comments

Comments
 (0)