Skip to content

Commit 8849958

Browse files
hawkinsptensorflower-gardener
authored andcommitted
No public description
PiperOrigin-RevId: 841975564
1 parent 26b77cb commit 8849958

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

official/vision/data/fake_feature_generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def generate_image_np(height: int,
2828
"""Returns a fake numpy image matrix array."""
2929
return np.reshape(
3030
np.mod(np.arange(height * width * num_channels), 255).astype(np.uint8),
31-
newshape=(height, width, num_channels))
31+
(height, width, num_channels),
32+
)
3233

3334

3435
def generate_normalized_boxes_np(num_boxes: int) -> np.ndarray:
@@ -82,8 +83,7 @@ def generate_instance_masks_np(height: int,
8283
box_heights = boxes_np[:, 3].astype(int) - ymins
8384

8485
for i, (x, y, w, h) in enumerate(zip(xmins, ymins, box_widths, box_heights)):
85-
instance_masks_np[i, y:y + h, x:x + w, :] = np.reshape(
86-
np.mod(np.arange(h * w), 2).astype(np.uint8), newshape=(h, w, 1))
86+
instance_masks_np[i, y:y + h, x:x + w, :] = np.reshape(np.mod(np.arange(h * w), 2).astype(np.uint8), (h, w, 1))
8787
return instance_masks_np
8888

8989

0 commit comments

Comments
 (0)