Commit
·
c473ce5
1
Parent(s):
001d15d
Update maskrcnn_benchmark/modeling/rpn/anchor_generator.py
Browse files
maskrcnn_benchmark/modeling/rpn/anchor_generator.py
CHANGED
@@ -362,8 +362,8 @@ def generate_anchors(
|
|
362 |
"""
|
363 |
return _generate_anchors(
|
364 |
stride,
|
365 |
-
np.array(sizes, dtype=np.
|
366 |
-
np.array(aspect_ratios, dtype=np.
|
367 |
)
|
368 |
|
369 |
|
@@ -371,7 +371,7 @@ def _generate_anchors(base_size, scales, aspect_ratios):
|
|
371 |
"""Generate anchor (reference) windows by enumerating aspect ratios X
|
372 |
scales wrt a reference (0, 0, base_size - 1, base_size - 1) window.
|
373 |
"""
|
374 |
-
anchor = np.array([1, 1, base_size, base_size], dtype=np.
|
375 |
anchors = _ratio_enum(anchor, aspect_ratios)
|
376 |
anchors = np.vstack(
|
377 |
[_scale_enum(anchors[i, :], scales) for i in range(anchors.shape[0])]
|
|
|
362 |
"""
|
363 |
return _generate_anchors(
|
364 |
stride,
|
365 |
+
np.array(sizes, dtype=np.float64) / stride,
|
366 |
+
np.array(aspect_ratios, dtype=np.float64),
|
367 |
)
|
368 |
|
369 |
|
|
|
371 |
"""Generate anchor (reference) windows by enumerating aspect ratios X
|
372 |
scales wrt a reference (0, 0, base_size - 1, base_size - 1) window.
|
373 |
"""
|
374 |
+
anchor = np.array([1, 1, base_size, base_size], dtype=np.float64) - 1
|
375 |
anchors = _ratio_enum(anchor, aspect_ratios)
|
376 |
anchors = np.vstack(
|
377 |
[_scale_enum(anchors[i, :], scales) for i in range(anchors.shape[0])]
|