def main():

    # The basic core takes as input frames from the two camera viewpoints that look into the playing field
    # and learns proper kernels for recognizing the scene
    # This is a baseline to use as a pretrained classifier for recognizing entire playtypes in the advanced core

    global args, mylogger

    args = parser.parse_args()

    mylogger = MagnificentOracle()
    mylogger.set_log(logfile=args.log)
    mylogger.log("-dotted-line")  

    EB = True
    postprocess = False
    IoU = False

    if not EB:

        if ("postprocess" not in args.log):
            if ("IoU" not in args.log):
                vp = viewpoint_classifier_ED(args.arch, path=args.dataset_path, viewpoints = args.viewpoints)
                train(int(args.epochs), vp) 
            else:
                print("IoU scores per class")
                IoU()
        else:
            print("post-processing")
            post_process()
    else:
        vp = viewpoint_classifier_ED(args.arch, path=args.dataset_path, viewpoints = args.viewpoints)
        EB_extraction(vp)
示例#2
0
def main():
    global args, mylogger

    args = parser.parse_args()
    mylogger = MagnificentOracle()
    mylogger.set_log(logfile=args.log)
    mylogger.log("-dotted-line")

    pt = playtype_classifier()
    train(int(args.epochs), pt)
示例#3
0
def main():
    global args, mylogger
     
    args = parser.parse_args() 
    mylogger = MagnificentOracle()
    mylogger.set_log(logfile=args.log)
    #mylogger.set_log(logfile=None)
    mylogger.log("-dotted-line")  

    pt = playtype_classifier(dataset_index=int(args.dataset_index))
    #train(int(args.epochs), pt)
    #final_expectation(pt)
    #acc_test(1,pt)   # 91% testing acc at 48 epochs for binary, 85% testing acc at 48 epochs for trinary
    final_expectation_dataset(pt)
示例#4
0
def main():
    global mylogger

    mylogger = MagnificentOracle()
    mylogger.set_log(logfile=None)
    mylogger.log("-dotted-line")

    kmeans_init = True
    word2vec_init = True
    if word2vec_init:
        word2vec()
    elif kmeans_init:
        cluster_raw()
    else:
        c = clustering()
        c.run()
def main():
    global args, mylogger

    args = parser.parse_args()
    mylogger = MagnificentOracle()
    mylogger.set_log(logfile=args.log)
    mylogger.log("-dotted-line")

    customset_test = CustomMasterDatasetPlays(path=args.dataset_path,
                                              subset_type="testing",
                                              dataset_index=0,
                                              categories="chunked")
    test_acc_loader = torch.utils.data.DataLoader(dataset=customset_test,
                                                  batch_size=16,
                                                  shuffle=False,
                                                  num_workers=args.num_workers)
    print len(customset_test), len(test_acc_loader)
示例#6
0
def main():
    global args, mylogger

    args = parser.parse_args()
    mylogger = MagnificentOracle()
    mylogger.set_log(logfile=args.log)
    mylogger.log("-dotted-line")

    #ground_truth_files()

    pt = playtype_classifier()
    #print("All done")
    #IoU()
    #train(int(args.epochs), pt)
    #final_expectation(pt)
    #acc_test(1,pt)   # 91% testing acc at 48 epochs for binary, 85% testing acc at 48 epochs for trinary
    final_expectation_dataset(pt)
示例#7
0
def main():

    # The basic core takes as input frames from the two camera viewpoints that look into the playing field
    # and learns proper kernels for recognizing the scene
    # This is a baseline to use as a pretrained classifier for recognizing entire playtypes in the advanced core

    global args, mylogger

    args = parser.parse_args()

    mylogger = MagnificentOracle()
    mylogger.set_log(logfile=args.log)
    mylogger.log("-dotted-line")

    # TO-DO
    vp = viewpoint_classifier_ED(args.arch,
                                 path=args.dataset_path,
                                 viewpoints=args.viewpoints)
    train(int(args.epochs), vp)
def main():

    # The basic core takes as input frames from the two camera viewpoints that look into the playing field
    # and learns proper kernels for recognizing the scene
    # This is a baseline to use as a pretrained classifier for recognizing entire playtypes in the advanced core

    global args, mylogger

    args = parser.parse_args()

    mylogger = MagnificentOracle()
    mylogger.set_log(logfile=args.log)
    mylogger.log("-dotted-line")

    EB = False
    postprocess = False
    IoU_ = True

    if not EB:
        if not postprocess:
            if not IoU_:
                vp = viewpoint_classifier_ED(args.arch,
                                             path=args.dataset_path,
                                             viewpoints=args.viewpoints)
                train(int(args.epochs), vp)
            else:
                for folder in [
                        "ED32_vgg_frozen"
                ]:  #["framewise","ED32","ED196","ED32_vgg_frozen"]:
                    IoU(folder=folder)
        else:
            for folder in ["ED32_vgg_frozen"
                           ]:  #["framewise","ED32","ED196","ED32_vgg_frozen"]:
                print("post-processing")
                post_process(folder=folder)
    else:
        vp = viewpoint_classifier_ED(args.arch,
                                     path=args.dataset_path,
                                     viewpoints=args.viewpoints)
        EB_extraction(vp)
                    help="Weight decay for the optimizer")
parser.add_argument("--viewpoints",
                    metavar="VIEWPOINTS",
                    default=3,
                    type=int,
                    help="How many viewpoints to train on")

parser.add_argument("--log",
                    metavar="LOG",
                    default=None,
                    help="Log txt file to fill with logger information")

mylogger = None

# Utilities
MO = MagnificentOracle()


class viewpoint_classifier_ED():
    def __init__(self,
                 model="ED",
                 path=None,
                 viewpoints=3,
                 interval_size=32,
                 interval_samples_per_game=None,
                 splitting="whole",
                 overlap="consecutive"):

        interval_samples_per_game = 20000 / interval_size
        self.interval_size = interval_size