From f560d4b9f4fc66998cae8415b03660bfb28406af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Wed, 18 Sep 2024 15:08:26 +0200 Subject: [PATCH] create MR for updated eval results --- .github/workflows/benchmark.yml | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 065403678c..98794f4ed9 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -175,11 +175,12 @@ jobs: new_table+="| -------- | ----- | ----- | ----- |\n" while read -r line; do - if [[ $line =~ ^(Strongsort|Ocsort|Deepocsort|Bytetrack|Botsort|Imprassoc|Hybridsort)[[:space:]]+([[:graph:]]+)[[:space:]]+([[:graph:]]+)[[:space:]]+([[:graph:]]+)[[:space:]]+([[:graph:]]+) ]]; then + # Match lines with tracker data and handle missing values + if [[ $line =~ ^(Strongsort|Ocsort|Deepocsort|Bytetrack|Botsort|Imprassoc|Hybridsort)[[:space:]]+([[:graph:]]*)[[:space:]]+([[:graph:]]*)[[:space:]]+([[:graph:]]*)[[:space:]]*([[:graph:]]*) ]]; then tracker=${BASH_REMATCH[1]} - hota=${BASH_REMATCH[3]} - mota=${BASH_REMATCH[4]} - idf1=${BASH_REMATCH[5]} + hota=${BASH_REMATCH[3]:-N/A} # Default to N/A if missing + mota=${BASH_REMATCH[4]:-N/A} # Default to N/A if missing + idf1=${BASH_REMATCH[5]:-N/A} # Default to N/A if missing new_table+="| [$tracker](https://arxiv.org/pdf/$tracker.pdf) | $hota | $mota | $idf1 |\n" fi done < "$RESULTS_FILE" @@ -188,13 +189,23 @@ jobs: start_marker="| Tracker | HOTA↑ | MOTA↑ | IDF1↑ |" end_marker="" - # Use awk to replace lines between markers - awk -v new_table="$new_table" ' - BEGIN { start_replace=0 } - $0 ~ start_marker { print $0; print new_table; start_replace=1; next } - $0 ~ end_marker { start_replace=0 } - !start_replace { print $0 } - ' start_marker="$start_marker" end_marker="$end_marker" "$README_FILE" > temp_readme.md + # Use awk to replace lines between markers, carefully preserving non-table content + awk -v start_marker="$start_marker" -v end_marker="$end_marker" -v new_table="$new_table" ' + BEGIN { in_table=0 } + { + if ($0 ~ start_marker) { + print $0; # Print the start marker + print new_table; # Insert the new table + in_table=1; # Start skipping lines in the old table + } + else if ($0 ~ end_marker) { + in_table=0; # End skipping when reaching end_marker + } + if (!in_table) { + print $0; # Continue printing lines outside the table + } + } + ' "$README_FILE" > temp_readme.md # Replace original README with updated version mv temp_readme.md $README_FILE