Skip to content

Commit

Permalink
Merge pull request #228 from cosanlab/huggingface
Browse files Browse the repository at this point in the history
WIP: Huggingface Integration
  • Loading branch information
ejolly authored Oct 19, 2024
2 parents 65ad854 + 6a3b63c commit c4f6364
Show file tree
Hide file tree
Showing 79 changed files with 12,881 additions and 5,154 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/auto_deploy_on_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.11"

- name: Pypa build
run: |
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.11"

- name: Upgrade pip
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.11"

- name: Upgrade pip
run: |
Expand Down
33 changes: 9 additions & 24 deletions .github/workflows/tests_and_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,40 +26,25 @@ jobs:
# OSs to test
os: [ubuntu-latest, macos-latest]
# Python versions to test
python-version: [3.8, 3.9, "3.10"]
python-version: ["3.10", "3.11"]
# By default everything should pass for the workflow to pass
experimental: [false]
include:
# Windows sometimes fails to install due to dependency changes, but eventually sort themselves out. So let these tests fail. Also issue on macos 3.11 with joblib so let that fail
- os: windows-latest
python-version: 3.8
- os: ubuntu-latest
python-version: "3.12"
experimental: true
- os: windows-latest
python-version: 3.9
- os: macos-latest
python-version: "3.12"
experimental: true
- os: windows-latest
python-version: "3.10"
experimental: true
- os: windows-latest
python-version: 3.11
experimental: true
- os: macos-latest
python-version: 3.11
python-version: "3.11"
experimental: true
- os: ubuntu-latest
python-version: 3.11
experimental: false
- os: macos-14
python-version: 3.8
experimental: true
- os: macos-14
python-version: 3.9
experimental: true
- os: macos-14
python-version: "3.10"
experimental: true
- os: macos-14
python-version: 3.11
- os: windows-latest
python-version: "3.12"
experimental: true
steps:
# Step up miniconda
Expand All @@ -84,7 +69,7 @@ jobs:
run: |
conda activate test
conda env list
black --check --verbose .
ruff check --ignore=W292,E402,E501,E731,E741 feat
pytest --cov=feat -rs
# Send coverage to coveralls.io but waiting on parallelization to finish
Expand Down
33 changes: 9 additions & 24 deletions .github/workflows/tests_on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,40 +24,25 @@ jobs:
# OSs to test
os: [ubuntu-latest, macos-latest]
# Python versions to test
python-version: [3.8, 3.9, "3.10"]
python-version: ["3.10", "3.11"]
# By default everything should pass for the workflow to pass
experimental: [false]
include:
# Windows sometimes fails to install due to dependency changes, but eventually sort themselves out. So let these tests fail. Also issue on macos 3.11 with joblib so let that fail
- os: windows-latest
python-version: 3.8
- os: ubuntu-latest
python-version: "3.12"
experimental: true
- os: windows-latest
python-version: 3.9
- os: macos-latest
python-version: "3.12"
experimental: true
- os: windows-latest
python-version: "3.10"
experimental: true
- os: windows-latest
python-version: 3.11
experimental: true
- os: macos-latest
python-version: 3.11
python-version: "3.11"
experimental: true
- os: ubuntu-latest
python-version: 3.11
experimental: false
- os: macos-14
python-version: 3.8
experimental: true
- os: macos-14
python-version: 3.9
experimental: true
- os: macos-14
python-version: "3.10"
experimental: true
- os: macos-14
python-version: 3.11
- os: windows-latest
python-version: "3.12"
experimental: true
steps:
# Step up miniconda
Expand All @@ -82,7 +67,7 @@ jobs:
run: |
conda activate test
conda env list
black --check --verbose .
ruff check --ignore=W292,E402,E501,E731,E741 feat
pytest --cov=feat -rs
# Job (3): Just build jupyter book but don't deploy it.
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,4 @@ environment.yml
FNL_01.mp4

.vscode/bookmarks.json
feat/tests/*.prof
4 changes: 2 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"recommendations": [
"njpwerner.autodocstring",
"charliermarsh.ruff",
"ms-python.python",
"ms-python.vscode-pylance",
"KevinRose.vsc-python-indent",
"njpwerner.autodocstring",
]
}
33 changes: 19 additions & 14 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
{
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.autoTestDiscoverOnSaveEnabled": true,
"editor.formatOnSaveMode": "file",
"editor.insertSpaces": true,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"docs/**/*.csv": true,
"docs/**/*.mp4": true
},
"python.formatting.provider": "black"
},
"ruff.lineLength": 90,
"ruff.nativeServer": true,
"ruff.importStrategy": "fromEnvironment",
"ruff.lint.ignore": [
"W292",
"E402",
"E501",
"E731",
"E741",
],
"python.testing.pytestArgs": [
"feat"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ We also link to applicable licenses from models/code used in Py-Feat:
- MobileFaceNet: https://github.com/cunjian/pytorch_face_landmark (mobilefacenet)
- PFLD: https://github.com/cunjian/pytorch_face_landmark (pfld_compressed)
- Residual Masking Network: https://github.com/phamquiluan/ResidualMaskingNetwork/issues/18
- Facenet: https://github.com/timesler/facenet-pytorch/blob/master/LICENSE.md
- Facenet: https://github.com/timesler/facenet-pytorch/blob/master/LICENSE.md`
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Py-Feat currently supports both CPU and GPU processing on NVIDIA cards. We have

## Testing

The test have been relocated to `feat/tests/`.
All tests should be added to `feat/tests/`.
We use `pytest` for testing and `ruff` for linting and formatting.
Please ensure all tests pass before creating any pull request or larger change to the code base.

## Continuous Integration
Expand All @@ -48,7 +49,11 @@ Automated testing is handled by Github Actions according to the following rules:
*Note*: Each of these workflows can also be run manually. They can also be skipped by adding 'skip ci' anywhere inside your commit message.

## Model Weights
Model weights are stored as assets in release tag v0.1. They will automatically download as needed.
Py-feat will automatically download model weights as needed without any additional setup from the user.

As of version 0.7.0, all model weights are hosted on the [Py-feat HuggingFace Hub](https://huggingface.co/py-feat).

For prior versions, model weights are stored on Github static assets in release tagged `v0.1`. They will automatically download as needed.

## Licenses
Py-FEAT is provided under the MIT license. You also need to respect the licenses of each model you are using. Please see the LICENSE file for links to each model's license information.
8 changes: 4 additions & 4 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ parts:
- file: pages/models
- file: pages/au_reference
- file: pages/usage_guide
- file: pages/faqs
- caption: Basic Tutorials
chapters:
- file: basic_tutorials/01_basics
- file: basic_tutorials/02_detector_imgs
- file: basic_tutorials/03_detector_vids
- file: basic_tutorials/04_plotting
- file: basic_tutorials/05_fex_analysis
- file: basic_tutorials/02_detector_vids
- file: basic_tutorials/03_plotting
- file: basic_tutorials/04_fex_analysis
- caption: Advanced Tutorials
chapters:
- file: extra_tutorials/06_trainAUvisModel
Expand Down
3,181 changes: 3,099 additions & 82 deletions docs/basic_tutorials/01_basics.ipynb

Large diffs are not rendered by default.

1,526 changes: 0 additions & 1,526 deletions docs/basic_tutorials/02_detector_imgs.ipynb

This file was deleted.

Loading

0 comments on commit c4f6364

Please sign in to comment.