Skip to content

Commit 2892401

Browse files
committed
Merge branch 'release/v0.2.1'
2 parents 86055a0 + 07bf5c1 commit 2892401

28 files changed

+1060
-954
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ is available to guide the process: https://www.colour-science.org/contributing/.
1818
- [ ] Pyright static checking has been run and passed.
1919
- [ ] Pre-commit hooks have been run and passed.
2020

21-
<!-- The unit tests can be invoked with `poetry run invoke tests` -->
22-
<!-- Pyright can be started with `pyright --skipunannotated` -->
21+
<!-- The unit tests can be invoked with `uv run invoke tests` -->
22+
<!-- Pyright can be started with `pyright --threads --skipunannotated` -->
2323

2424
**Documentation**
2525

.github/workflows/continuous-integration-documentation.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ jobs:
77
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
88
strategy:
99
matrix:
10-
os: [ubuntu-22.04]
11-
python-version: [3.12]
10+
os: [ubuntu-latest]
11+
python-version: [3.13]
1212
fail-fast: false
1313
runs-on: ${{ matrix.os }}
1414
steps:
15-
- uses: actions/checkout@v1
15+
- uses: actions/checkout@v4
1616
- name: Environment Variables
1717
run: |
1818
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
@@ -22,27 +22,23 @@ jobs:
2222
echo "COLOUR_SCIENCE__DOCUMENTATION_BUILD=True" >> $GITHUB_ENV
2323
shell: bash
2424
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v4
25+
uses: actions/setup-python@v5
2626
with:
2727
python-version: ${{ matrix.python-version }}
2828
- name: Install Dependencies
2929
run: |
3030
sudo apt-get update
3131
sudo apt-get --yes install latexmk texlive-full
32-
- name: Install Poetry
33-
env:
34-
POETRY_VERSION: 1.4.0
32+
- name: Install uv
3533
run: |
36-
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
37-
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
34+
pip install uv
3835
shell: bash
3936
- name: Install Package Dependencies
4037
run: |
41-
poetry run python -m pip install --upgrade pip
42-
poetry install
43-
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
38+
uv sync --all-extras --no-dev
39+
uv run python -c "import imageio;imageio.plugins.freeimage.download()"
4440
shell: bash
4541
- name: Build Documentation
4642
run: |
47-
poetry run invoke docs
43+
uv run invoke docs
4844
shell: bash

.github/workflows/continuous-integration-quality-unit-tests.yml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ jobs:
77
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
88
strategy:
99
matrix:
10-
os: [macOS-latest, ubuntu-22.04, windows-2019]
11-
python-version: [3.9, "3.10", 3.11, 3.12]
10+
os: [macOS-latest, ubuntu-latest, windows-2019]
11+
python-version: ["3.10", 3.11, 3.12, 3.13]
1212
fail-fast: false
1313
runs-on: ${{ matrix.os }}
1414
steps:
15-
- uses: actions/checkout@v1
15+
- uses: actions/checkout@v4
1616
with:
1717
submodules: true
1818
- name: Environment Variables
@@ -22,41 +22,43 @@ jobs:
2222
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
2323
echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV
2424
shell: bash
25-
- name: Set up Python 3.9 for Pre-Commit
26-
uses: actions/setup-python@v4
25+
- name: Set up Python 3.10 for Pre-Commit
26+
uses: actions/setup-python@v5
2727
with:
28-
python-version: 3.9
28+
python-version: "3.10"
2929
- name: Set up Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v4
30+
uses: actions/setup-python@v5
3131
with:
3232
python-version: ${{ matrix.python-version }}
33-
- name: Install Poetry
34-
env:
35-
POETRY_VERSION: 1.4.0
33+
- name: Install Dependencies (macOS)
34+
if: matrix.os == 'macOS-latest'
3635
run: |
37-
curl -sSL https://install.python-poetry.org | POETRY_HOME=$HOME/.poetry python3 -
38-
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
36+
brew install freeimage
37+
# TODO: Drop when https://github.com/imageio/imageio/issues/628 is addressed
38+
echo "IMAGEIO_FREEIMAGE_LIB=/opt/homebrew/Cellar/freeimage/3.18.0/lib/libfreeimage.3.18.0.dylib" >> $GITHUB_ENV
39+
- name: Install uv
40+
run: |
41+
pip install uv
3942
shell: bash
4043
- name: Install Package Dependencies
4144
run: |
42-
poetry run python -m pip install --upgrade pip
43-
poetry install
44-
poetry run python -c "import imageio;imageio.plugins.freeimage.download()"
45+
uv sync --all-extras --no-dev
46+
uv run python -c "import imageio;imageio.plugins.freeimage.download()"
4547
shell: bash
4648
- name: Pre-Commit (All Files)
4749
run: |
48-
poetry run pre-commit run --all-files
50+
uv run pre-commit run --all-files
4951
shell: bash
5052
- name: Test Optimised Python Execution
5153
run: |
52-
poetry run python -OO -c "import $CI_PACKAGE"
54+
uv run python -OO -c "import $CI_PACKAGE"
5355
shell: bash
5456
- name: Test with Pytest
5557
run: |
56-
poetry run python -W ignore -m pytest --doctest-modules --ignore=$CI_PACKAGE/examples --ignore=$CI_PACKAGE/scripts/inference.py --cov=$CI_PACKAGE $CI_PACKAGE
58+
uv run python -W ignore -m pytest --doctest-modules --ignore=$CI_PACKAGE/examples --cov=$CI_PACKAGE $CI_PACKAGE
5759
shell: bash
5860
- name: Upload Coverage to coveralls.io
59-
if: matrix.os == 'macOS-latest' && matrix.python-version == '3.11'
61+
if: matrix.os == 'macOS-latest' && matrix.python-version == '3.12'
6062
run: |
61-
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else poetry run coveralls; fi
63+
if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo \"COVERALLS_REPO_TOKEN\" secret is undefined!; else uv run coveralls; fi
6264
shell: bash

.github/workflows/continuous-integration-static-type-checking.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ jobs:
1212
fail-fast: false
1313
runs-on: ${{ matrix.os }}
1414
steps:
15-
- uses: actions/checkout@v1
15+
- uses: actions/checkout@v4
1616
- name: Environment Variables
1717
run: |
1818
echo "CI_PACKAGE=colour_checker_detection" >> $GITHUB_ENV
1919
shell: bash
2020
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v4
21+
uses: actions/setup-python@v5
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424
- name: Install Package Dependencies
2525
run: |
26-
pip install -r requirements.txt
26+
cat requirements.txt | grep -Eo '(^[^#]+)' | xargs -n 1 pip install || true
2727
- name: Static Type Checking
2828
run: |
29-
pyright --skipunannotated
29+
pyright --threads --skipunannotated

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
.fleet
77
.idea
88
.ipynb_checkpoints
9+
.python-version
910
.sandbox
1011
.vs
1112
.vscode
@@ -17,4 +18,4 @@ colour_checker_detection.egg-info
1718
dist
1819
docs/_build
1920
docs/generated
20-
poetry.lock
21+
uv.lock

.pre-commit-config.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,23 @@ repos:
2525
- id: flynt
2626
args: [--verbose]
2727
- repo: https://github.com/PyCQA/isort
28-
rev: "5.12.0"
28+
rev: "5.13.2"
2929
hooks:
3030
- id: isort
3131
- repo: https://github.com/astral-sh/ruff-pre-commit
32-
rev: "v0.1.6"
32+
rev: "v0.1.14"
3333
hooks:
34+
- id: ruff-format
3435
- id: ruff
35-
- repo: https://github.com/psf/black-pre-commit-mirror
36-
rev: 23.11.0
37-
hooks:
38-
- id: black
39-
language_version: python3.9
4036
- repo: https://github.com/adamchainz/blacken-docs
4137
rev: 1.16.0
4238
hooks:
4339
- id: blacken-docs
44-
language_version: python3.9
40+
language_version: python3.10
4541
- repo: https://github.com/pre-commit/mirrors-prettier
4642
rev: "v3.1.0"
4743
hooks:
4844
- id: prettier
49-
exclude: config-aces-reference.ocio.yaml
5045
- repo: https://github.com/pre-commit/pygrep-hooks
5146
rev: "v1.10.0"
5247
hooks:

