Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update anchor_generator.py #2450

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions keras_cv/src/layers/object_detection/anchor_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import math

from keras_cv.src import bounding_box
from keras_cv.src.api_export import keras_cv_export
from keras_cv.src.backend import keras
Expand Down Expand Up @@ -262,7 +260,7 @@ def __call__(self, image_size):
# [W]
cx = ops.cast(
ops.arange(
0.5 * stride, math.ceil(image_width / stride) * stride, stride
0.5 * stride, ops.ceil(image_width / stride) * stride, stride
),
"float32",
)
Expand All @@ -271,7 +269,7 @@ def __call__(self, image_size):
# [H]
cy = ops.cast(
ops.arange(
0.5 * stride, math.ceil(image_height / stride) * stride, stride
0.5 * stride, ops.ceil(image_height / stride) * stride, stride
),
"float32",
)
Expand Down