Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 10, 2024
1 parent 8897941 commit 1f0ae6e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/source/onnx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ API Documentation
# Load a local converted/downloaded operator
onnx_loader.load_model("operators/kornia.color.gray.GrayscaleToRgb")
:members:
:members:
2 changes: 1 addition & 1 deletion kornia/color/gray.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import ClassVar, List, Optional
from typing import ClassVar, Optional

import torch

Expand Down
2 changes: 1 addition & 1 deletion kornia/geometry/transform/affwarp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import warnings
from typing import ClassVar, Optional, Tuple, Union
from typing import Optional, Tuple, Union

import torch

Expand Down
2 changes: 1 addition & 1 deletion kornia/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@
"is_mps_tensor_safe",
"dataclass_to_dict",
"dict_to_dataclass",
"get_sample_images"
"get_sample_images",
]
19 changes: 10 additions & 9 deletions kornia/utils/sample.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import os
import logging
import torch
import kornia
import requests
from io import BytesIO
import os
from typing import Optional, Union

from kornia.io import load_image
import requests

import kornia
from kornia.core import Tensor, stack
from kornia.core.external import PILImage as Image
from kornia.io import load_image

__all__ = [
"get_sample_images",
Expand Down Expand Up @@ -36,11 +35,13 @@ def download_image(url: str, save_to: str) -> None:


def get_sample_images(
resize: tuple[int, int] = None, paths: list[str] = IMAGE_URLS, download: bool = True,
cache_dir: Optional[str] = None
resize: tuple[int, int] = None,
paths: list[str] = IMAGE_URLS,
download: bool = True,
cache_dir: Optional[str] = None,
) -> Union[Tensor, list[Tensor]]:
"""Loads multiple images from the given URLs.
Optionally download them, resize them if specified, and return them as a batch of tensors or a list of tensors.
Args:
Expand Down

0 comments on commit 1f0ae6e

Please sign in to comment.