diff --git a/pysegcnn/core/trainer.py b/pysegcnn/core/trainer.py index 695b23186a0509eefb60ec0df45fd806285c6832..4e82d54d082880b02b66ceccbf382f7b85bb811b 100644 --- a/pysegcnn/core/trainer.py +++ b/pysegcnn/core/trainer.py @@ -2545,10 +2545,6 @@ class NetworkInference(BaseConfig): # check whether to reconstruct the scenes of a dataset if self.predict_scene: - # append model predictions of current batch to scene dictionary - for k, v in zip(INFERENCE_NAMES, [inputs, labels, prdctn]): - scenes[k].append(v) - # check if an entire scene is processed if batch % self.trg_ds.dataset.tiles == 0 and batch != 0: @@ -2607,6 +2603,10 @@ class NetworkInference(BaseConfig): self.scenes_path.joinpath(batch_name)), bbox_inches='tight') + # append model predictions of current batch to scene dictionary + for k, v in zip(INFERENCE_NAMES, [inputs, labels, prdctn]): + scenes[k].append(v) + else: # save current batch to output dictionary output[batch] = {k: v for k, v in zip(INFERENCE_NAMES,