Skip to content

Commit

Permalink
create MR for updated eval results
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikel Broström committed Sep 18, 2024
1 parent 998f8ce commit f560d4b
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -188,13 +189,23 @@ jobs:
start_marker="| Tracker | HOTA↑ | MOTA↑ | IDF1↑ |"
end_marker="</sub>"
# 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
Expand Down

0 comments on commit f560d4b

Please sign in to comment.