tf-models-nightly 2.18.0.dev20241022__py2.py3-none-any.whl → 2.18.0.dev20241024__py2.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.
@@ -182,7 +182,7 @@ def resize_and_crop_image(
182
182
  2. Pad the rescaled image to the padded_size.
183
183
 
184
184
  Args:
185
- image: a `Tensor` of shape [height, width, 3] representing an image.
185
+ image: a `Tensor` of shape [height, width, c] representing an image.
186
186
  desired_size: a `Tensor` or `int` list/tuple of two elements representing
187
187
  [height, width] of the desired actual output image size.
188
188
  padded_size: a `Tensor` or `int` list/tuple of two elements representing
@@ -201,7 +201,7 @@ def resize_and_crop_image(
201
201
  behaviour is to place it at left top corner.
202
202
 
203
203
  Returns:
204
- output_image: `Tensor` of shape [height, width, 3] where [height, width]
204
+ output_image: `Tensor` of shape [height, width, c] where [height, width]
205
205
  equals to `output_size`.
206
206
  image_info: a 2D `Tensor` that encodes the information of the image and the
207
207
  applied preprocessing. It is in the format of
@@ -786,7 +786,7 @@ def random_horizontal_flip(
786
786
  """Randomly flips input image and bounding boxes and/or masks horizontally.
787
787
 
788
788
  Expects input tensors without the batch dimension; i.e. for RGB image assume
789
- rank-3 input like [h, w, 3], for masks assume either [h, w, 1] or [1, h, w].
789
+ rank-3 input like [h, w, c], for masks assume either [h, w, 1] or [1, h, w].
790
790
 
791
791
  Args:
792
792
  image: `tf.Tensor`, the image to apply the random flip, [h, w, channels].
@@ -80,11 +80,19 @@ class InputUtilsTest(parameterized.TestCase, tf.test.TestCase):
80
80
  aug_scale_max=2.0,
81
81
  output_scales=(20 / 100, 10 / 200),
82
82
  ),
83
+ dict(
84
+ testcase_name='no_jittering_with_4_channels',
85
+ input_size=(100, 200),
86
+ desired_size=(20, 10),
87
+ aug_scale_max=1.0,
88
+ output_scales=(20 / 100, 10 / 200),
89
+ channels=4,
90
+ ),
83
91
  )
84
92
  def test_resize_and_crop_image_not_keep_aspect_ratio(
85
- self, input_size, desired_size, aug_scale_max, output_scales
93
+ self, input_size, desired_size, aug_scale_max, output_scales, channels=3
86
94
  ):
87
- image = tf.convert_to_tensor(np.random.rand(*input_size, 3))
95
+ image = tf.convert_to_tensor(np.random.rand(*input_size, channels))
88
96
 
89
97
  resized_image, image_info = preprocess_ops.resize_and_crop_image(
90
98
  image,
@@ -95,7 +103,7 @@ class InputUtilsTest(parameterized.TestCase, tf.test.TestCase):
95
103
  )
96
104
  resized_image_shape = tf.shape(resized_image)
97
105
 
98
- self.assertAllEqual([*desired_size, 3], resized_image_shape.numpy())
106
+ self.assertAllEqual([*desired_size, channels], resized_image_shape.numpy())
99
107
  if aug_scale_max == 1:
100
108
  self.assertNDArrayNear(
101
109
  [input_size, desired_size, output_scales, [0.0, 0.0]],
@@ -108,7 +116,7 @@ class InputUtilsTest(parameterized.TestCase, tf.test.TestCase):
108
116
  (100, 256, 128, 256, 32, 1.0, 1.0, 128, 256),
109
117
  (200, 512, 200, 128, 32, 0.25, 0.25, 224, 128),
110
118
  )
111
- def test_resize_and_crop_image_rectangluar_case(
119
+ def test_resize_and_crop_image_rectangular_case(
112
120
  self,
113
121
  input_height,
114
122
  input_width,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tf-models-nightly
3
- Version: 2.18.0.dev20241022
3
+ Version: 2.18.0.dev20241024
4
4
  Summary: TensorFlow Official Models
5
5
  Home-page: https://github.com/tensorflow/models
6
6
  Author: Google Inc.
@@ -1133,10 +1133,10 @@ official/vision/ops/iou_similarity_test.py,sha256=x5jlcMqMCUYC5cRgdbR0VlAW67AoXo
1133
1133
  official/vision/ops/mask_ops.py,sha256=cZLpIowzEA57bXPDbVXa6mktZVHvGSH-TQ1CxHjpQXw,10270
1134
1134
  official/vision/ops/mask_ops_test.py,sha256=D3xbbbleJd4HkpWOSDSEy6hNihsRBY93BqPF6JP-dJk,2835
1135
1135
  official/vision/ops/nms.py,sha256=bKYDAtyV5j6PG7g-RGF2ZccCI5V1xVvuajNblCy1TGs,8125
1136
- official/vision/ops/preprocess_ops.py,sha256=JnelXrBbfFkdyz5UbrZxnD_N4RdN_axFa7FNFxeSpdQ,42588
1136
+ official/vision/ops/preprocess_ops.py,sha256=1NcE_iFPyzREdql0CRKGobFieCA6niSJcXV3Uqw635k,42588
1137
1137
  official/vision/ops/preprocess_ops_3d.py,sha256=o0ivTBK2BwaiPp_NhVG_yBc10VUySxfE7eKQkL7RNaU,16762
1138
1138
  official/vision/ops/preprocess_ops_3d_test.py,sha256=LA3-Ue4FTjdsr5Kl_BnpAMNcfikWylMisD2GrBTOLzA,9309
1139
- official/vision/ops/preprocess_ops_test.py,sha256=VXcILiqjWPcVHCVjx7i0iiPV6FP0s9pZ7LhXPwVPNHs,17392
1139
+ official/vision/ops/preprocess_ops_test.py,sha256=0ZZXkOnjfxax2R0womyyhIKPecyF9wvZm82PpzdClM8,17658
1140
1140
  official/vision/ops/sampling_ops.py,sha256=1jywCA_E4qDUFWsykCLUwZsWtQSR0QREXdJhvP5qCvc,16072
1141
1141
  official/vision/ops/spatial_transform_ops.py,sha256=PVEJGAn0ygtsrid84vD5GgV0jsjyWoNn14RBzreMxM4,38389
1142
1142
  official/vision/ops/target_gather.py,sha256=Ir3X76yXYEVFSYX5h-yfS8SMkY37GYuypBP2C8ykggo,3965
@@ -1222,9 +1222,9 @@ tensorflow_models/tensorflow_models_test.py,sha256=nc6A9K53OGqF25xN5St8EiWvdVbda
1222
1222
  tensorflow_models/nlp/__init__.py,sha256=4tA5Pf4qaFwT-fIFOpX7x7FHJpnyJT-5UgOeFYTyMlc,807
1223
1223
  tensorflow_models/uplift/__init__.py,sha256=mqfa55gweOdpKoaQyid4A_4u7xw__FcQeSIF0k_pYmI,999
1224
1224
  tensorflow_models/vision/__init__.py,sha256=zBorY_v5xva1uI-qxhZO3Qh-Dii-Suq6wEYh6hKHDfc,833
1225
- tf_models_nightly-2.18.0.dev20241022.dist-info/AUTHORS,sha256=1dG3fXVu9jlo7bul8xuix5F5vOnczMk7_yWn4y70uw0,337
1226
- tf_models_nightly-2.18.0.dev20241022.dist-info/LICENSE,sha256=WxeBS_DejPZQabxtfMOM_xn8qoZNJDQjrT7z2wG1I4U,11512
1227
- tf_models_nightly-2.18.0.dev20241022.dist-info/METADATA,sha256=Xq17BE4FrMRbkZCvlH9T5EFnFy7FIPjl2th1UY1LuUA,1432
1228
- tf_models_nightly-2.18.0.dev20241022.dist-info/WHEEL,sha256=kGT74LWyRUZrL4VgLh6_g12IeVl_9u9ZVhadrgXZUEY,110
1229
- tf_models_nightly-2.18.0.dev20241022.dist-info/top_level.txt,sha256=gum2FfO5R4cvjl2-QtP-S1aNmsvIZaFFT6VFzU0f4-g,33
1230
- tf_models_nightly-2.18.0.dev20241022.dist-info/RECORD,,
1225
+ tf_models_nightly-2.18.0.dev20241024.dist-info/AUTHORS,sha256=1dG3fXVu9jlo7bul8xuix5F5vOnczMk7_yWn4y70uw0,337
1226
+ tf_models_nightly-2.18.0.dev20241024.dist-info/LICENSE,sha256=WxeBS_DejPZQabxtfMOM_xn8qoZNJDQjrT7z2wG1I4U,11512
1227
+ tf_models_nightly-2.18.0.dev20241024.dist-info/METADATA,sha256=TjhHahDGiboRz4d6rRZneWpL9E_oqnKm8uTK7prS_3g,1432
1228
+ tf_models_nightly-2.18.0.dev20241024.dist-info/WHEEL,sha256=kGT74LWyRUZrL4VgLh6_g12IeVl_9u9ZVhadrgXZUEY,110
1229
+ tf_models_nightly-2.18.0.dev20241024.dist-info/top_level.txt,sha256=gum2FfO5R4cvjl2-QtP-S1aNmsvIZaFFT6VFzU0f4-g,33
1230
+ tf_models_nightly-2.18.0.dev20241024.dist-info/RECORD,,