import sys if __name__ == "__main__": print("ASTERICS Automatics: Automatic Processing Chain generator tool") print("Starting...") source_dir = sys.argv[0].rsplit("/", maxsplit=1)[0] asterics_dir = source_dir.rsplit("/", maxsplit=2)[0] print("Importing Automatics from '{}'...".format(source_dir)) sys.path.append(source_dir) import as_automatics_logging as as_log as_log.init_log(loglevel_console="WARNING", loglevel_file="INFO") # Even though not all imports are used here, # they are included for easy access from the interactive environment. # Plz no remove :3 - Thank! from as_automatics_env import AsAutomatics from as_automatics_proc_chain import AsProcessingChain from as_automatics_module import AsModule from as_automatics_port import Port from as_automatics_interface import Interface from as_automatics_module_lib import AsModuleLibrary from as_automatics_generic import Generic from as_automatics_templates import AsMain, AsTop from as_automatics_helpers import append_to_path print("Success!")
# Import Automatics from as_automatics_env import AsAutomatics from as_automatics_proc_chain import AsProcessingChain from as_automatics_2d_pipeline import As2DWindowPipeline from as_automatics_cnn_layer import AsNNLayer from as_automatics_helpers import append_to_path from as_automatics_module_group import Register from as_automatics_module import AsModule from as_automatics_interface import Interface import as_automatics_builder as as_build import as_automatics_logging as as_log import as_automatics_exceptions as as_err # Initialize logging LOG = as_log.init_log() # Initialize Automatics - scan default modules Auto = AsAutomatics(asterics_home, Automatics_version) # Automatics high-level functions: ## # @addtogroup automatics_cds # @{ def set_asterics_directory(path: str) -> bool: # Cleanup path input path = os.path.realpath(append_to_path(path, "/"))
raise AsConnectionError( ("Non-window modules can only connect " "AsStreams to the 2D Window Pipeline!")) else: LOG.error("Wrong data type passed to pipeline.connect()!") raise TypeError("Cannot connect data layer with object of type {}!" .format(type(inter))) # TODO: Establish connection """ # ↑↑↑ OLD CODE ↑↑↑ !for reference only! # DEBUG for WindowSection management: if __name__ == "__main__": LOG = as_log.init_log(loglevel_console="DEBUG") pipe = As2DWindowPipeline(640, 480, None) l0 = pipe.add_layer("grey", 8) l0.set_input(WindowRef(col=0, row=0)) # l0.add_outputs(window=WindowDef(0,2,0,2)) l1 = pipe.add_layer("gauss", 8) l1.set_input(WindowRef(1, 0)) l1.add_output(WindowRef(6, 1)) l2 = pipe.add_layer("cordic", 12) l2.set_input(WindowRef(7, 1)) l2.add_output(WindowRef(5, 5)) l2.add_output(WindowRef(6, 5))