fix CropAndResize doc

pull/2823/head
xutianchun 5 years ago
parent 0cd9e4cc11
commit 77b5ae054a

@ -68,8 +68,8 @@ class CropAndResize(PrimitiveWithInfer):
>>> IMAGE_WIDTH = 256
>>> CHANNELS = 3
>>> image = np.random.normal(size=[BATCH_SIZE, IMAGE_HEIGHT, IMAGE_WIDTH, CHANNELS]).astype(np.float32)
>>> boxes = np.random.uniform(shape=[NUM_BOXES, 4]).astype(np.float32)
>>> box_index = np.random.uniform(shape=[NUM_BOXES], low=0, high=BATCH_SIZE).astype(np.int32)
>>> boxes = np.random.uniform(size=[NUM_BOXES, 4]).astype(np.float32)
>>> box_index = np.random.uniform(size=[NUM_BOXES], low=0, high=BATCH_SIZE).astype(np.int32)
>>> crop_size = np.array([24, 24]).astype(np.int32)
>>> crop_and_resize = CropAndResizeNet(crop_size=Tensor(crop_size))
>>> output = crop_and_resize(Tensor(image), Tensor(boxes), Tensor(box_index))

@ -41,8 +41,8 @@ def test_net_float32():
image_width = 256
channels = 3
image = np.random.normal(size=[batch_size, image_height, image_width, channels]).astype(np.float32)
boxes = np.random.uniform(shape=[num_boxes, 4]).astype(np.float32)
box_index = np.random.uniform(shape=[num_boxes], low=0, high=batch_size).astype(np.int32)
boxes = np.random.uniform(size=[num_boxes, 4]).astype(np.float32)
box_index = np.random.uniform(size=[num_boxes], low=0, high=batch_size).astype(np.int32)
crop_size = np.array([24, 24]).astype(np.int32)
net = Net(crop_size=Tensor(crop_size))
output = net(Tensor(image), Tensor(boxes), Tensor(box_index))

Loading…
Cancel
Save