dlr: write raw outputs to jsonl file

This commit is contained in:
Starbeamrainbowlabs 2023-03-10 17:07:44 +00:00
parent d24381babb
commit 5fdf229d06
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -305,6 +305,11 @@ def plot_samples_matplotlib(filepath, display_list):
plt.colorbar()
plt.savefig(filepath, dpi=200)
def save_samples(filepath, save_list):
handle = io.open(filepath, "a")
json.dump(save_list, handle)
handle.write("\n")
handle.close()
def plot_predictions(filepath, input_items, colormap, model):
i = 0
@ -327,6 +332,11 @@ def plot_predictions(filepath, input_items, colormap, model):
prediction_colormap
]
)
save_samples(
filepath.replace("_$$", "").replace(".png", ".jsonl"),
prediction_mask
)
i += 1
def get_from_batched(dataset, count):