segmenter: import libraries when needed to make startup faster
This commit is contained in:
parent
98c51828e0
commit
fcb57ed075
|
@ -21,25 +21,6 @@ import multiprocessing
|
||||||
import planktoscope.mqtt
|
import planktoscope.mqtt
|
||||||
import planktoscope.light
|
import planktoscope.light
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Morphocut Libraries
|
|
||||||
################################################################################
|
|
||||||
import morphocut
|
|
||||||
import morphocut.file
|
|
||||||
import morphocut.image
|
|
||||||
import morphocut.stat
|
|
||||||
import morphocut.stream
|
|
||||||
import morphocut.str
|
|
||||||
import morphocut.contrib.ecotaxa
|
|
||||||
import morphocut.contrib.zooprocess
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Other image processing Libraries
|
|
||||||
################################################################################
|
|
||||||
import skimage.util
|
|
||||||
import cv2
|
|
||||||
|
|
||||||
logger.info("planktoscope.segmenter is loaded")
|
logger.info("planktoscope.segmenter is loaded")
|
||||||
|
|
||||||
|
|
||||||
|
@ -356,11 +337,30 @@ class SegmenterProcess(multiprocessing.Process):
|
||||||
logger.info(
|
logger.info(
|
||||||
f"The segmenter control thread has been started in process {os.getpid()}"
|
f"The segmenter control thread has been started in process {os.getpid()}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# MQTT Service connection
|
# MQTT Service connection
|
||||||
self.segmenter_client = planktoscope.mqtt.MQTT_Client(
|
self.segmenter_client = planktoscope.mqtt.MQTT_Client(
|
||||||
topic="segmenter/#", name="segmenter_client"
|
topic="segmenter/#", name="segmenter_client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Morphocut Libraries
|
||||||
|
################################################################################
|
||||||
|
import morphocut
|
||||||
|
import morphocut.file
|
||||||
|
import morphocut.image
|
||||||
|
import morphocut.stat
|
||||||
|
import morphocut.stream
|
||||||
|
import morphocut.str
|
||||||
|
import morphocut.contrib.ecotaxa
|
||||||
|
import morphocut.contrib.zooprocess
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Other image processing Libraries
|
||||||
|
################################################################################
|
||||||
|
import skimage.util
|
||||||
|
import cv2
|
||||||
|
|
||||||
# Instantiate the morphocut pipeline
|
# Instantiate the morphocut pipeline
|
||||||
# self.__create_morphocut_pipeline()
|
# self.__create_morphocut_pipeline()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue