Exemplo n.º 1
0
def main():

    logging.info("<%s> Starting" % __name__)

    _sys = system.System(system_a.init_police)
    _displayer = displayer.Displayer()

    if len(sys.argv) > 1:
        if "a" in sys.argv[1]:
            _sys = system.System(system_a.init_police)
        elif "b" in sys.argv[1]:
            _sys = system.System(system_b.init_police)
        elif "c" in sys.argv[1]:
            _sys = system.System(system_c.init_police)
        elif "d" in sys.argv[1]:
            _sys = system.System(system_d.init_police)

    while True:
        _sys.run()
Exemplo n.º 2
0
def main():

    try:
        # Bash script will pass a base path where folder of the application will be
        base_path_proj = (sys.argv[1])
    except IndexError:
        print("Value in argv position 1 does not exist")
        raise SystemExit

    # 2- Call main function
    # 2.1 -> create log file
    obj_time = datetime.datetime.now()
    obj_host = socket.gethostname()

    obj_log = logs.Log()
    obj_log.createlog(base_path_proj,
                      "assigment_log_" + str(obj_time) + "_" + str(obj_host))

    # 2.2 -> call system functions to get all data
    obj_sys = system.System(obj_log)
    obj_sys.getallprocesses()
    obj_sys.getdiskcapacity()
Exemplo n.º 3
0
import cv2
from io import BytesIO, StringIO
import base64
import matplotlib.pyplot
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas

app = flask.Flask(__name__)
app.config["DEBUG"] = True
app.config["MONGO_URI"] = "mongodb://*****:*****@app.route('/', methods=['GET'])
def home():
    return '''<h1>Face Recognition and Reporting System</h1>
<p>A prototype API for face recognition on given image and reporting mechanism on work hours</p>'''


@app.route('/api/v1/add', methods=['POST'])
def add_person():
    if 'image' not in request.files:
        return jsonify(
Exemplo n.º 4
0
disk.LX = 11
disk.LY = 11

disk.VX = 0.000000000000000000005  # 0.5
disk.VY = 0.000000000000000000005  # 0.3

NoPart = 100
colors = [
    'red', 'blue', 'green', 'yellow', 'pink', 'magenta', 'cyan', 'orange',
    'purple'
]
radio = 0.1  # 0.05

wind = False
System = sy.System(window=wind)
for i in range(NoPart):
    # System.particles.append(disk.Disk(vx = random.uniform(0.1, 0.7), vy = random.uniform(0.1, 0.7), rad = radio, col = random.choice(colors), tag = str(i)))
    System.particles.append(
        disk.Disk(vx=disk.VX,
                  vy=disk.VY,
                  rad=radio,
                  col=random.choice(colors),
                  tag=str(i)))

System.set_random_positions()

TempAA = 500
System.aux(TempAA)

cont = 0
Exemplo n.º 5
0
    dt = 1e-3
    nsteps = 10
    # CREATING THE SYSTEM OBJECT
    # Changing the default parameters
    param = system.System.getDefaultParameters()
    param['eps'] = 1e-7 
    param['dt'] = dt
    param['x'] = x
    nsteps = 1
    param['Dt'] = nsteps * dt
    param['D']=D
    param['beta']=beta
    precond_param=None
    param['precond']=precond.Precond(precond_param)

    syst = system.System(u,lambd,param)
  
    # CREATING LINEAR SOLVER
    gmres_param = GMRES.GMRESLinearSolver.getDefaultParameters()
    gmres_param['tol']=2e-6
    gmres_param['print']='short'
    gmres_param['max_iter']=100
    gmres_param['builtin']= True
    linsolv = GMRES.GMRESLinearSolver(gmres_param)

    # CREATING NEWTON SOLVER
    newt_param = NewtonSolver.NewtonSolver.getDefaultParameters()
    newt_param['rel_tol']=1e-10
    newt_param['abs_tol']=1e-10
    newt_param['print']='short'
    newt_param['max_iter']=5