stop tracking onnx model #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check for new model inference | |
on: | |
push: | |
paths: | |
- "**/**/*.onnx" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
select-runner: | |
runs-on: ubuntu-22.04 | |
outputs: | |
runner: ${{ steps.select_runner.outputs.runner }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Select runner | |
id: select_runner | |
run: | | |
if [ "${{ github.repository }}" = "NeuroDesk/cvpr-sam-on-laptop-2024" ]; then | |
echo "runner=self-hosted" >> $GITHUB_OUTPUT | |
else | |
echo "runner=ubuntu-22.04" >> $GITHUB_OUTPUT | |
fi | |
infer_new_model: | |
needs: [select-runner] | |
runs-on: ${{ needs.select-runner.outputs.runner }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Set up environment and data from osf | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install osfclient | |
osf --project u8tny fetch test_demo.tar.xz | |
tar -xvf test_demo.tar.xz | |
rm test_demo.tar.xz | |
- name: Run inference | |
shell: bash | |
run: | | |
mkdir segs && chmod -R 777 ./* | |
echo ${{ secrets.USERPWD }} | sudo -S docker build -f Dockerfile -t hawken50 . | |
echo ${{ secrets.USERPWD }} | sudo -S docker container run -m 8G --name hawken50 --rm -v $PWD/imgs/:/workspace/inputs/ -v $PWD/segs/:/workspace/outputs/ hawken50:latest /bin/bash -c "sh predict.sh" | |
- name: Evaluate accuracy and efficiency | |
run: | | |
python evaluation/compute_metrics.py -s segs -g gts -csv_dir ./metrics.csv | |
cat ./metrics.csv >> $GITHUB_STEP_SUMMARY |