15 lines
756 B
Bash
15 lines
756 B
Bash
#!/bin/bash
|
|||
|
|
# Make a working copy of the detectors at HEAD named <name> in <workdir>, apply patches (file|old|new triplets, file relative to scripts/), run its benchmark to <workdir>/<name>.txt.
|
||
|
|
# Usage: variant.sh <workdir> <name> <file> <old> <new> [<file> <old> <new> ...]
|
||
|
|
set -e
|
||
|
|
W=$1; N=$2; shift 2
|
||
|
|
HERE=$(dirname "$(readlink -f "$0")")
|
||
|
|
mkdir -p "$W/$N/tools"
|
||
|
|
git -C /home/maxime/aimsight-detectors archive HEAD | tar -x -C "$W/$N"
|
||
|
|
ln -sfn /home/maxime/aimsight-tools/scripts "$W/$N/tools/scripts"
|
||
|
|
while [ $# -ge 3 ]; do
|
||
|
|
python3 -I "$HERE/patch.py" "$W/$N/scripts/$1" "$2" "$3"
|
||
|
|
shift 3
|
||
|
|
done
|
||
|
|
cd "$W/$N"
|
||
|
|
python3 bench/regression.py --labels /home/maxime/aimsight-optimizer/labeling/auto --data /home/maxime/aimsight-optimizer/data > "$W/$N.txt" 2>&1
|