Beispiel #1
0
 def test_database_model(self):
     configs = [{}, {
         "db_name": "name1",
         "frequency": "wrong_freq",
         "compress": True,
         "verify": True
     }, {
         "frequency": "daily",
         "compress": True,
         "verify": True
     }, {
         "db_name": "name1",
         "frequency": "daily",
         "compress": 100,
         "verify": True
     }]
     for config in configs:
         with self.assertRaises(Exception) as context:
             d = Database(config)
             d.validate()
         self.assertTrue(isinstance(context.exception, DataError))
     # Should pass ok
     d = Database({
         "db_name": "name1",
         "frequency": "daily",
         "compress": True,
         "verify": True
     })
     d.validate()
Beispiel #2
0
import sys
sys.path.append('../.')

from common.config import *
from methods.BlockMatchingOF import *
from common.Database import *
from methods.GaussianMethods import *
from common.extractPerformance import *
from common.metrics import *
from methods.Farneback import *
from methods.LucasKanade import *
from time import time

if __name__ == "__main__":
    gt_db = Database(abs_dir_gt, start_frame=start_frame, end_frame=end_frame)
    input_db = Database(abs_dir_input,
                        start_frame=start_frame,
                        end_frame=end_frame)

    gt = gt_db.loadDB(im_color=cv2.IMREAD_UNCHANGED | cv2.IMREAD_ANYDEPTH)
    input = input_db.loadDB(im_color=True)

    dit_to_save = "output_{}".format(OF_TYPE)
    if not os.path.exists(dit_to_save):
        os.mkdir(dit_to_save)

    # window_sizes = np.arange(2, 500, 10)  # up to 150 because of "somthing strange in Lucas Kanade
    # shift_sizes = np.arange(1, 2, 1)

    window_sizes = [7, 15, 23, 31, 39, 47, 55, 63, 71]
    shift_sizes = [7, 15, 23, 31, 39, 47, 55, 63, 71]
Beispiel #3
0
from common.Database import *
from common.metrics import *

from performance import *
from temporalanalysis import *
from frameperf import *
from FramePerformancedelay import *

if __name__ == "__main__":

    if DATABASE == "changedetection":
        start_frame = 1201
        end_frame = 1400

        gt_db = Database(abs_dir_gt,
                         start_frame=start_frame,
                         end_frame=end_frame)
        input_db = Database(abs_dir_input,
                            start_frame=start_frame,
                            end_frame=end_frame)
        results_db = Database(abs_dir_result, start_frame=0)

        gt = gt_db.loadDB()
        input = input_db.loadDB()
        res = results_db.loadDB()

        res_A = res[:200]
        res_B = res[200:]

        TP, FP, TN, FN, y_gt, y_test = performance(gt, res_A)
Beispiel #4
0
from common import Chart
from common import Database

import warnings
warnings.simplefilter("ignore")
pd.set_option('mode.chained_assignment', None)
plt.style.use('dark_background')

parser = argparse.ArgumentParser()
args = parser.parse_args("")

clean = Cleaning.cleaning()
chart = Chart.plot()

schedule = BackgroundScheduler()
db = Database.Database()

# =======================================CONFIGURATION=======================================*
args.host = 'http://127.0.0.1:'
# args.host ='http://mdfc-server:'
args.port = '5520'
args.url = args.host + args.port + '/predict'
args.gateway = 'a21908053003'
args.interval = 5
args.count = 60
args.date = '2021-01-01'
args.mode = 2
args.features = ['gateway_id', 'stack_power', 'stack_current', 'stack_voltage', 'stack_temp', 'meoh_concentration', 'fuel_tank_level']
# ============================================================================================*

def collect(gw):