serialize metadata
This commit is contained in:
parent
8ae6069ac3
commit
bdefaec0d2
|
@ -169,7 +169,7 @@ class ChainPipeline:
|
|||
if stage_pipe.max_tile > 0:
|
||||
tile = min(stage_pipe.max_tile, stage_params.tile_size)
|
||||
|
||||
callback.tile = 0 # reset this either way
|
||||
callback.tile = 0 # reset this either way
|
||||
if must_tile:
|
||||
logger.info(
|
||||
"image contains sources or is larger than tile size of %s, tiling stage",
|
||||
|
@ -270,7 +270,9 @@ class ChainPipeline:
|
|||
len(stage_sources),
|
||||
)
|
||||
|
||||
callback.result = stage_sources # this has just been set to the result of the last stage
|
||||
callback.result = (
|
||||
stage_sources # this has just been set to the result of the last stage
|
||||
)
|
||||
|
||||
if is_debug():
|
||||
for j, image in enumerate(stage_sources.as_image()):
|
||||
|
|
|
@ -138,7 +138,7 @@ def image_reply(
|
|||
logger.error("metadata and outputs must be the same length")
|
||||
return error_reply("metadata and outputs must be the same length")
|
||||
|
||||
data["metadata"] = metadata
|
||||
data["metadata"] = [m.tojson() for m in metadata]
|
||||
data["outputs"] = outputs
|
||||
|
||||
return jsonify([data])
|
||||
|
@ -673,7 +673,7 @@ def job_status(server: ServerContext, pool: DevicePoolExecutor):
|
|||
outputs = None
|
||||
metadata = None
|
||||
if progress.result is not None and len(progress.result) > 0:
|
||||
# TODO: progress results should be a list of filenames and image metadata
|
||||
# TODO: the names should be attached to the result somehow rather than recomputing them
|
||||
outputs = make_output_names(server, job_name, len(progress.result))
|
||||
metadata = progress.result.metadata
|
||||
|
||||
|
|
|
@ -121,9 +121,7 @@ class WorkerContext:
|
|||
with self.idle.get_lock():
|
||||
self.idle.value = idle
|
||||
|
||||
def set_progress(
|
||||
self, steps: int, stages: int = 0, tiles: int = 0
|
||||
) -> None:
|
||||
def set_progress(self, steps: int, stages: int = 0, tiles: int = 0) -> None:
|
||||
if self.job is None:
|
||||
raise RuntimeError("no job on which to set progress")
|
||||
|
||||
|
|
Loading…
Reference in New Issue