Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit suggestions (#2894)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit suggestions

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.1 → v0.4.2](astral-sh/ruff-pre-commit@v0.4.1...v0.4.2)

* fix up031

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: João Gustavo A. Amorim <joaogustavoamorim@gmail.com>
  • Loading branch information
pre-commit-ci[bot] and johnnv1 committed May 15, 2024
1 parent 8fbb9fb commit 9d319ab
Show file tree
Hide file tree
Showing 3 changed files with 244 additions and 171 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ repos:
exclude: ^$|.devcontainer

- repo: https://github.com/tox-dev/pyproject-fmt
rev: "1.8.0"
rev: "2.0.4"
hooks:
- id: pyproject-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
rev: v0.4.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
4 changes: 2 additions & 2 deletions kornia/utils/image_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def rgb2short(rgb: str) -> Tuple[str, str]:
res.append(closest)
break
i += 1
_res = "".join([("%02.x" % i) for i in res])
_res = "".join([f"{i:02x}" for i in res])
equiv = RGB2SHORT_DICT[_res]
return equiv, _res

Expand Down Expand Up @@ -365,7 +365,7 @@ def image_to_string(image: Tensor, max_width: int = 256) -> str:
r, g, b = image[:, y, x]
h = f"{r:2x}{g:2x}{b:2x}"
short, _ = rgb2short(h)
res += "\033[48;5;%sm " % short
res += f"\033[48;5;{short}m "
res += "\033[0m\n"
return res

Expand Down

0 comments on commit 9d319ab

Please sign in to comment.