def test():
    opt = TrainingOpt()
    config = GetConfig(opt.config_name)
    hm = Heatmapper(config)
    heatmap_test = np.load("heatmap_test.npz")
    img = heatmap_test['img']
    joints = heatmap_test['joints']
    mask_all = heatmap_test['mask_all']
    mask_miss = heatmap_test['mask_miss']
    plt.imshow(img[:, :, [2, 0, 1]])
    plt.show()
    plt.imshow(mask_all)
    plt.show()
    plt.imshow(mask_miss)
    plt.show()
    labels = hm.create_heatmaps(joints, mask_all)
    print()
Пример #2
0
    "If the norm of the gradient vector exceeds this, re-normalize it to have the norm equal to max_grad_norm"
)
parser.add_argument('--output',
                    type=str,
                    default='result.jpg',
                    help='output image')

parser.add_argument('--opt-level', type=str, default='O1')
parser.add_argument('--keep-batchnorm-fp32', type=str, default=None)
parser.add_argument('--loss-scale', type=str, default=None)
parser.add_argument('--run_refactor', action='store_true')
parser.add_argument('--run_cpp', action='store_true')
args = parser.parse_args()

# ###################################  Setup for some configurations ###########################################
opt = TrainingOpt()
config = GetConfig(opt.config_name)

joint2limb_pairs = config.limbs_conn  # > 30
dt_gt_mapping = config.dt_gt_mapping
NUM_KEYPOINTS = 18
NUM_COCO_KEYPOINTS = 17
NUM_TEST_IMG = -1
TEST_SET = 'val2017'


# ######################################  For evaluating time ######################################
def process(input_image_path, model, test_cfg, model_cfg, heat_layers,
            paf_layers):

    ori_img = cv2.imread(input_image_path)