Ejemplo n.º 1
0
    if test_mode == 'validation':
        video_dict = val_dict
    else:
        video_dict = test_dict

    batch_video_list = data_loader.getBatchListTest(video_dict, batch_size, shuffle=False)

    batch_result_xmin = []
    batch_result_xmax = []
    batch_result_iou = []
    batch_result_pstart = []
    batch_result_pend = []

    print('Runing DBG model ...')
    for idx in tqdm.tqdm(range(len(batch_video_list))):
        batch_anchor_xmin, batch_anchor_xmax, batch_anchor_feature = data_loader.getProposalDataTest(
            batch_video_list[idx], video_dict)
        out_iou, out_start, out_end = sess.run([iou_mat, pstart, pend],
                                               feed_dict={X_feature: batch_anchor_feature})
        batch_result_xmin.append(batch_anchor_xmin)
        batch_result_xmax.append(batch_anchor_xmax)
        batch_result_iou.append(out_iou[:, :, :, 0])
        batch_result_pstart.append(out_start[:, :, 0])
        batch_result_pend.append(out_end[:, :, 0])

    print('Saving results ...')
    columns = ["iou", "start", "end", "xmin", "xmax"]

    for idx in tqdm.tqdm(range(len(batch_video_list))):
        b_video = batch_video_list[idx]
        b_xmin = batch_result_xmin[idx]
        b_xmax = batch_result_xmax[idx]
Ejemplo n.º 2
0
    batch_video_list = data_loader.getBatchListTest(video_dict, batch_size)
    """ init result list
    """
    batch_result_xmin = []
    batch_result_xmax = []
    batch_result_iou = []
    batch_result_pstart = []
    batch_result_pend = []
    """ Run DBG model 
    """
    print('Runing DBG model ...')
    for idx in mmcv.track_iter_progress(range(len(batch_video_list))):
        """ Get batch data 
        """
        batch_anchor_xmin, batch_anchor_xmax, batch_anchor_feature = \
            data_loader.getProposalDataTest(
                batch_video_list[idx], dbg_config)
        """ Run batch data 
        """
        out_iou, out_start, out_end = sess.run(
            [iou_mat, pstart, pend],
            feed_dict={X_feature: batch_anchor_feature})
        batch_result_xmin.append(batch_anchor_xmin)
        batch_result_xmax.append(batch_anchor_xmax)
        batch_result_iou.append(out_iou[:, :, :, 0])
        batch_result_pstart.append(out_start[:, :, 0])
        batch_result_pend.append(out_end[:, :, 0])

    utils.save_proposals_result(batch_video_list, batch_result_xmin,
                                batch_result_xmax, batch_result_iou,
                                batch_result_pstart, batch_result_pend, tscale,
                                result_dir)