SOTS icon indicating copy to clipboard operation
SOTS copied to clipboard

Hello, why do you calculate bbox like this?

Open yangzijia opened this issue 2 years ago • 2 comments

https://github.com/JudasDie/SOTS/blob/5b9be9168053b2445f3a54931fdffb591c8d79b1/lib/dataset/siamese_builder.py#L202

Especially lines 211 to 214, the scale_z What does it mean?

yangzijia avatar May 07 '22 02:05 yangzijia

https://github.com/JudasDie/SOTS/blob/5b9be9168053b2445f3a54931fdffb591c8d79b1/lib/dataset/siamese_builder.py#L202

Especially lines 211 to 214, the scale_z What does it mean?

Pls refer to SiamFC.

JudasDie avatar May 09 '22 10:05 JudasDie

https://github.com/JudasDie/SOTS/blob/5b9be9168053b2445f3a54931fdffb591c8d79b1/lib/dataset/siamese_builder.py#L202

Especially lines 211 to 214, the scale_z What does it mean?

Pls refer to SiamFC. ` def _toBBox(self, image, shape): imh, imw = image.shape[:2] if len(shape) == 4: w, h = shape[2] - shape[0], shape[3] - shape[1] else: w, h = shape context_amount = 0.5 exemplar_size = self.template_size

    wc_z = w + context_amount * (w + h)
    hc_z = h + context_amount * (w + h)
    s_z = np.sqrt(wc_z * hc_z)
    scale_z = exemplar_size / s_z
    w = w * scale_z
    h = h * scale_z
    cx, cy = imw // 2, imh // 2
    # cx, cy = 127//2, 127//2
    bbox = boxhelper.center2corner(boxhelper.Center(cx, cy, w, h))  # [xz, yz, w, h] -> [x1, y1, x2, y2]
    return bbox`

Sorry to borther u, why cx, cy = imw // 2, imh // 2 here?w and h are the weights in croped image,but why use center point in original image, may i misunderstand ur code?

hy1hao avatar Nov 10 '23 03:11 hy1hao