code-loader 1.0.81a0__py3-none-any.whl → 1.0.82__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,6 +27,7 @@ class LeapDataType(Enum):
27
27
  TextMask = 'TextMask'
28
28
  ImageWithBBox = 'ImageWithBBox'
29
29
  ImageWithHeatmap = 'ImageWithHeatmap'
30
+ Video = 'Video'
30
31
 
31
32
 
32
33
  class MetricDirection(Enum):
@@ -53,6 +53,30 @@ class LeapImage:
53
53
  validate_type(type(self.compress), bool, 'compress flag must be a boolean')
54
54
 
55
55
 
56
+ @dataclass
57
+ class LeapVideo:
58
+ """
59
+ Visualizer representing a video for Tensorleap.
60
+
61
+ Attributes:
62
+ data (npt.NDArray[np.float32] | npt.NDArray[np.uint8]): The video data, shaped [T, H, W, C], where T is the number of frames.
63
+ type (LeapDataType): The data type, default is LeapDataType.Video.
64
+
65
+ Example:
66
+ video_data = np.random.rand(10, 100, 100, 3).astype(np.float32)
67
+ leap_video = LeapVideo(data=video_data)
68
+ """
69
+ data: Union[npt.NDArray[np.float32], npt.NDArray[np.uint8]]
70
+ type: LeapDataType = LeapDataType.Video
71
+
72
+ def __post_init__(self) -> None:
73
+ validate_type(self.type, LeapDataType.Video)
74
+ validate_type(type(self.data), np.ndarray)
75
+ validate_type(self.data.dtype, [np.uint8, np.float32])
76
+ validate_type(len(self.data.shape), 4, 'Video must be of shape 4')
77
+ validate_type(self.data.shape[3], [1, 3], 'Video channel must be either 3(rgb) or 1(gray)')
78
+
79
+
56
80
  @dataclass
57
81
  class LeapImageWithBBox:
