Skip to content

Commit 2193bd7

Browse files
tomas-gajarskycursoragentclaude
authored
Fix post-processor TypeError, overhaul CI/CD release pipeline (#87)
* Support tuple input in PostArgMax post-processor Co-authored-by: gajarsky.tomas <gajarsky.tomas@gmail.com> * Remove paperswithcode badges from README - Remove non-working paperswithcode badges from all model sections - Clean up README formatting for better readability - Badges were causing display issues and not functioning properly * Fix flake8 linting: remove trailing whitespace - Remove trailing whitespace from blank line in PostArgMax.run() - Resolves W293 blank line contains whitespace error * Bump version to 0.6.1 and update CHANGELOG - Increment patch version from 0.6.0 to 0.6.1 - Add CHANGELOG entry for PostArgMax tuple handling fix - Document README badge removal and linting fixes * Update CHANGELOG.md * Add tuple input handling to PostSigmoidBinary and update changelog date PostSigmoidBinary was the only remaining post-processor not handling tuple model outputs, making it vulnerable to the same TypeError fixed in PostArgMax. Also fixes copy-paste docstring errors in the method. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add unit tests for post-processor tuple input handling Tests verify that all five post-processors (PostArgMax, PostSigmoidBinary, PostEmbedder, PostMultiLabel, PostLabelConfidencePairs) correctly handle both tensor and tuple inputs, preventing regression on issue #84. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Speed up conda CI by switching to libmamba solver The conda workflow was taking 50-80 minutes due to the classic solver struggling with PyTorch dependency resolution. Switch to libmamba solver, upgrade to setup-miniconda@v3 and actions/checkout@v4, and remove the now-unnecessary manual condarc file step. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix conda CI: bump Python to 3.10 for conda 26.x compat conda 26.1.1 requires Python >=3.10, so 3.9 is no longer resolvable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix conda CI: remove defaults channel to avoid plugin conflict conda 26.x has a signature-verification plugin conflict when the defaults channel is used. Since facetorch is on conda-forge, drop defaults entirely and use --override-channels for the install step. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix conda CI: resolve plugin conflict and fix deprecated params - Add conda-remove-defaults to prevent implicit defaults channel - Fix solver param: solver -> conda-solver (setup-miniconda@v3 API) - Remove conda-content-trust before install to fix PluginError with conflicting signature-verification plugins in conda 26.x Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix conda CI: switch to miniforge to avoid defaults channel issues Miniconda's defaults channel brings in conda-anaconda-tos and conda-content-trust packages that conflict with conda 26.x and Python 3.10. Miniforge uses only conda-forge by default, avoiding all these issues cleanly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Overhaul CI/CD: unified release workflow and action updates - Replace pypi-publish.yml and docker-push.yml with a single release.yml triggered by GitHub Release creation (not every push to main) - release.yml validates version file matches the release tag, then publishes to PyPI and pushes Docker images in parallel - Update all workflows to actions/checkout@v4 and actions/setup-python@v5 - Update CHANGELOG to reflect CI/CD changes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add auto-release workflow for hands-free publishing When a PR that bumps the version file is merged to main, this workflow automatically creates a GitHub Release with the tag and changelog notes. The existing release.yml then picks up the release event and publishes to PyPI and Docker Hub. New release process: 1. Bump version + CHANGELOG in PR 2. Merge to main 3. Everything else is automatic Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Update CHANGELOG release date to April 14, 2026 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a5ab889 commit 2193bd7

13 files changed

Lines changed: 370 additions & 116 deletions

File tree

.github/workflows/auto-release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: auto-release
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
paths:
7+
- "version"
8+
9+
jobs:
10+
create-release:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Read version
20+
run: |
21+
VERSION=$(cat ./version | tr -d '[:space:]')
22+
echo "VERSION=$VERSION" >> $GITHUB_ENV
23+
echo "TAG=v$VERSION" >> $GITHUB_ENV
24+
25+
- name: Check if tag already exists
26+
run: |
27+
if git rev-parse "${{ env.TAG }}" >/dev/null 2>&1; then
28+
echo "Tag ${{ env.TAG }} already exists, skipping release."
29+
echo "SKIP=true" >> $GITHUB_ENV
30+
else
31+
echo "SKIP=false" >> $GITHUB_ENV
32+
fi
33+
34+
- name: Extract changelog for this version
35+
if: env.SKIP == 'false'
36+
run: |
37+
# Extract the section between "## $VERSION" and the next "## "
38+
CHANGELOG=$(awk -v ver="${VERSION}" '
39+
/^## / {
40+
if (found) exit
41+
if ($2 == ver) { found=1; next }
42+
}
43+
found { print }
44+
' CHANGELOG.md | sed '/^$/N;/^\n$/d')
45+
46+
# Write to file for the release body (handles multiline safely)
47+
echo "$CHANGELOG" > /tmp/release_notes.md
48+
49+
echo "Changelog extracted:"
50+
cat /tmp/release_notes.md
51+
52+
- name: Create GitHub Release
53+
if: env.SKIP == 'false'
54+
env:
55+
GH_TOKEN: ${{ github.token }}
56+
run: |
57+
gh release create "${{ env.TAG }}" \
58+
--title "${{ env.TAG }}" \
59+
--notes-file /tmp/release_notes.md \
60+
--target main

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ jobs:
1111
timeout-minutes: 30
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515
- name: Docker compose build and run tests
1616
run: docker compose -f docker-compose.dev.yml run facetorch-tests

.github/workflows/conda-env.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,16 @@ jobs:
1010
conda:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414

15-
- name: Create condarc file
16-
run: |
17-
echo "solver: classic" > condarc
18-
19-
- name: Set up Miniconda
20-
uses: conda-incubator/setup-miniconda@v2
15+
- name: Set up Miniforge
16+
uses: conda-incubator/setup-miniconda@v3
2117
with:
22-
python-version: 3.9
18+
miniforge-version: latest
19+
python-version: "3.10"
2320
environment-file: environment.yml
24-
channels: conda-forge, defaults
25-
auto-activate-base: true
2621
activate-environment: base
27-
condarc-file: condarc
22+
auto-activate-base: true
2823

2924
- name: Install facetorch from conda-forge
3025
run: |

.github/workflows/docker-push.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
python-version: ["3.9"]
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v3
20+
uses: actions/setup-python@v5
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323
- name: Install dependencies

.github/workflows/pypi-publish.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/python-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v3
21+
uses: actions/setup-python@v5
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424
- name: Install package

.github/workflows/release.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
validate-version:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Validate release tag matches version file
14+
run: |
15+
FILE_VERSION=$(cat ./version | tr -d '[:space:]')
16+
TAG_VERSION="${GITHUB_REF_NAME#v}"
17+
if [ "$FILE_VERSION" != "$TAG_VERSION" ]; then
18+
echo "::error::Version mismatch: version file says '$FILE_VERSION' but release tag is '$TAG_VERSION'"
19+
echo "Please ensure the version file matches the release tag (with or without 'v' prefix)."
20+
exit 1
21+
fi
22+
echo "Version validated: $FILE_VERSION"
23+
24+
pypi-publish:
25+
needs: validate-version
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: "3.10"
34+
35+
- name: Install build dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install build twine
39+
40+
- name: Build package
41+
run: |
42+
python -m build
43+
44+
- name: Publish package to PyPI
45+
env:
46+
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
47+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
48+
run: |
49+
twine upload -u $TWINE_USERNAME -p $TWINE_PASSWORD dist/*
50+
51+
docker-push:
52+
needs: validate-version
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- name: Set VERSION variable
58+
run: echo "VERSION=$(cat ./version | tr -d '[:space:]')" >> $GITHUB_ENV
59+
60+
- name: Login to Docker Hub
61+
env:
62+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
63+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
64+
run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD docker.io
65+
66+
- name: Build and push facetorch
67+
run: |
68+
docker compose build facetorch
69+
docker tag tomasgajarsky/facetorch:latest tomasgajarsky/facetorch:${{ env.VERSION }}
70+
docker push tomasgajarsky/facetorch:latest
71+
docker push tomasgajarsky/facetorch:${{ env.VERSION }}
72+
73+
- name: Build and push facetorch-gpu
74+
run: |
75+
docker compose build facetorch-gpu-no-device
76+
docker tag tomasgajarsky/facetorch-gpu:latest tomasgajarsky/facetorch-gpu:${{ env.VERSION }}
77+
docker push tomasgajarsky/facetorch-gpu:latest
78+
docker push tomasgajarsky/facetorch-gpu:${{ env.VERSION }}

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Change Log
22

3+
## 0.6.1
4+
5+
Released on April 14, 2026.
6+
7+
### Fixed
8+
* PostArgMax post-processor to handle tuple inputs (resolves TypeError: argmax(): argument 'input' must be Tensor, not tuple)
9+
* PostSigmoidBinary post-processor to handle tuple inputs for consistency with other post-processors
10+
11+
### Changed
12+
* Replaced pypi-publish and docker-push workflows with unified release workflow triggered by GitHub Release
13+
* Switched conda CI from miniconda (classic solver) to miniforge (libmamba), reducing run time from ~60 min to ~1 min
14+
* Updated all GitHub Actions to latest versions (checkout@v4, setup-python@v5, setup-miniconda@v3)
15+
* Removed non-working paperswithcode badges from README for better readability
16+
17+
### Added
18+
* Unit tests for all post-processor tuple input handling
19+
* Version tag validation in release workflow
20+
* Auto-release workflow that creates GitHub Releases when version file changes on main
21+
22+
323
## 0.6.0
424

525
Released on May 24, 2025.

README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ analyzer
104104
1. biubug6
105105
* code: [Pytorch_Retinaface](https://github.com/biubug6/Pytorch_Retinaface)
106106
* paper: [Deng et al. - RetinaFace: Single-Shot Multi-Level Face Localisation in the Wild](https://openaccess.thecvf.com/content_CVPR_2020/html/Deng_RetinaFace_Single-Shot_Multi-Level_Face_Localisation_in_the_Wild_CVPR_2020_paper.html)
107-
* [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/190500641/face-detection-on-wider-face-hard)](https://paperswithcode.com/sota/face-detection-on-wider-face-hard?p=190500641)
108107

109108

110109

@@ -131,14 +130,10 @@ analyzer
131130
1. Jung-Jun-Uk
132131
* code: [UNPG](https://github.com/jung-jun-uk/unpg)
133132
* paper: [Jung et al. - Unified Negative Pair Generation toward Well-discriminative Feature Space for Face Recognition](https://arxiv.org/abs/2203.11593)
134-
* [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/unified-negative-pair-generation-toward-well/face-verification-on-ijb-b)](https://paperswithcode.com/sota/face-verification-on-ijb-b?p=unified-negative-pair-generation-toward-well)(FAR=0.01)
135133
* Note: ```include_tensors``` needs to be True in order to include the model prediction in Prediction.logits
136134
2. mk-minchul
137135
* code: [AdaFace](https://github.com/mk-minchul/adaface)
138136
* paper: [Kim et al. - AdaFace: Quality Adaptive Margin for Face Recognition](https://arxiv.org/abs/2204.00964)
139-
* [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/adaface-quality-adaptive-margin-for-face/face-verification-on-ijb-b)](https://paperswithcode.com/sota/face-verification-on-ijb-b?p=adaface-quality-adaptive-margin-for-face) <
140-
* [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/adaface-quality-adaptive-margin-for-face/face-verification-on-ijb-c)](https://paperswithcode.com/sota/face-verification-on-ijb-c?p=adaface-quality-adaptive-margin-for-face) <
141-
* < badges represent models trained on smaller WebFace 4M dataset
142137
* Note: ```include_tensors``` needs to be True in order to include the model prediction in Prediction.logits
143138

144139

@@ -152,9 +147,6 @@ analyzer
152147
1. HSE-asavchenko
153148
* code: [face-emotion-recognition](https://github.com/HSE-asavchenko/face-emotion-recognition)
154149
* paper: [Savchenko - Facial expression and attributes recognition based on multi-task learning of lightweight neural networks](https://ieeexplore.ieee.org/abstract/document/9582508)
155-
* B2 [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/classifying-emotions-and-engagement-in-online/facial-expression-recognition-on-affectnet)](https://paperswithcode.com/sota/facial-expression-recognition-on-affectnet?p=classifying-emotions-and-engagement-in-online)
156-
* B0 [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/facial-expression-and-attributes-recognition/facial-expression-recognition-on-affectnet)](https://paperswithcode.com/sota/facial-expression-recognition-on-affectnet?p=facial-expression-and-attributes-recognition)
157-
* B0 [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/facial-expression-and-attributes-recognition/facial-expression-recognition-on-acted-facial)](https://paperswithcode.com/sota/facial-expression-recognition-on-acted-facial?p=facial-expression-and-attributes-recognition)
158150

159151
#### Facial Action Unit Detection (au)
160152

@@ -165,7 +157,6 @@ analyzer
165157
1. CVI-SZU
166158
* code: [ME-GraphAU](https://github.com/CVI-SZU/ME-GraphAU)
167159
* paper: [Luo et al. - Learning Multi-dimensional Edge Feature-based AU Relation Graph for Facial Action Unit Recognition](https://arxiv.org/abs/2205.01782)
168-
* [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/learning-multi-dimensional-edge-feature-based/facial-action-unit-detection-on-bp4d)](https://paperswithcode.com/sota/facial-action-unit-detection-on-bp4d?p=learning-multi-dimensional-edge-feature-based)
169160
* ! Does not work with CUDA > 12.0
170161

171162
#### Facial Valence Arousal (va)
@@ -198,9 +189,6 @@ for Identity-invariant Facial Expression Recognition](https://arxiv.org/abs/2209
198189
1. choyingw
199190
* code: [SynergyNet](https://github.com/choyingw/SynergyNet)
200191
* challenge: [Wu et al. - Synergy between 3DMM and 3D Landmarks for Accurate 3D Facial Geometry](https://arxiv.org/abs/2110.09772)
201-
* [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/synergy-between-3dmm-and-3d-landmarks-for/face-alignment-on-aflw)](https://paperswithcode.com/sota/face-alignment-on-aflw?p=synergy-between-3dmm-and-3d-landmarks-for)
202-
* [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/synergy-between-3dmm-and-3d-landmarks-for/head-pose-estimation-on-aflw2000)](https://paperswithcode.com/sota/head-pose-estimation-on-aflw2000?p=synergy-between-3dmm-and-3d-landmarks-for)
203-
* [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/synergy-between-3dmm-and-3d-landmarks-for/face-alignment-on-aflw2000-3d)](https://paperswithcode.com/sota/face-alignment-on-aflw2000-3d?p=synergy-between-3dmm-and-3d-landmarks-for)
204192
* Note: ```include_tensors``` needs to be True in order to include the model prediction in Prediction.logits
205193

206194

0 commit comments

Comments
 (0)