Skip to content

Commit

Permalink
fix (Memory): removed memory profiler module and some minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Lukas committed May 19, 2021
1 parent 4a4159c commit 1e65cfe
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 15 deletions.
2 changes: 0 additions & 2 deletions src/fabscan/FSEvents.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
__email__ = "info@mariolukas.de"

import multiprocessing
import json
from memory_profiler import profile

try:
from queue import Empty
Expand Down
5 changes: 0 additions & 5 deletions src/fabscan/FSScanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
from fabscan.lib.util.FSUpdate import upgrade_is_available, do_upgrade
from fabscan.lib.util.FSDiscovery import register_to_discovery
from fabscan.lib.util.FSSystemWatch import get_cpu_temperature
from fabscan.lib.util.FSMemoryProfiler import FSMemoryProfiler


class FSState(object):
IDLE = "IDLE"
Expand Down Expand Up @@ -100,9 +98,6 @@ def __init__(self, settings, config, eventmanager, scanActor, calibrationActor):
self.scheduler.add_job(self.run_discovery_service, 'interval', minutes=30, id='register_discovery_service')
self._logger.info("Added discovery scheduling job.")

#mem_debugger = FSMemoryProfiler()
#self.scheduler.add_job(mem_debugger.debug_memory, 'interval', minutes=1, id='memory_profiler')

self.scheduler.add_job(self.run_temperature_watch_service, 'interval', minutes=1, id='cpu_temperature_service')

def run(self):
Expand Down
2 changes: 1 addition & 1 deletion src/fabscan/config/default.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"process_numbers": 3,
"turntable": {
"steps": 6400,
"steps": 3200,
"radius": 70,
"height": 155
},
Expand Down
1 change: 0 additions & 1 deletion src/fabscan/scanner/laserscanner/FSHardwareController.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from fabscan.scanner.laserscanner.driver.FSLed import Led
from fabscan.scanner.interfaces.FSHardwareConnectorFactory import FSHardwareConnectorFactory
from fabscan.scanner.interfaces.FSCameraFactory import FSCameraFactory
from memory_profiler import profile

@singleton(
config=ConfigInterface,
Expand Down
2 changes: 1 addition & 1 deletion src/fabscan/scanner/laserscanner/FSImageProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def compute_line_segmentation(self, image, index=0, roi_mask=False):

return image

# Savitzky-Golay-Filter
def _sgf(self, u, v, s):
if len(u) > 1:
i = 0
Expand All @@ -242,7 +243,6 @@ def _sgf(self, u, v, s):
return u, v

# RANSAC implementation: https://github.com/ahojnnes/numpy-snippets/blob/master/ransac.py

def _ransac(self, u, v):
if len(u) > 1:
data = np.vstack((v.ravel(), u.ravel())).T
Expand Down
3 changes: 2 additions & 1 deletion src/fabscan/scanner/laserscanner/FSScanActor.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ def init_texture_scan(self):
self.hardwareController.led.on(self.config.file.texture_illumination, self.config.file.texture_illumination, self.config.file.texture_illumination)

#let thee camera settle after turning on the led
time.sleep(1)
self._logger.debug("Waiting for camera while settling...")
time.sleep(3)


def scan_next_texture_position(self):
Expand Down
1 change: 0 additions & 1 deletion src/fabscan/scanner/laserscanner/driver/FSLaser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
__maintainer__ = "Mario Lukas"
__email__ = "info@mariolukas.de"
import time
from memory_profiler import profile

class Laser:
def __init__(self, hardware_connector):
Expand Down
1 change: 0 additions & 1 deletion src/fabscan/scanner/laserscanner/driver/FSSerial.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from fabscan.lib.util.FSInject import inject
from fabscan.FSConfig import ConfigInterface
from fabscan.scanner.interfaces.FSHardwareConnector import FSHardwareConnectorInterface
from memory_profiler import profile

@inject(
config=ConfigInterface
Expand Down
5 changes: 3 additions & 2 deletions src/fabscan/worker/FSImageWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,9 @@ def run(self):
#self._logger.debug('Image Processing starts.')
try:
#TODO: Save image here for creating debug information.
#self.image.save_image(image_task.image, image_task.progress, image_task.prefix,
# dir_name=image_task.prefix + '/raw_' + image_task.raw_dir)
if bool(self.config.file.keep_raw_images):
self.image.save_image(image_task.image, image_task.progress, image_task.prefix,
dir_name=image_task.prefix + '/raw_laser_' + image_task.raw_dir)
color_image = None
image_task.image = self.image_processor.reorientate_image(image_task.image)
angle = float(image_task.progress * 360) / float(image_task.resolution)
Expand Down

0 comments on commit 1e65cfe

Please sign in to comment.