-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* iWIP * pre-commit * wip * fix pylint * fix ruff * fix mypy * fix pyright * fix docker base image (todo find latest working) * WIP * fix deprecation pkg_resources warnings * wip * wip * wip * wip * wip * disable python cache for tests * fix typing * wip * add comment about python3.10 in README * use image variable in Makefile * evaluation wip * [WIP] evaluation * add tqdm progressbars * write evaluation metrics to redis * update evaluation * wip * ci * _ * wip * fix pre-commit
- Loading branch information
Showing
15 changed files
with
465 additions
and
96 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.ipynb |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-yaml | ||
- id: check-json | ||
- id: check-ast | ||
- id: check-byte-order-marker | ||
- id: check-builtin-literals | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
- id: check-merge-conflict | ||
- id: detect-private-key | ||
- id: double-quote-string-fixer | ||
- id: name-tests-test | ||
- id: requirements-txt-fixer | ||
|
||
- repo: https://github.com/asottile/add-trailing-comma | ||
rev: v2.3.0 | ||
hooks: | ||
- id: add-trailing-comma | ||
|
||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.1.0 | ||
hooks: | ||
- id: pyupgrade | ||
|
||
- repo: https://github.com/pre-commit/mirrors-autopep8 | ||
rev: v1.7.0 | ||
hooks: | ||
- id: autopep8 | ||
|
||
- repo: https://github.com/PyCQA/autoflake | ||
rev: v1.7.6 | ||
hooks: | ||
- id: autoflake | ||
|
||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: v0.0.254 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
|
||
- repo: https://github.com/PyCQA/pylint | ||
rev: v2.17.0 | ||
hooks: | ||
- id: pylint | ||
additional_dependencies: ["pylint-per-file-ignores"] | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.982 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: [types-redis] | ||
|
||
- repo: https://github.com/RobertCraigie/pyright-python | ||
rev: v1.1.299 | ||
hooks: | ||
- id: pyright |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM alpine/curl as downloader | ||
RUN curl -L https://tfhub.dev/google/spice/2?tf-hub-format=compressed --output spice_2.tar.gz && \ | ||
mkdir /spice_model && \ | ||
tar xvf spice_2.tar.gz --directory /spice_model && \ | ||
rm spice_2.tar.gz | ||
|
||
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 | ||
|
||
# https://github.com/NVIDIA/nvidia-docker/wiki/Usage | ||
# https://github.com/NVIDIA/nvidia-docker/issues/531 | ||
ENV NVIDIA_DRIVER_CAPABILITIES compute,video,utility | ||
|
||
COPY --from=downloader /spice_model /spice_model | ||
|
||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common && \ | ||
add-apt-repository -y ppa:deadsnakes/ppa && \ | ||
apt-get install -y python3.10-venv libsndfile-dev libasound-dev portaudio19-dev | ||
|
||
# https://pythonspeed.com/articles/activate-virtualenv-dockerfile/ | ||
ENV VIRTUAL_ENV=/venv | ||
RUN python3.10 -m venv $VIRTUAL_ENV | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
|
||
WORKDIR /app | ||
COPY pyproject.toml . | ||
COPY README.md . | ||
COPY pitch_detectors /app/pitch_detectors | ||
COPY tests /app/tests | ||
COPY data /app/data | ||
|
||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install --upgrade pip setuptools wheel && \ | ||
pip install .[dev] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
IMAGE = tandav/pitch-detectors:11.8.0-cudnn8-devel-ubuntu22.04 | ||
|
||
.PHONY: build | ||
build: | ||
DOCKER_BUILDKIT=1 docker build --progress=plain -t $(IMAGE) . | ||
|
||
.PHONY: push | ||
push: | ||
docker push $(IMAGE) | ||
docker push tandav/pitch-detectors:latest | ||
|
||
.PHONY: test | ||
test: build | ||
docker run --rm -t --gpus all \ | ||
-e PITCH_DETECTORS_GPU=true \ | ||
$(IMAGE) \ | ||
pytest -v --cov pitch_detectors | ||
|
||
.PHONY: test-no-gpu | ||
test-no-gpu: build | ||
docker run --rm -t \ | ||
-e PITCH_DETECTORS_GPU=false \ | ||
$(IMAGE) \ | ||
pytest -v --cov pitch_detectors | ||
|
||
.PHONY: evaluation | ||
evaluation: build | ||
eval "$$(cat .env)"; \ | ||
docker run --rm -t --gpus all \ | ||
-e PITCH_DETECTORS_GPU=true \ | ||
-e REDIS_URL=$$REDIS_URL \ | ||
-v /home/tandav/Downloads/MIR-1K:/app/MIR-1K \ | ||
$(IMAGE) \ | ||
python pitch_detectors/evaluation.py |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Oops, something went wrong.