Stinky-Tofu / Stronger-yolo

🔥Improve yolo with latest paper
MIT License
3 stars 0 forks source link

a error in random_crop #36

Open zkk0911 opened 5 years ago

zkk0911 commented 5 years ago
    crop_xmax = max(w_img, int(max_bbox[2] + random.uniform(0, max_r_trans)))
    crop_ymax = max(h_img, int(max_bbox[3] + random.uniform(0, max_d_trans)))

    In context,it seems like you want the minimum value of the ymax and xmax. It looks like a mistake here

    crop_xmax = min(w_img, int(max_bbox[2] + random.uniform(0, max_r_trans)))
    crop_ymax = min(h_img, int(max_bbox[3] + random.uniform(0, max_d_trans)))
Stinky-Tofu commented 5 years ago

@zkk0911 python2.7

zkk0911 commented 5 years ago
    I use the following codes, it looks ok. Your implemention looks complex, I wonder if there are difference

    boxes[:, 0:2], axis=0), np.max(bboxes[:, 2:4], axis=0)], axis=-1)
    max_l_trans = max_bbox[0]
    max_u_trans = max_bbox[1]
    max_r_trans = max_bbox[2]
    max_d_trans = max_bbox[3]

    crop_xmin = int(random.uniform(0, max_l_trans))
    crop_ymin = int(random.uniform(0, max_u_trans))
    crop_xmax = int(random.uniform(max_r_trans, w_img))
    crop_ymax = int(random.uniform(max_d_trans, h_img))
Apostatee commented 5 years ago

The author have not changed this part of code yet. it looks like w_img and h_img will always be returned as crop_max. I wonder whether it is intended to do so or just an error?

Stinky-Tofu commented 5 years ago

@Apostatee @zkk0911 哈哈,确实是个bug,谢谢,但是我也懒得改了,因为可能又会影响性能。