pva-faster-rcnn icon indicating copy to clipboard operation
pva-faster-rcnn copied to clipboard

Visualization training

Open dereyly opened this issue 9 years ago • 3 comments

Hello I have strange results when trying to visualize training process: fast_rcnn/train.py

rois = net.blobs['rois'].data
bbox_targets = net.blobs['bbox_targets'].data
boxes = rois[:, 1:5]

tr_boxes = bbox_transform_inv(boxes, bbox_targets)
tr_boxes = clip_boxes(tr_boxes, im.shape)
labels=labels.astype(dtype=int)
dets_tr=[]
    for k,cls_ind in enumerate(labels):
        if cls_ind!=0:
            cls_boxes = tr_boxes[k, 4 * cls_ind:4 * (cls_ind + 1)]
            #cls_boxes = boxes[k]
            dets_tr.append([cls_boxes[0], cls_boxes[1], cls_boxes[2], cls_boxes[3], cls_ind])

dets_tr=np.array(dets_tr,dtype=int)

I try to visualize targets of Fast-RCNN Red it is target (bbox_targets). I hope target boxes restore GT box from ROI boxes. Blue is answer (bbox_pred) of pvanet/comp/test.model

Second image is train from imagenet (finetune)

tmp2 tmp

dereyly avatar Oct 26 '16 15:10 dereyly

The current codes set bounding box regression targets to be x10 of the real targets. The hyper parameter (=x10) comes from the original py-faster-rcnn. I guess it enhances the trained results but I haven't checked it.

sanghoon avatar Oct 26 '16 15:10 sanghoon

Thank you. Visualization with tr_boxes = bbox_transform_inv(boxes, 0.1*bbox_targets) is correct. I miss this point. But not understand why they not change loss_weight at 'bbox loss'.

dereyly avatar Oct 27 '16 14:10 dereyly

The effects of modifying loss weight and of bounding box targets are different since the loss function is not linear.

sanghoon avatar Nov 11 '16 16:11 sanghoon