Beispiel #1
0
def init_soccerdata(mylist):
    # load corresponding metadata
    data_dict = {}
    if 0 in mylist:
        db_K1 = soccer.SoccerVideo(os.path.join(opt.path_to_data, 'K1'))
        db_K1.name = "K1"
        db_K1.digest_metadata()
        db_K1.refine_poses(keypoint_thresh=7, score_thresh=0.4, neck_thresh=0.4)
        data_dict.update({0:db_K1})
    if 1 in mylist:
        db_K8 = soccer.SoccerVideo(os.path.join(opt.path_to_data, 'K8'))
        db_K8.name = "K8"
        db_K8.digest_metadata()
        db_K8.refine_poses(keypoint_thresh=7, score_thresh=0.4, neck_thresh=0.4)
        data_dict.update({1:db_K8})
    if 2 in mylist:
        db_K9 = soccer.SoccerVideo(os.path.join(opt.path_to_data, 'K9'))
        db_K9.name = "K9"
        db_K9.digest_metadata()
        db_K9.refine_poses(keypoint_thresh=7, score_thresh=0.4, neck_thresh=0.4)
        data_dict.update({2:db_K9})
    if 3 in mylist:
        db_Left = soccer.SoccerVideo(os.path.join(opt.path_to_data, 'Left'))
        db_Left.name = "Left"
        db_Left.digest_metadata()
        db_Left.refine_poses(keypoint_thresh=7, score_thresh=0.4, neck_thresh=0.4)
        data_dict.update({3:db_Left})
    if 4 in mylist:
        db_Right = soccer.SoccerVideo(os.path.join(opt.path_to_data, 'Right'))
        db_Right.name = "Right"
        db_Right.digest_metadata()
        db_Right.refine_poses(keypoint_thresh=7, score_thresh=0.4, neck_thresh=0.4)
        data_dict.update({4:db_Right})

    return data_dict
import os
import argparse
import soccer
from os import listdir
from os.path import isfile, join, exists

################################################################################
# run: python3 refine_openpose.py --path_to_data ~/path/to/data/
################################################################################

# CMD Line arguments
parser = argparse.ArgumentParser(description='Estimate the poses')
# --path_to_data: where the images are
parser.add_argument('--path_to_data', default='~/path/to/data', help='path')

opt, _ = parser.parse_known_args()

# initialize SoccerVideo for every camera
db = soccer.SoccerVideo(opt.path_to_data)
db.gather_detectron()
db.digest_metadata()

db.refine_poses(keypoint_thresh=7, score_thresh=0.4, neck_thresh=0.4)
db.dump_video('poses')
Beispiel #3
0
################################################################################

# CMD Line arguments
parser = argparse.ArgumentParser(description='Estimate the poses')
# --path_to_data: where the images are
parser.add_argument('--path_to_data', default='/home/bunert/Data', help='path')
# --openpose_dir: where the openpose directory is (./build/examples/openpose/openpose.bin)
parser.add_argument('--openpose_dir',
                    default='/home/bunert/installations/openpose',
                    help='path')
# --cameras: number of cameras
parser.add_argument('--cameras', default=1, type=int, help='path')

opt, _ = parser.parse_known_args()

# initialize SoccerVideo for every camera
db = []
for i in range(opt.cameras):
    db.append(soccer.SoccerVideo(join(opt.path_to_data,
                                      'camera{0}'.format(i))))

    # what exactly do those?
    db[i].gather_detectron()
    db[i].digest_metadata()
    db[i].get_boxes_from_detectron()
    db[i].dump_video('detections')

    db[i].estimate_openposes(openpose_dir=opt.openpose_dir)
    db[i].refine_poses(keypoint_thresh=7, score_thresh=0.4, neck_thresh=0.4)
    db[i].dump_video('poses')
Beispiel #4
0
################################################################################
# run: python3 plot_cameras.py --path_to_data ~/path/to/openpose
################################################################################

# CMD Line arguments
parser = argparse.ArgumentParser(description='Estimate the poses')
# --path_to_data: where the images are
parser.add_argument('--path_to_data',
                    default='~/path/to/openpose',
                    help='path')

opt, _ = parser.parse_known_args()

# load corresponding metadata
db_K1 = soccer.SoccerVideo(os.path.join(opt.path_to_data, 'K1'))
db_K8 = soccer.SoccerVideo(os.path.join(opt.path_to_data, 'K8'))
# db_Left = soccer.SoccerVideo(os.path.join(opt.path_to_data, 'Left'))
# db_Right = soccer.SoccerVideo(os.path.join(opt.path_to_data, 'Right'))
db_K9 = soccer.SoccerVideo(os.path.join(opt.path_to_data, 'K9'))

db_K1.digest_metadata()
db_K8.digest_metadata()
# db_Left.digest_metadata()
# db_Right.digest_metadata()
db_K9.digest_metadata()

# plot the field
data = []

# K1: