def setupEOgmaNeo(): global _system, _hierarchy, _inputImage, _inputValue print("Initializing EOgmaNeo::ComputeSystem") _system = eogmaneo.ComputeSystem(4) print("Initializing EOgmaNeo::Hierarchy") lds = eogmaneo.StdVecLayerDesc() numLayers = 6 layerSize = 36 for l in range(0, numLayers): ld = eogmaneo.LayerDesc() ld._width = layerSize ld._height = layerSize ld._forwardRadius = 9 ld._backwardRadius = 9 ld._ticksPerUpdate = 2 ld._temporalHorizon = 2 ld._alpha = 0.1 ld._beta = 0.1 ld._gamma = 0.01 lds.push_back(ld) #layerSize = 16 _hierarchy = eogmaneo.Hierarchy() _hierarchy.create([(hiddenWidth, hiddenHeight), (steerChunkSize, steerChunkSize)], [lineChunkSize, steerChunkSize], [False, True], lds, 41) _inputValue = eogmaneo.StdVeci(1 * 1)
ld[l]._forwardRadius = 9 ld[l]._backwardRadius = 9 else: ld[l]._forwardRadius = 9 ld[l]._backwardRadius = 9 ld[l]._ticksPerUpdate = 2 ld[l]._temporalHorizon = 2 ld[l]._alpha = 0.1 ld[l]._beta = 0.1 ld[l]._gamma = 0.01 hiddenWidth = camWidth hiddenHeight = int(camHeight / 2) h = eogmaneo.Hierarchy() h.create([(hiddenWidth, hiddenHeight), (steerChunkSize, steerChunkSize)], [lineChunkSize, steerChunkSize], [False, True], ld, 41) sdrWidth = int(hiddenWidth / lineSDRSizeDiv) sdrHeight = int(hiddenHeight / lineSDRSizeDiv) numChunksInX = int(sdrWidth / lineChunkSize) numChunksInY = int(sdrHeight / lineChunkSize) numChunks = numChunksInX * numChunksInY bitsPerChunk = lineChunkSize * lineChunkSize lsd = cv2.createLineSegmentDetector(0) trainMode = True enabled = False