__init__.py 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # LICENSE HEADER MANAGED BY add-license-header
  2. #
  3. # Copyright 2018 Kornia Team
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. from ._compat import torch_meshgrid
  18. from .download import CachedDownloader
  19. from .draw import draw_convex_polygon, draw_line, draw_point2d, draw_rectangle
  20. from .grid import create_meshgrid, create_meshgrid3d
  21. from .helpers import (
  22. _extract_device_dtype,
  23. dataclass_to_dict,
  24. deprecated,
  25. dict_to_dataclass,
  26. get_cuda_device_if_available,
  27. get_cuda_or_mps_device_if_available,
  28. get_mps_device_if_available,
  29. is_autocast_enabled,
  30. is_mps_tensor_safe,
  31. map_location_to_cpu,
  32. safe_inverse_with_mask,
  33. safe_solve_with_mask,
  34. xla_is_available,
  35. )
  36. from .image import ImageToTensor, image_list_to_tensor, image_to_tensor, tensor_to_image
  37. from .image_print import image_to_string, print_image
  38. from .memory import batched_forward
  39. from .misc import (
  40. differentiable_clipping,
  41. differentiable_polynomial_floor,
  42. differentiable_polynomial_rounding,
  43. eye_like,
  44. vec_like,
  45. )
  46. from .one_hot import one_hot
  47. from .pointcloud_io import load_pointcloud_ply, save_pointcloud_ply
  48. from .sample import get_sample_images
  49. __all__ = [
  50. "CachedDownloader",
  51. "ImageToTensor",
  52. "_extract_device_dtype",
  53. "batched_forward",
  54. "create_meshgrid",
  55. "create_meshgrid3d",
  56. "dataclass_to_dict",
  57. "deprecated",
  58. "dict_to_dataclass",
  59. "draw_convex_polygon",
  60. "draw_line",
  61. "draw_point2d",
  62. "draw_rectangle",
  63. "eye_like",
  64. "get_cuda_device_if_available",
  65. "get_cuda_or_mps_device_if_available",
  66. "get_mps_device_if_available",
  67. "get_sample_images",
  68. "image_list_to_tensor",
  69. "image_to_string",
  70. "image_to_tensor",
  71. "is_autocast_enabled",
  72. "is_mps_tensor_safe",
  73. "load_pointcloud_ply",
  74. "map_location_to_cpu",
  75. "one_hot",
  76. "print_image",
  77. "safe_inverse_with_mask",
  78. "safe_solve_with_mask",
  79. "save_pointcloud_ply",
  80. "tensor_to_image",
  81. "torch_meshgrid",
  82. "vec_like",
  83. "xla_is_available",
  84. ]