From 2c9a6df20f6cbaee4d10bf40dd91c99a45fbd03f Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Sun, 4 Oct 2020 23:29:01 +0200 Subject: [PATCH] segmenter: try to add support for printing object_id --- scripts/planktoscope/segmenter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/planktoscope/segmenter.py b/scripts/planktoscope/segmenter.py index 6ac7ca2..8d35444 100644 --- a/scripts/planktoscope/segmenter.py +++ b/scripts/planktoscope/segmenter.py @@ -214,11 +214,15 @@ class SegmenterProcess(multiprocessing.Process): morphocut.str.Format("Object {object_id}", object_id=object_id) ) + id_json = morphocut.str.Format( + '{"object_id":"{object_id}"}', object_id=object_id + ) + # Publish the object_id to via MQTT to Node-RED morphocut.Call( self.segmenter_client.client.publish, "status/segmenter/object_id", - f'{{"object_id":"{object_id}"}}', + id_json, ) # Set the LEDs as Green