8dd1ec5bfef42af8ad75a38a4ac6d58e7d7763c9,luminoth/utils/image_vis.py,,draw_rpn_bbox_pred,#Any#Any#,598
Before Change
logger.debug("RPN regression loss (bbox to original anchors, with the smoothL1Loss)")
target = pred_dict["rpn_prediction"]["rpn_cls_target"]
target = target.reshape([-1, 1])
// Get anchors with positive label.
positive_indices = np.nonzero(np.squeeze(target) > 0)[0]
random_indices = np.random.choice(np.arange(len(positive_indices)), n)
loss_per_anchor = pred_dict["rpn_prediction"]["reg_loss_per_anchor"]
// Get only n random to avoid overloading image.
positive_indices = positive_indices[random_indices]
loss_per_anchor = loss_per_anchor[random_indices]
target = target[positive_indices]
bbox_pred = pred_dict["rpn_prediction"]["rpn_bbox_pred"]
bbox_pred = bbox_pred.reshape([-1, 4])
bbox_pred = bbox_pred[positive_indices]
After Change
loss_per_anchor = pred_dict["rpn_prediction"]["reg_loss_per_anchor"]
top_losses_idx = np.argsort(loss_per_anchor)[::-1][:top_k]
loss_per_anchor = loss_per_anchor[top_losses_idx]
bbox_pred = bbox_pred[top_losses_idx]
all_anchors = all_anchors[top_losses_idx]
bbox_final = decode(all_anchors, bbox_pred)
image_pil, draw = get_image_draw(pred_dict)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: tryolabs/luminoth
Commit Name: 8dd1ec5bfef42af8ad75a38a4ac6d58e7d7763c9
Time: 2017-10-09
Author: javirey@gmail.com
File Name: luminoth/utils/image_vis.py
Class Name:
Method Name: draw_rpn_bbox_pred
Project Name: brian-team/brian2
Commit Name: 0ac2bf1c2cafee4cc9555c9f09a17143b05b1a88
Time: 2014-03-06
Author: dan.goodman@ens.fr
File Name: brian2/synapses/spikequeue.py
Class Name: SpikeQueue
Method Name: prepare
Project Name: mozilla/bugbug
Commit Name: eb73ec72ed6c28b774a4d4220a9a02bac2f8be81
Time: 2019-01-14
Author: mcastelluccio@mozilla.com
File Name: bugbug/model.py
Class Name: Model
Method Name: train