Compare commits
3 Commits
d72608756b
...
120175b2d9
Author | SHA1 | Date | |
---|---|---|---|
|
120175b2d9 | ||
|
ffcee4e8b1 | ||
|
d5463951cf |
@ -25,7 +25,7 @@ class SaveImageCallback(Callback):
|
||||
# else:
|
||||
# version = 0
|
||||
fname = Path(pl_module.trainer.logger.log_dir) / Path(f"e{epoch:04d}")
|
||||
create_circle(pl_module, fname=fname)
|
||||
create_circle(pl_module, fname=fname, dpi=300, figsize=(6, 6))
|
||||
|
||||
# Make sure to set it back to train mode
|
||||
pl_module.train()
|
||||
|
2
check.py
2
check.py
@ -61,7 +61,7 @@ def create_circle(
|
||||
|
||||
|
||||
def plot_preds(
|
||||
preds, rgb_values, fname: str, roll: bool = False, dpi: int = 150, figsize=(3, 3)
|
||||
preds, rgb_values, fname: str, roll: bool = False, dpi: int = 300, figsize=(6, 6)
|
||||
):
|
||||
if isinstance(preds, torch.Tensor):
|
||||
preds = preds.detach().cpu().numpy()
|
||||
|
@ -8,7 +8,7 @@ from lightning_sdk import Machine, Studio # noqa: F401
|
||||
# consistency of randomly sampled experiments.
|
||||
seed(19920921)
|
||||
|
||||
NUM_JOBS = 100
|
||||
NUM_JOBS = 50
|
||||
|
||||
# reference to the current studio
|
||||
# if you run outside of Lightning, you can pass the Studio name
|
||||
|
@ -55,13 +55,19 @@ def create_grid_composite(
|
||||
# Save the composite image
|
||||
composite.write_to_file(output_file)
|
||||
x = pyvips.Image.thumbnail(output_file, 1080 * 4)
|
||||
x.write_to_file("out_sm.png")
|
||||
x.write_to_file(output_file.replace(".png", "_pre.png"))
|
||||
print(output_file)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Example usage
|
||||
directory = "/teamspace/studios/this_studio/out_sortcolors/umap/" # Change to your directory path
|
||||
# experiment = "umap"
|
||||
experiment = "supervised"
|
||||
# directory = "/teamspace/studios/this_studio/out_sortcolors/{experiment}/" # Change to your directory path
|
||||
directory = f"/teamspace/studios/this_studio/colors/colors-refactor-{experiment}/" # Change to your directory path
|
||||
k = 10
|
||||
spacing_inches = 1.5
|
||||
create_grid_composite(directory, k, spacing_inches)
|
||||
spacing_inches = 2
|
||||
sp_str = str(spacing_inches).replace(".", "-")
|
||||
# savefile = f"/teamspace/studios/this_studio/composites/{experiment}-{sp_str}.png"
|
||||
savefile = f"/teamspace/studios/this_studio/composites/{experiment}-{sp_str}.png"
|
||||
create_grid_composite(directory, k, spacing_inches, output_file=savefile)
|
||||
|
Loading…
Reference in New Issue
Block a user