80c93a1c5489bf6d16745d1390e3bb4ba87dfb17,utils/utils.py,,build_targets,#,267

Before Change


            iou = bbox_iou(gt_box, pred_box, x1y1x2y2=False)
            pred_label = torch.argmax(pred_cls[b, best_n, gj, gi])
            score = pred_conf[b, best_n, gj, gi]
            if iou > 0.5 and pred_label == target_label and score > 0.5:
                num_correct += 1

    return num_targets, num_correct, obj_mask, noobj_mask, tx, ty, tw, th, tconf, tcls


def to_categorical(y, num_classes):

After Change


            // Get the shape of the gt box (centered at (100, 100))
            gt_shape = torch.FloatTensor(np.array([100, 100, gw, gh])).unsqueeze(0)
            // Get shape of anchor box
            anchor_shapes = torch.ones((len(anchors), 4)).float() * 100
            anchor_shapes[:, 2:] = anchors
            // Compute iou between gt and anchor shapes
            anch_ious = bbox_iou(gt_shape, anchor_shapes, x1y1x2y2=False)
            // Where the overlap is larger than threshold set mask to zero (ignore)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: eriklindernoren/PyTorch-YOLOv3
Commit Name: 80c93a1c5489bf6d16745d1390e3bb4ba87dfb17
Time: 2019-04-24
Author: eriklindernoren@live.se
File Name: utils/utils.py
Class Name:
Method Name: build_targets


Project Name: ufoym/deepo
Commit Name: 497ceb5d9ec7b943a7cee88e8919ea914d146928
Time: 2018-05-15
Author: a@ufoym.com
File Name: scripts/make-gen-docker.py
Class Name:
Method Name: get_command


Project Name: luispedro/mahotas
Commit Name: 22fececf3d3d75a6607b889f972663a1473bc37b
Time: 2010-08-24
Author: lpc@cmu.edu
File Name: mahotas/stretch.py
Class Name:
Method Name: stretch