segmenter: fix ecotaxa export again
(cherry picked from commit 253408b5a8156171f5853ed1420f63ebcac0dc7b)
This commit is contained in:
parent
328d227b8f
commit
8436ac2926
|
@ -601,7 +601,8 @@ class SegmenterProcess(multiprocessing.Process):
|
||||||
|
|
||||||
# Publish the object_id to via MQTT to Node-RED
|
# Publish the object_id to via MQTT to Node-RED
|
||||||
self.segmenter_client.client.publish(
|
self.segmenter_client.client.publish(
|
||||||
"status/segmenter", f'{{"status":"Segmenting image {filename}"}}'
|
"status/segmenter",
|
||||||
|
f'{{"status":"Segmenting image {filename}, image {i+1}/{images_count}"}}',
|
||||||
)
|
)
|
||||||
|
|
||||||
# we recalculate the flat if the heuristics detected we should
|
# we recalculate the flat if the heuristics detected we should
|
||||||
|
@ -696,7 +697,7 @@ class SegmenterProcess(multiprocessing.Process):
|
||||||
self.__working_obj_path,
|
self.__working_obj_path,
|
||||||
keep_files=True,
|
keep_files=True,
|
||||||
):
|
):
|
||||||
logger.succes("Ecotaxa archive export completed for this folder")
|
logger.success("Ecotaxa archive export completed for this folder")
|
||||||
else:
|
else:
|
||||||
logger.error("The ecotaxa export could not be completed")
|
logger.error("The ecotaxa export could not be completed")
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -241,13 +241,13 @@ def ecotaxa_export(archive_filepath, metadata, image_base_path, keep_files=False
|
||||||
|
|
||||||
# add the tsv to the archive
|
# add the tsv to the archive
|
||||||
archive.writestr(
|
archive.writestr(
|
||||||
"export_ecotaxa.tsv",
|
"ecotaxa_export.tsv",
|
||||||
io.BytesIO(
|
io.BytesIO(
|
||||||
tsv_content.to_csv(sep="\t", encoding="utf-8", index=False).encode()
|
tsv_content.to_csv(sep="\t", encoding="utf-8", index=False).encode()
|
||||||
).read(),
|
).read(),
|
||||||
)
|
)
|
||||||
if keep_files:
|
if keep_files:
|
||||||
tsv_file = os.path.join(image_base_path, "export_ecotaxa.tsv")
|
tsv_file = os.path.join(image_base_path, "ecotaxa_export.tsv")
|
||||||
tsv_content.to_csv(
|
tsv_content.to_csv(
|
||||||
path_or_buf=tsv_file, sep="\t", encoding="utf-8", index=False
|
path_or_buf=tsv_file, sep="\t", encoding="utf-8", index=False
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue