keras-hub-nightly 0.19.0.dev202501270344__py3-none-any.whl → 0.19.0.dev202501280343__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.
- keras_hub/src/layers/preprocessing/image_converter.py +10 -0
- keras_hub/src/version_utils.py +1 -1
- {keras_hub_nightly-0.19.0.dev202501270344.dist-info → keras_hub_nightly-0.19.0.dev202501280343.dist-info}/METADATA +1 -1
- {keras_hub_nightly-0.19.0.dev202501270344.dist-info → keras_hub_nightly-0.19.0.dev202501280343.dist-info}/RECORD +6 -6
- {keras_hub_nightly-0.19.0.dev202501270344.dist-info → keras_hub_nightly-0.19.0.dev202501280343.dist-info}/WHEEL +0 -0
- {keras_hub_nightly-0.19.0.dev202501270344.dist-info → keras_hub_nightly-0.19.0.dev202501280343.dist-info}/top_level.txt +0 -0
@@ -98,6 +98,7 @@ class ImageConverter(PreprocessingLayer):
|
|
98
98
|
scale=None,
|
99
99
|
offset=None,
|
100
100
|
crop_to_aspect_ratio=True,
|
101
|
+
pad_to_aspect_ratio=False,
|
101
102
|
interpolation="bilinear",
|
102
103
|
data_format=None,
|
103
104
|
**kwargs,
|
@@ -112,12 +113,19 @@ class ImageConverter(PreprocessingLayer):
|
|
112
113
|
|
113
114
|
super().__init__(**kwargs)
|
114
115
|
|
116
|
+
if crop_to_aspect_ratio and pad_to_aspect_ratio:
|
117
|
+
raise ValueError(
|
118
|
+
"Only one of 'crop_to_aspect_ratio' or 'pad_to_aspect_ratio' "
|
119
|
+
"can be True."
|
120
|
+
)
|
121
|
+
|
115
122
|
# Create the `Resizing` layer here even if it's not being used. That
|
116
123
|
# allows us to make `image_size` a settable property.
|
117
124
|
self.resizing = keras.layers.Resizing(
|
118
125
|
height=image_size[0] if image_size else None,
|
119
126
|
width=image_size[1] if image_size else None,
|
120
127
|
crop_to_aspect_ratio=crop_to_aspect_ratio,
|
128
|
+
pad_to_aspect_ratio=pad_to_aspect_ratio,
|
121
129
|
interpolation=interpolation,
|
122
130
|
data_format=data_format,
|
123
131
|
dtype=self.dtype_policy,
|
@@ -126,6 +134,7 @@ class ImageConverter(PreprocessingLayer):
|
|
126
134
|
self.scale = scale
|
127
135
|
self.offset = offset
|
128
136
|
self.crop_to_aspect_ratio = crop_to_aspect_ratio
|
137
|
+
self.pad_to_aspect_ratio = pad_to_aspect_ratio
|
129
138
|
self.interpolation = interpolation
|
130
139
|
self.data_format = standardize_data_format(data_format)
|
131
140
|
|
@@ -182,6 +191,7 @@ class ImageConverter(PreprocessingLayer):
|
|
182
191
|
"offset": self.offset,
|
183
192
|
"interpolation": self.interpolation,
|
184
193
|
"crop_to_aspect_ratio": self.crop_to_aspect_ratio,
|
194
|
+
"pad_to_aspect_ratio": self.pad_to_aspect_ratio,
|
185
195
|
}
|
186
196
|
)
|
187
197
|
return config
|
keras_hub/src/version_utils.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: keras-hub-nightly
|
3
|
-
Version: 0.19.0.
|
3
|
+
Version: 0.19.0.dev202501280343
|
4
4
|
Summary: Industry-strength Natural Language Processing extensions for Keras.
|
5
5
|
Home-page: https://github.com/keras-team/keras-hub
|
6
6
|
Author: Keras team
|
@@ -9,7 +9,7 @@ keras_hub/api/tokenizers/__init__.py,sha256=mtJgQy1spfQnPAkeLoeinsT_W9iCWHlJXwzc
|
|
9
9
|
keras_hub/api/utils/__init__.py,sha256=Gp1E6gG-RtKQS3PBEQEOz9PQvXkXaJ0ySGMqZ7myN7A,215
|
10
10
|
keras_hub/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
11
|
keras_hub/src/api_export.py,sha256=9pQZK27JObxWZ96QPLBp1OBsjWigh1iuV6RglPGMRk0,1499
|
12
|
-
keras_hub/src/version_utils.py,sha256=
|
12
|
+
keras_hub/src/version_utils.py,sha256=BYMN8MdqYGNh0ZMZZs4-ZLx7RxSgYPR52_avVI8O49E,222
|
13
13
|
keras_hub/src/bounding_box/__init__.py,sha256=7i6KnGupN4AVivR_dFjQyuuTbI0GkHy8d-aMXeqZdU8,95
|
14
14
|
keras_hub/src/bounding_box/converters.py,sha256=UUp1hwegpDZyIo8sh9TLNy1v6JjwmvwzL6wmHFMAtbk,21916
|
15
15
|
keras_hub/src/bounding_box/formats.py,sha256=YmskOz2BOSat7NaE__J9VfpSNGPJJR0znSzA4lp8MMI,3868
|
@@ -35,7 +35,7 @@ keras_hub/src/layers/modeling/transformer_encoder.py,sha256=Qe19_aR6w4PTFbzvBmSP
|
|
35
35
|
keras_hub/src/layers/modeling/transformer_layer_utils.py,sha256=FuznrW33iG50B-VDN8R1RjuA5JG72yNMJ1TBgWLxR0E,3487
|
36
36
|
keras_hub/src/layers/preprocessing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
37
|
keras_hub/src/layers/preprocessing/audio_converter.py,sha256=YGh_kQw65a1Z6S5zzSNVP-ChyLYHq3-eOYpOS53xIN8,4156
|
38
|
-
keras_hub/src/layers/preprocessing/image_converter.py,sha256=
|
38
|
+
keras_hub/src/layers/preprocessing/image_converter.py,sha256=XwqgHYWj0Z14UMGQw5E4pOm3MmgbuvQpBcKl36e-nvo,10962
|
39
39
|
keras_hub/src/layers/preprocessing/masked_lm_mask_generator.py,sha256=itxWq3FHYlR0I7jKarQlSKbSmRLl9ut_UTSP3ZDwP0A,8162
|
40
40
|
keras_hub/src/layers/preprocessing/multi_segment_packer.py,sha256=ZNqnUFnc9Af122Q7T6YyUoXgIdU9AgIJfsvR1UrCjFU,12068
|
41
41
|
keras_hub/src/layers/preprocessing/preprocessing_layer.py,sha256=WyX41b9Ev_YJ5uVQVOAqD0PQasMOPDoyDjl_PkzkAkE,687
|
@@ -417,7 +417,7 @@ keras_hub/src/utils/transformers/convert_pali_gemma.py,sha256=B1leeDw96Yvu81hYum
|
|
417
417
|
keras_hub/src/utils/transformers/convert_vit.py,sha256=9SUZ9utNJhW_5cj3acMn9cRy47u2eIcDsrhmzj77o9k,5187
|
418
418
|
keras_hub/src/utils/transformers/preset_loader.py,sha256=DgGJXbTSB9Na8FIR-YWWVqQPOFxHwWrGm41EwcS_EFs,3797
|
419
419
|
keras_hub/src/utils/transformers/safetensor_utils.py,sha256=CYUHyA4y-B61r7NDnCsFb4t_UmSwZ1k9L-8gzEd6KRg,3339
|
420
|
-
keras_hub_nightly-0.19.0.
|
421
|
-
keras_hub_nightly-0.19.0.
|
422
|
-
keras_hub_nightly-0.19.0.
|
423
|
-
keras_hub_nightly-0.19.0.
|
420
|
+
keras_hub_nightly-0.19.0.dev202501280343.dist-info/METADATA,sha256=rQmXgDRW0OC18WtdqKFbRj7OEk0dZi7lBoEwjBwi_Ec,7498
|
421
|
+
keras_hub_nightly-0.19.0.dev202501280343.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
422
|
+
keras_hub_nightly-0.19.0.dev202501280343.dist-info/top_level.txt,sha256=N4J6piIWBKa38A4uV-CnIopnOEf8mHAbkNXafXm_CuA,10
|
423
|
+
keras_hub_nightly-0.19.0.dev202501280343.dist-info/RECORD,,
|
File without changes
|