53 lines
1.6 KiB
Python
53 lines
1.6 KiB
Python
import os
|
|
import time
|
|
from Application.ContourExctractor import ContourExtractor
|
|
from Application.Exporter import Exporter
|
|
from Application.LayerFactory import LayerFactory
|
|
from Application.Analyzer import Analyzer
|
|
from Application.Config import Config
|
|
from Application.Importer import Importer
|
|
from Application.VideoReader import VideoReader
|
|
from Application.LayerManager import LayerManager
|
|
from Application.Classifiers import *
|
|
#TODO
|
|
# finden von relevanten Stellen anhand von zu findenen metriken für vergleichsbilder
|
|
|
|
def demo():
|
|
print("startup")
|
|
start = time.time()
|
|
config = Config()
|
|
|
|
config["inputPath"] = os.path.join(os.path.dirname(__file__), "generate test footage/3.mp4")
|
|
config["importPath"] = os.path.join(os.path.dirname(__file__), "output/short.txt")
|
|
config["outputPath"] = os.path.join(os.path.dirname(__file__), "output/short.mp4")
|
|
|
|
vr = VideoReader(config)
|
|
config["w"], config["h"] = vr.getWH()
|
|
|
|
if config["importPath"] is None:
|
|
#ana = Analyzer(config)
|
|
#ref = ana.avg
|
|
contours = ContourExtractor(config).extractContours()
|
|
print("Time consumed extracting: ", time.time() - start)
|
|
layerFactory = LayerFactory(config)
|
|
|
|
layers = layerFactory.extractLayers(contours)
|
|
layerManager = LayerManager(config, layers)
|
|
layerManager.cleanLayers()
|
|
layers = layerManager.layers
|
|
else:
|
|
layers = Importer(config).importRawData()
|
|
|
|
exporter = Exporter(config)
|
|
exporter.export(layers)
|
|
|
|
print("Total time: ", time.time() - start)
|
|
|
|
def init():
|
|
print("not needed yet")
|
|
|
|
if __name__ == "__main__":
|
|
demo()
|
|
|
|
|