"git@developer.sourcefind.cn:change/sglang.git" did not exist on "2c4feaf30875728d278748221711e88e83ebc2ca"
Commit c94836a4 authored by A. Unique TensorFlower's avatar A. Unique TensorFlower
Browse files

Merge pull request #8961 from srihari-humbarwadi:patch-1

PiperOrigin-RevId: 323503471
parents f8c2a917 b3f63b00
...@@ -46,15 +46,15 @@ class Anchor(object): ...@@ -46,15 +46,15 @@ class Anchor(object):
num_scales: integer number representing intermediate scales added num_scales: integer number representing intermediate scales added
on each level. For instances, num_scales=2 adds one additional on each level. For instances, num_scales=2 adds one additional
intermediate anchor scales [2^0, 2^0.5] on each level. intermediate anchor scales [2^0, 2^0.5] on each level.
aspect_ratios: list of float numbers representing the aspect raito anchors aspect_ratios: list of float numbers representing the aspect ratio anchors
added on each level. The number indicates the ratio of width to height. added on each level. The number indicates the ratio of width to height.
For instances, aspect_ratios=[1.0, 2.0, 0.5] adds three anchors on each For instances, aspect_ratios=[1.0, 2.0, 0.5] adds three anchors on each
scale level. scale level.
anchor_size: float number representing the scale of size of the base anchor_size: float number representing the scale of size of the base
anchor to the feature stride 2^level. anchor to the feature stride 2^level.
image_size: a list of integer numbers or Tensors representing image_size: a list of integer numbers or Tensors representing
[height, width] of the input image size.The image_size should be divided [height, width] of the input image size.The image_size should be
by the largest feature stride 2^max_level. divisible by the largest feature stride 2^max_level.
""" """
self.min_level = min_level self.min_level = min_level
self.max_level = max_level self.max_level = max_level
...@@ -77,8 +77,8 @@ class Anchor(object): ...@@ -77,8 +77,8 @@ class Anchor(object):
for scale in range(self.num_scales): for scale in range(self.num_scales):
for aspect_ratio in self.aspect_ratios: for aspect_ratio in self.aspect_ratios:
stride = 2 ** level stride = 2 ** level
intermidate_scale = 2 ** (scale / float(self.num_scales)) intermediate_scale = 2 ** (scale / float(self.num_scales))
base_anchor_size = self.anchor_size * stride * intermidate_scale base_anchor_size = self.anchor_size * stride * intermediate_scale
aspect_x = aspect_ratio ** 0.5 aspect_x = aspect_ratio ** 0.5
aspect_y = aspect_ratio ** -0.5 aspect_y = aspect_ratio ** -0.5
half_anchor_size_x = base_anchor_size * aspect_x / 2.0 half_anchor_size_x = base_anchor_size * aspect_x / 2.0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment