Files
sunnypilot/scripts/reporter.py
Adeeb Shihadeh 37e86df41e CI: comment reporter links on PRs (#35066)
* comment

* Revert "Tomb Raider 4 (#35058)"

This reverts commit 756aebd39f.

* no dpeth

* Reapply "Tomb Raider 4 (#35058)"

This reverts commit 7143835b3d075271e86fb181e08f32db7720c6f8.

* no forks
2025-04-24 18:16:18 -07:00

32 lines
957 B
Python
Executable File

#!/usr/bin/env python3
import os
import glob
import onnx
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../"))
MASTER_PATH = os.getenv("MASTER_PATH", BASEDIR)
MODEL_PATH = "/selfdrive/modeld/models/"
def get_checkpoint(f):
model = onnx.load(f)
metadata = {prop.key: prop.value for prop in model.metadata_props}
return metadata['model_checkpoint'].split('/')[0]
if __name__ == "__main__":
print("| | master | PR branch |")
print("|-| ----- | --------- |")
for f in glob.glob(BASEDIR + MODEL_PATH + "/*.onnx"):
# TODO: add checkpoint to DM
if "dmonitoring" in f:
continue
fn = os.path.basename(f)
master = get_checkpoint(MASTER_PATH + MODEL_PATH + fn)
pr = get_checkpoint(BASEDIR + MODEL_PATH + fn)
print(
"|", fn, "|",
f"[{master}](https://reporter.comma.life/experiment/{master})", "|",
f"[{pr}](https://reporter.comma.life/experiment/{pr})", "|"
)