|
@ -55,13 +55,19 @@ def create_grid_composite( |
|
|
# Save the composite image |
|
|
# Save the composite image |
|
|
composite.write_to_file(output_file) |
|
|
composite.write_to_file(output_file) |
|
|
x = pyvips.Image.thumbnail(output_file, 1080 * 4) |
|
|
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) |
|
|
print(output_file) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
if __name__ == "__main__": |
|
|
# Example usage |
|
|
# 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 |
|
|
k = 10 |
|
|
spacing_inches = 1.5 |
|
|
spacing_inches = 2 |
|
|
create_grid_composite(directory, k, spacing_inches) |
|
|
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) |
|
|