Exemplo n.º 1
0
 tf_config = tf.ConfigProto()
 tf_config.gpu_options.allow_growth = True
 sess = tf.InteractiveSession(config=tf_config)
 tf.global_variables_initializer().run()
 model_saver.restore(sess, os.path.join(checkpoint_dir, 'dbg_model_best'))
 """ Get test or validation video list 
 """
 train_dict, val_dict, test_dict = data_loader.getDatasetDict(
     video_info_file)
 if test_mode == 'validation':
     video_dict = val_dict
 else:
     video_dict = test_dict
 """ load test or validation data
 """
 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(
Exemplo n.º 2
0
    pend = tf.reduce_sum(prop_end, 1) / tf.maximum(tf.reduce_sum(tf_mask, 1), 1)

    model_saver = tf.train.Saver()
    tf_config = tf.ConfigProto()
    tf_config.gpu_options.allow_growth = True
    sess = tf.InteractiveSession(config=tf_config)
    tf.global_variables_initializer().run()
    model_saver.restore(sess, os.path.join(checkpoint_dir, 'dbg_model_best'))

    train_dict, val_dict, test_dict = data_loader.getDatasetDict()
    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)
Exemplo n.º 3
0
 pend = tf.reduce_sum(prop_end, 1) / tf.maximum(tf.reduce_sum(tf_mask, 1),
                                                1)
 """ Load model weights """
 model_saver = tf.train.Saver()
 tf_config = tf.ConfigProto()
 tf_config.gpu_options.allow_growth = True
 sess = tf.InteractiveSession(config=tf_config)
 tf.global_variables_initializer().run()
 model_saver.restore(sess, os.path.join(checkpoint_dir, 'dbg_model_best'))
 """ Get test or validation video list 
 """
 # train_dict, val_dict, test_dict = data_loader.getDatasetDict(video_info_file)
 test_dict = getDatasetDict(video_info_file)
 """ load test or validation data
 """
 batch_video_list = data_loader.getBatchListTest(test_dict, 1)
 """ 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 tqdm.tqdm(range(len(batch_video_list))):
     """ Get batch data 
     """
     batch_anchor_xmin, batch_anchor_xmax, batch_anchor_feature = \
         data_loader.getProposalDataTest(