wandb 0.20.0__py3-none-musllinux_1_2_aarch64.whl → 0.20.1__py3-none-musllinux_1_2_aarch64.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.
- wandb/__init__.py +1 -1
- wandb/__init__.pyi +1 -1
- wandb/bin/wandb-core +0 -0
- wandb/sdk/data_types/image.py +31 -17
- {wandb-0.20.0.dist-info → wandb-0.20.1.dist-info}/METADATA +1 -1
- {wandb-0.20.0.dist-info → wandb-0.20.1.dist-info}/RECORD +9 -9
- {wandb-0.20.0.dist-info → wandb-0.20.1.dist-info}/WHEEL +0 -0
- {wandb-0.20.0.dist-info → wandb-0.20.1.dist-info}/entry_points.txt +0 -0
- {wandb-0.20.0.dist-info → wandb-0.20.1.dist-info}/licenses/LICENSE +0 -0
wandb/__init__.py
CHANGED
wandb/__init__.pyi
CHANGED
wandb/bin/wandb-core
CHANGED
Binary file
|
wandb/sdk/data_types/image.py
CHANGED
@@ -58,25 +58,39 @@ def _warn_on_invalid_data_range(
|
|
58
58
|
)
|
59
59
|
|
60
60
|
|
61
|
-
def
|
62
|
-
"""
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
61
|
+
def _guess_and_rescale_to_0_255(data: "np.ndarray") -> "np.ndarray":
|
62
|
+
"""Guess the image's format and rescale its values to the range [0, 255].
|
63
|
+
|
64
|
+
This is an unfortunate design flaw carried forward for backward
|
65
|
+
compatibility. A better design would have been to document the expected
|
66
|
+
data format and not mangle the data provided by the user.
|
67
|
+
|
68
|
+
If given data in the range [0, 1], we multiply all values by 255
|
69
|
+
and round down to get integers.
|
70
|
+
|
71
|
+
If given data in the range [-1, 1], we rescale it by mapping -1 to 0 and
|
72
|
+
1 to 255, then round down to get integers.
|
73
|
+
|
74
|
+
We clip and round all other data.
|
75
|
+
"""
|
76
|
+
try:
|
77
|
+
import numpy as np
|
78
|
+
except ImportError:
|
79
|
+
raise wandb.Error(
|
80
|
+
"wandb.Image requires numpy if not supplying PIL images: pip install numpy"
|
81
|
+
) from None
|
67
82
|
|
68
|
-
|
69
|
-
|
70
|
-
if np.min(data) < 0:
|
71
|
-
data = data - np.min(data)
|
83
|
+
data_min: float = data.min()
|
84
|
+
data_max: float = data.max()
|
72
85
|
|
73
|
-
if
|
74
|
-
|
86
|
+
if 0 <= data_min and data_max <= 1:
|
87
|
+
return (data * 255).astype(np.uint8)
|
75
88
|
|
76
|
-
|
77
|
-
|
89
|
+
elif -1 <= data_min and data_max <= 1:
|
90
|
+
return (255 * 0.5 * (data + 1)).astype(np.uint8)
|
78
91
|
|
79
|
-
|
92
|
+
else:
|
93
|
+
return data.clip(0, 255).astype(np.uint8)
|
80
94
|
|
81
95
|
|
82
96
|
def _convert_to_uint8(data: "np.ndarray") -> "np.ndarray":
|
@@ -393,7 +407,7 @@ class Image(BatchableMedia):
|
|
393
407
|
|
394
408
|
_warn_on_invalid_data_range(data, normalize)
|
395
409
|
|
396
|
-
data =
|
410
|
+
data = _guess_and_rescale_to_0_255(data) if normalize else data # type: ignore [arg-type]
|
397
411
|
data = _convert_to_uint8(data)
|
398
412
|
|
399
413
|
if data.ndim > 2:
|
@@ -413,7 +427,7 @@ class Image(BatchableMedia):
|
|
413
427
|
_warn_on_invalid_data_range(data, normalize) # type: ignore [arg-type]
|
414
428
|
|
415
429
|
mode = mode or self.guess_mode(data, file_type)
|
416
|
-
data =
|
430
|
+
data = _guess_and_rescale_to_0_255(data) if normalize else data # type: ignore [arg-type]
|
417
431
|
data = _convert_to_uint8(data) # type: ignore [arg-type]
|
418
432
|
self._image = pil_image.fromarray(
|
419
433
|
data,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
package_readme.md,sha256=U9047nyMDICgctm1HLm4HfXwFnFKsEn2m77hsYPUZ1I,4298
|
2
2
|
wandb/jupyter.py,sha256=ADLvYDYK4mSJrsxmwVuE6IBx5o8prFMQvCizm-13_bg,17350
|
3
3
|
wandb/__main__.py,sha256=gripuDgB7J8wMMeJt4CIBRjn1BMSFr5zvsrt585Pnj4,64
|
4
|
-
wandb/__init__.py,sha256=
|
4
|
+
wandb/__init__.py,sha256=voeAUjikukV1wUbzWpSRKezgf6AEE6NODckD2qsuHCU,7072
|
5
5
|
wandb/wandb_agent.py,sha256=kdlK_NZRZRNkjXRUha7Q-1fDOARf7v0TyIr_a-aRXKk,20868
|
6
6
|
wandb/trigger.py,sha256=PaitU3sX6ekGkd2R8iD6d_VtI72ypF7LaPBXh3rXY7Q,615
|
7
7
|
wandb/wandb_run.py,sha256=CNh9S6uubFk8FphQjzkbvedyyGCN9aBEsRBKjy8tqqs,155
|
@@ -12,7 +12,7 @@ wandb/_iterutils.py,sha256=NX6MaIE3JzPXsqKNXUKdnpIlX0spGG8HwGIQt5VASrk,2400
|
|
12
12
|
wandb/wandb_controller.py,sha256=SksJdgwn14PpnUoIaBjJ9Ki4Nksl9BpQGGn42hT0xZg,24936
|
13
13
|
wandb/data_types.py,sha256=M-wqAO0FtIqvj28556u3h4nzSwlRcbxhXoX0B9jlJSo,2283
|
14
14
|
wandb/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
15
|
-
wandb/__init__.pyi,sha256=
|
15
|
+
wandb/__init__.pyi,sha256=nWUVGrUbymxXWlYwbkoakcN5EbXF-15ZJkXThTGKXTg,48123
|
16
16
|
wandb/_pydantic/__init__.py,sha256=p1Rwdo5z3rgoQgVDz6pgcWzs5eitB2JlgVN6QeFyN0Y,662
|
17
17
|
wandb/_pydantic/base.py,sha256=qOgf1LEMPO3o1kiYli9kOf2ZQLuP0GEMa8Qx2pDnJGY,4277
|
18
18
|
wandb/_pydantic/utils.py,sha256=XcnRAEOdjANLxvr_FMnMPKmqv4f2HwjbNo-5J_JKKe0,2810
|
@@ -278,7 +278,7 @@ wandb/sdk/data_types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
|
|
278
278
|
wandb/sdk/data_types/saved_model.py,sha256=OKk1IB3q1HC-VRQMD2CTNP1h_Ca_15NRAMY5LXLjO7o,16310
|
279
279
|
wandb/sdk/data_types/graph.py,sha256=_P_z2dNj2mCJeSvusIfVHkSkVB9AL0AEO-6KaguC1ys,12089
|
280
280
|
wandb/sdk/data_types/table_decorators.py,sha256=2D0dlnv7sBvrHyYH61LCCMhowmg8CENqyvth9BID-VQ,3727
|
281
|
-
wandb/sdk/data_types/image.py,sha256=
|
281
|
+
wandb/sdk/data_types/image.py,sha256=xdYth860StgcqoUJ0o4NPncj83XB5BRWI7ypY5PbrUY,34811
|
282
282
|
wandb/sdk/data_types/trace_tree.py,sha256=i0LaWCnZsmTY560byG6_K4D9a6LTWDYJDKrnPe2YhwE,14838
|
283
283
|
wandb/sdk/data_types/video.py,sha256=JQ9ZJ-IqocQ7fI9iGswG_JwB0gUk89JXgMSUOemVak8,9835
|
284
284
|
wandb/sdk/data_types/object_3d.py,sha256=83ordMmzmmFun2fp2z9P3dffNJ0fW_Hv7MfpDZROYcc,16282
|
@@ -738,7 +738,7 @@ wandb/errors/util.py,sha256=YqO_fpZeXubXWBUAVQ6gmuLAiz3Q9pYVE5LbQ2Rq5Ck,1711
|
|
738
738
|
wandb/errors/links.py,sha256=sNwJ74e9qb0w4GRZfnbPXK5ZdpIqc5lkuaT4T2Snnqw,2520
|
739
739
|
wandb/errors/warnings.py,sha256=kyLP3bfXSmlztp8nOepLtfTdM-03N-i7Ho1Y568BOtk,57
|
740
740
|
wandb/errors/term.py,sha256=kH_noQvl9BDsGBXm7fQfH5u0ERmI6bOZa8Rp49DoAPk,12207
|
741
|
-
wandb/bin/wandb-core,sha256=
|
741
|
+
wandb/bin/wandb-core,sha256=IlVdPAML3Y_pzmFa0-hIln3NLaflbnv6AZXxM1t32Ug,54591672
|
742
742
|
wandb/bin/gpu_stats,sha256=KxttnJk3Rf3ytDyAD58578Alpqde9n42woJqifS0uuk,10416408
|
743
743
|
wandb/apis/__init__.py,sha256=uPZKqlX8Y9YcHoERJshWRGS3ukMOIVWi4sDnkO5_CYY,1338
|
744
744
|
wandb/apis/internal.py,sha256=Whl1x29iH_DdIu47vUVvDSyOavEVaovdmlqXmu4-yOw,7622
|
@@ -907,8 +907,8 @@ wandb/proto/v3/wandb_server_pb2.py,sha256=LQCUmuy0NFDo20N9uCUiE5VPyhP5r929WKtnia
|
|
907
907
|
wandb/proto/v3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
908
908
|
wandb/proto/v3/wandb_settings_pb2.py,sha256=_zutPZ7EPxQjX5umK5bNRyyhnVxcBYJk0-GbZeS7HFY,21524
|
909
909
|
wandb/proto/v3/wandb_internal_pb2.py,sha256=xKTg9CalkBOznziFa5fA9kirA9kqg72QbEANoMvcSDI,118397
|
910
|
-
wandb-0.20.
|
911
|
-
wandb-0.20.
|
912
|
-
wandb-0.20.
|
913
|
-
wandb-0.20.
|
914
|
-
wandb-0.20.
|
910
|
+
wandb-0.20.1.dist-info/RECORD,,
|
911
|
+
wandb-0.20.1.dist-info/entry_points.txt,sha256=v4FCOZ9gW7Pc6KLsmgQqpCiKTrA1wh2XHmNf-NUP1-I,67
|
912
|
+
wandb-0.20.1.dist-info/WHEEL,sha256=ZCaGMInsobf_X8ibOue5yAC0a46KTbFsnGjtmL2skyU,106
|
913
|
+
wandb-0.20.1.dist-info/METADATA,sha256=EcYDqPeeoZYy-r-YORdy-49B7a9AswwzGfIU1lA61-k,10307
|
914
|
+
wandb-0.20.1.dist-info/licenses/LICENSE,sha256=izOKRJpGOx1PrJiGOKR0HsNdlB5JdH2d0Z4P7a7ssTc,1081
|
File without changes
|
File without changes
|
File without changes
|