コード例 #1
0
    for i in range(gmphd_num_steps):
        sys.stdout.write('Step %d\r\n' % i)
        gm_list = gmphd_predictor(model=gmphd_model, gm_list=gmphd_gm_list)
        gm_list = gmphd_corrector(model=gmphd_model,
                                  gm_list=gm_list,
                                  observation=gmphd_observation[i])
        gm_list = gm_pruning(gm_list=gm_list,
                             T=gmphd_model.gm_T,
                             U=gmphd_model.gm_U,
                             C=gmphd_model.gm_Jmax)
        # Get Prediction
        gmphd_prediction.append(gm_estimator(gm_list))

        # Save temporary result
        gmphd_phd['s'].append(
            gm_calculate(gm_list=gm_list, grid=(grid_x, grid_y, grid_z)))

        gmphd_phd['gms'].append(copy.deepcopy(gm_list))

        # Update GM_LIST
        gmphd_gm_list = gm_list

        print('Target spotted %d' % len(gmphd_prediction[i]))

    result_filename = os.path.join(chkpt_dir, 'gmphd_3dcv_chkpt.pkl')
    result_fp = open(result_filename, 'wb')
    pickle.dump(
        {
            'model': gmphd_model,
            'phd': gmphd_phd,
            'prediction': gmphd_prediction,
コード例 #2
0
        sys.stdout.write('Step %d\r\n' % i)
        gm_list = gmphd_predictor(model=gmphd_model,
                                  gm_list=gmphd_gm_list)
        gm_list = gmphd_corrector(model=gmphd_model,
                                  gm_list=gm_list,
                                  observation=gmphd_observation[i])
        gm_list = gm_pruning(gm_list=gm_list,
                             T=gmphd_model.gm_T,
                             U=gmphd_model.gm_U,
                             C=gmphd_model.gm_Jmax)
        # Get Prediction
        gmphd_prediction.append(gm_estimator(gm_list))

        # Save temporary result
        gmphd_phd['s'].append(gm_calculate(
            gm_list=gm_list,
            grid=(grid_x, grid_y)
        ))

        gmphd_phd['gms'] = copy.deepcopy(gm_list)

        # Update GM_LIST
        gmphd_gm_list = gm_list

        print('Target spotted %d' % len(gmphd_prediction[i]))

    result_filename = os.path.join(chkpt_dir, 'gmphd_2dcv_noise_chkpt.pkl')
    result_fp = open(result_filename, 'wb')
    pickle.dump({
        'model': gmphd_model,
        'phd': gmphd_phd,
        'prediction': gmphd_prediction,