Пример #1
0
              float(p2[1])) >= 0:  # last appear in in_area
            # return 0
            return -1
    elif first_appear_out >= 0:  # first appear in in_area
        if (a2 * float(p2[0]) + b2 -
                float(p2[1])) <= 0:  # last appear in out_area
            return 1
    elif first_appear_in <= 0:  # first appear in out_area
        if (a1 * float(p2[0]) + b1 -
                float(p2[1])) >= 0:  # last appear in in_area
            # return 0
            return -1
    return 0


fw = Framework.Framework()
fw.displayer.run()
idb = ID_Base.ID_Base()
f_cnt = 0
threashold = 10
people = 0
while True:
    f_cnt += 1
    frame, BB_IDs, fps = fw.run_1_frame(draw=True)
    cv2.line(frame, in_line[0], in_line[1], (255, 0, 0), 2)
    cv2.line(frame, out_line[0], out_line[1], (255, 0, 0), 2)
    cv2.putText(frame, str(people), (200, 25), cv2.FONT_HERSHEY_TRIPLEX, 1,
                (0, 0, 0))
    fw.displayer.update_frame(frame)
    to_be_delete = []
    for id, info in idb.base.items():
Пример #2
0
import platform
import os

if platform.architecture()[0] == '32bit':
    os.environ['PYSDL2_DLL_PATH'] = './SDL2/x86'
else:
    os.environ['PYSDL2_DLL_PATH'] = './SDL2/x64'

from Framework import *
MyGame = Framework()

MyGame.run()

#  map size : 16m x 10.4m
Пример #3
0
import Framework

if __name__ == '__main__':

    framework = Framework()
    framework.run()

Пример #4
0
# Aristos Athens

import Framework
import Services

if __name__ == "__main__":

    program_services = Services.ProgramService.__subclasses__()
    graphics_services = Services.GraphicsService.__subclasses__()
    print("Program services: ", program_services)
    print("Graphics services: ", graphics_services)

    Framework = Framework.Framework(program_services, graphics_services)
    Framework.run()
Пример #5
0
def main():

    reader_collector_pairs = [ ]

    #
    # configure scribblers
    #
    NullCollector = AlphaTwirl.Loop.NullCollector
    reader_collector_pairs.extend([
        ])

    #
    # configure tables
    #
    Binning = AlphaTwirl.Binning.Binning
    Round = AlphaTwirl.Binning.Round
    RoundLog = AlphaTwirl.Binning.RoundLog
    htbin = Binning(boundaries = (0, 200, 400, 800))
    njetbin = Binning(boundaries = (1, 2, 3, 4, 5))
    tblcfg = [
        dict(keyAttrNames = ('mht40_pt', ), binnings = (Round(10, 0), ), keyOutColumnNames = ('mht', )),
        dict(keyAttrNames = ('ht40', 'mht40_pt'), binnings = (htbin, Round(10, 0)), keyOutColumnNames = ('ht', 'mht')),
        dict(keyAttrNames = ('ht40', 'nJet40', 'mht40_pt'), binnings = (htbin, njetbin, Round(10, 0)), keyOutColumnNames = ('ht', 'njet', 'mht')),
        dict(keyAttrNames = ('ht40', 'jet_pt'), binnings = (htbin, RoundLog(0.1, 100)), keyIndices = (None, 0), keyOutColumnNames = ('ht', 'jet_pt')),
        dict(keyAttrNames = ('ht40', 'jet_pt'), binnings = (htbin, RoundLog(0.1, 100)), keyIndices = (None, '*'), keyOutColumnNames = ('ht', 'jet_pt')),
        ]

    # complete table configs
    tableConfigCompleter = AlphaTwirl.Configure.TableConfigCompleter(
        defaultSummaryClass = AlphaTwirl.Summary.Count,
        defaultOutDir = args.outdir,
        createOutFileName = AlphaTwirl.Configure.TableFileNameComposer2()
    )
    tblcfg = [tableConfigCompleter.complete(c) for c in tblcfg]

    # do not recreate tables that already exist unless the force option is used
    if not args.force:
        tblcfg = [c for c in tblcfg if c['outFile'] and not os.path.exists(c['outFilePath'])]

    reader_collector_pairs.extend(
        [AlphaTwirl.Configure.build_counter_collector_pair(c) for c in tblcfg]
    )

    #
    # configure data sets
    #
    dataset_names = args.dataset_names if args.dataset_names else args.input_files
    datasets = [Framework.Dataset(n, f) for n, f in zip(dataset_names, args.input_files)]

    #
    # run
    #
    fw =  Framework.Framework(
        quiet = args.quiet,
        process = args.process,
        max_events_per_dataset = args.nevents,
        max_events_per_process = args.max_events_per_process
    )
    fw.run(
        datasets = datasets,
        reader_collector_pairs = reader_collector_pairs
    )