BIBLIOGRAPHY.bib

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
11
@misc{Abecassis2011,
2-
title = {OpenCV - Rotation (Deskewing)},
2+
title = {{{OpenCV}} - {{Rotation}} ({{Deskewing}})},
33
author = {Abecassis, Felix},
44
year = 2011,
5-
url = {http://felix.abecassis.me/2011/10/opencv-rotation-deskewing/},
65
urldate = {2018-10-27},
6+
howpublished = {http://felix.abecassis.me/2011/10/opencv-rotation-deskewing/},
7+
}
8+
@misc{Dallas2024,
9+
title = {[{{BUG}}]: {{Flipped}} Colour Chart},
10+
author = {Dallas, Jacob},
11+
year = 2024,
12+
month = jan,
13+
}
14+
@misc{Olferuk2019,
15+
title = {How to Force {{approxPolyDP}}() to Return Only the
16+
Best 4 Corners? - {{Opencv}} 2.4.2},
17+
author = {Olferuk, Alexander},
18+
year = 2019,
19+
month = mar,
20+
howpublished = {https://stackoverflow.com/a/55339684/931625},
21+
}
22+
@misc{Walter2022,
23+
title = {[{{ENHANCEMENT}}] {{Proposal}} to Allow Detection
24+
from Different Perspectives},
25+
author = {Walter, Tim},
26+
year = 2022,
27+
urldate = {2024-01-08},
28+
howpublished = {https://github.com/colour-science/colour-checker-detection/issues/60},
729
}

CONTRIBUTORS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Contributors
44
Development & Technical Support
55
-------------------------------
66

7-
- **Thomas Mansencal**, *Technology Supervisor @ Wētā FX*
7+
- **Thomas Mansencal**, *Principal Pipeline Programmer @ Epic Games*
88

99
Project coordination, overall development.
1010

README.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Colour - Checker Detection
1212
:target: https://coveralls.io/r/colour-science/colour-checker-detection
1313
:alt: Coverage Status
1414
.. |codacy| image:: https://img.shields.io/codacy/grade/c543bc30229347cdaea00aadd3f79499/develop.svg?style=flat-square
15-
:target: https://www.codacy.com/app/colour-science/colour-checker-detection
15+
:target: https://app.codacy.com/gh/colour-science/colour-checker-detection
1616
:alt: Code Grade
1717
.. |version| image:: https://img.shields.io/pypi/v/colour-checker-detection.svg?style=flat-square
1818
:target: https://pypi.org/project/colour-checker-detection
@@ -44,7 +44,8 @@ The following colour checker detection algorithms are implemented:
4444

4545
- The model is published on `HuggingFace <https://huggingface.co/colour-science/colour-checker-detection-models>`__,
4646
and was trained on a purposely constructed `dataset <https://huggingface.co/datasets/colour-science/colour-checker-detection-dataset>`__.
47-
- The model has only been trained on *ColorChecker Classic 24* images and will not work with *ColorChecker Nano* or *ColorChecker SG* images.
47+
- The model has only been trained on *ColorChecker Classic 24* images and
48+
will not work with *ColorChecker Nano* or *ColorChecker SG* images.
4849
- Inference is performed by a script licensed under the terms of the
4950
*GNU Affero General Public License v3.0* as it uses the
5051
*Ultralytics YOLOv8* API which is incompatible with the
@@ -74,16 +75,17 @@ Primary Dependencies
7475

7576
**Colour - Checker Detection** requires various dependencies in order to run:
7677

77-
- `python >= 3.9, < 4 <https://www.python.org/download/releases>`__
78-
- `colour-science >= 4.3 <https://pypi.org/project/colour-science>`__
78+
- `python >= 3.10, < 3.14 <https://www.python.org/download/releases>`__
79+
- `colour-science >= 4.5 <https://pypi.org/project/colour-science>`__
7980
- `imageio >= 2, < 3 <https://imageio.github.io>`__
80-
- `numpy >= 1.22, < 2 <https://pypi.org/project/numpy>`__
81+
- `numpy >= 1.24, < 3 <https://pypi.org/project/numpy>`__
8182
- `opencv-python >= 4, < 5 <https://pypi.org/project/opencv-python>`__
82-
- `scipy >= 1.8, < 2 <https://pypi.org/project/scipy>`__
83+
- `scipy >= 1.10, < 2 <https://pypi.org/project/scipy>`__
8384

8485
Secondary Dependencies
8586
~~~~~~~~~~~~~~~~~~~~~~
8687

88+
- `click >= 8, < 9 <https://pypi.org/project/click>`__
8789
- `ultralytics >= 8, < 9 <https://pypi.org/project/ultralytics>`__
8890

8991
Pypi

TODO.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ TODO
66

77
- colour_checker_detection/__init__.py
88

9-
- Line 92 : # TODO: Remove legacy printing support when deemed appropriate.
9+
- Line 90 : # TODO: Remove legacy printing support when deemed appropriate.
1010

1111

1212
- colour_checker_detection/detection/common.py
1313

1414
- Line 126 : # TODO: Update when "Colour" 0.4.5 is released.
15-
- Line 1131 : # TODO: Update when "Colour" 0.4.5 is released.
15+
- Line 1120 : # TODO: Update when "Colour" 0.4.5 is released.
1616

1717

1818
- colour_checker_detection/detection/tests/test_inference.py
1919

20-
- Line 62 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes.
21-
- Line 66 : # TODO: Enable when "torch" is available on Python 3.12.
22-
- Line 101 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes.
23-
- Line 105 : # TODO: Enable when "torch" is available on Python 3.12.
20+
- Line 58 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes.
21+
- Line 62 : # TODO: Enable when "torch" is available on Python 3.12.
22+
- Line 97 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes.
23+
- Line 101 : # TODO: Enable when "torch" is available on Python 3.12.
2424

2525

2626
- colour_checker_detection/detection/tests/test_segmentation.py
2727

28-
- Line 59 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes.
29-
- Line 151 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes.
28+
- Line 57 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes.
29+
- Line 147 : # TODO: Unit test is only reproducible on "macOs", skipping other OSes.
3030

3131
About
3232
-----

colour_checker_detection/__init__.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@
5858
ROOT_RESOURCES, "colour-checker-detection-tests-datasets"
5959
)
6060

61+
__all__ += ["ROOT_RESOURCES", "ROOT_RESOURCES_EXAMPLES", "ROOT_RESOURCES_TESTS"]
62+
6163
__application_name__ = "Colour - Checker Detection"
6264

6365
__major_version__ = "0"
6466
__minor_version__ = "2"
65-
__change_version__ = "0"
66-
__version__ = ".".join(
67-
(__major_version__, __minor_version__, __change_version__)
68-
)
67+
__change_version__ = "1"
68+
__version__ = ".".join((__major_version__, __minor_version__, __change_version__))
6969

7070
try:
7171
_version = (
@@ -83,9 +83,7 @@
8383
colour.utilities.ANCILLARY_COLOUR_SCIENCE_PACKAGES[ # pyright: ignore
8484
"colour-checker-detection"
8585
] = _version
86-
colour.utilities.ANCILLARY_RUNTIME_PACKAGES[ # pyright: ignore
87-
"opencv"
88-
] = cv2.__version__
86+
colour.utilities.ANCILLARY_RUNTIME_PACKAGES["opencv"] = cv2.__version__ # pyright: ignore
8987

9088
del _version
9189

0 commit comments

Comments
 (0)