Skip to content

Commit

Permalink
use numpy arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
sineeli committed Nov 6, 2024
1 parent c163da5 commit bd17a4f
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions keras_hub/src/models/retinanet/retinanet_object_detector_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import keras
import numpy as np
import pytest

from keras_hub.src.models.resnet.resnet_backbone import ResNetBackbone
Expand Down Expand Up @@ -69,17 +69,14 @@ def setUp(self):
}

self.input_size = 512
self.images = keras.random.uniform(
shape=(1, self.input_size, self.input_size, 3),
minval=0,
maxval=255,
dtype="float32",
)
self.images = np.random.uniform(
low=0, high=255, size=(1, self.input_size, self.input_size, 3)
).astype("float32")
self.labels = {
"boxes": keras.ops.convert_to_tensor(
"boxes": np.array(
[[[20.0, 10.0, 12.0, 11.0], [30.0, 20.0, 40.0, 12.0]]]
),
"classes": keras.ops.convert_to_tensor([[0, 2]]),
"classes": np.array([[0, 2]]),
}
self.train_data = (self.images, self.labels)

Expand Down

0 comments on commit bd17a4f

Please sign in to comment.