58
82
  """
@@ -308,6 +332,7 @@ class LeapImageWithHeatmap:
308
332
  map_leap_data_type_to_visualizer_class = {
309
333
  LeapDataType.Image.value: LeapImage,
310
334
  LeapDataType.Graph.value: LeapGraph,
335
+ LeapDataType.Video.value: LeapVideo,
311
336
  LeapDataType.Text.value: LeapText,
312
337
  LeapDataType.HorizontalBar.value: LeapHorizontalBar,
313
338
  LeapDataType.ImageMask.value: LeapImageMask,
code_loader/leaploader.py CHANGED
@@ -462,7 +462,7 @@ class LeapLoader(LeapLoaderBase):
462
462
 
463
463
  try:
464
464
  is_none = False
465
- if value is None or (isinstance(value, (int, float, np.integer, np.floating)) and not np.isfinite(value)):
465
+ if value is None:
466
466
  raise ValueError()
467
467
  converted_value = metadata_type_to_python_type[metadata_name_to_type[metadata_name]](value)
468
468
  except ValueError:
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: code-loader
3
- Version: 1.0.81a0
3
+ Version: 1.0.82
4
4
  Summary:
5
- Home-page: https://github.com/tensorleap/code-loader
6
5
  License: MIT
7
6
  Author: dorhar
8
7
  Author-email: doron.harnoy@tensorleap.ai
@@ -17,6 +16,7 @@ Requires-Dist: numpy (>=1.22.3,<2.0.0)
17
16
  Requires-Dist: psutil (>=5.9.5,<6.0.0)
18
17
  Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
19
18
  Requires-Dist: requests (>=2.32.3,<3.0.0)
19
+ Project-URL: Homepage, https://github.com/tensorleap/code-loader
20
20
  Project-URL: Repository, https://github.com/tensorleap/code-loader
21
21
  Description-Content-Type: text/markdown
22
22
 
@@ -1,11 +1,10 @@
1
- LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
2
1
  code_loader/__init__.py,sha256=6MMWr0ObOU7hkqQKgOqp4Zp3I28L7joGC9iCbQYtAJg,241
3
2
  code_loader/contract/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
3
  code_loader/contract/datasetclasses.py,sha256=rpsccWddYksLQhB0fDZKZsiuclb32wtAraLtvXZ0teM,7912
5
- code_loader/contract/enums.py,sha256=6Lo7p5CUog68Fd31bCozIuOgIp_IhSiPqWWph2k3OGU,1602
4
+ code_loader/contract/enums.py,sha256=GEFkvUMXnCNt-GOoz7NJ9ecQZ2PPDettJNOsxsiM0wk,1622
6
5
  code_loader/contract/exceptions.py,sha256=jWqu5i7t-0IG0jGRsKF4DjJdrsdpJjIYpUkN1F4RiyQ,51
7
6
  code_loader/contract/responsedataclasses.py,sha256=RSx9m_R3LawhK5o1nAcO3hfp2F9oJYtxZr_bpP3bTmw,4005
8
- code_loader/contract/visualizer_classes.py,sha256=m31lg2P2QJs3Reqr6-N1AlVhH3RxPr772Jw3LuIVCVM,14177
7
+ code_loader/contract/visualizer_classes.py,sha256=_nlukRfW8QeQaQG7G5HfAUSeCuoqslB4xJS2AGI_Nz8,15156
9
8
  code_loader/default_losses.py,sha256=NoOQym1106bDN5dcIk56Elr7ZG5quUHArqfP5-Nyxyo,1139
10
9
  code_loader/default_metrics.py,sha256=v16Mrt2Ze1tXPgfKywGVdRSrkaK4CKLNQztN1UdVqIY,5010
11
10
  code_loader/experiment_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -21,12 +20,12 @@ code_loader/experiment_api/workingspace_config_utils.py,sha256=DLzXQCg4dgTV_YgaS
21
20
  code_loader/inner_leap_binder/__init__.py,sha256=koOlJyMNYzGbEsoIbXathSmQ-L38N_pEXH_HvL7beXU,99
22
21
  code_loader/inner_leap_binder/leapbinder.py,sha256=M444xdt6WsQfJmKxmnmhdyo_qtfLZ2NDqQB4pHU0Wsc,30613
23
22
  code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=qcYyekpIN1hgbmSqTrN7o6IMpfu8ZWp2J_lhMEoV8I8,22598
24
- code_loader/leaploader.py,sha256=QPBG7xrNdzhnOiRtwUlVosyYcFNC_ivWgoS8nWOZ_5M,25768
23
+ code_loader/leaploader.py,sha256=AUx6iqJK9DzIrdDGvfM3cWNejoK7aDTsU_ShhphVrfM,25679
25
24
  code_loader/leaploaderbase.py,sha256=VH0vddRmkqLtcDlYPCO7hfz1_VbKo43lUdHDAbd4iJc,4198
26
25
  code_loader/utils.py,sha256=aw2i_fqW_ADjLB66FWZd9DfpCQ7mPdMyauROC5Nd51I,2197
27
26
  code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
27
  code_loader/visualizers/default_visualizers.py,sha256=Ffx5VHVOe5ujBOsjBSxN_aIEVwFSQ6gbhTMG5aUS-po,2305
29
- code_loader-1.0.81a0.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
30
- code_loader-1.0.81a0.dist-info/METADATA,sha256=g0WzhZyKvBxa0ufE_U0ujUNR1PITvSmAblWtmIDglsc,851
31
- code_loader-1.0.81a0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
32
- code_loader-1.0.81a0.dist-info/RECORD,,
28
+ code_loader-1.0.82.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
29
+ code_loader-1.0.82.dist-info/METADATA,sha256=Lt4JjzWPP-pgZI4N3R_BOe6w1Q7KK6ZPmYG0p-uU_Gw,861
30
+ code_loader-1.0.82.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
31
+ code_loader-1.0.82.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.0
2
+ Generator: poetry-core 2.1.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 TensorLeap
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
File without changes