|
@ -1,6 +1,6 @@ |
|
|
# import matplotlib.patches as patches |
|
|
# import matplotlib.patches as patches |
|
|
from typing import Union |
|
|
|
|
|
from pathlib import Path |
|
|
from pathlib import Path |
|
|
|
|
|
from typing import Union |
|
|
|
|
|
|
|
|
import matplotlib.patches as patches |
|
|
import matplotlib.patches as patches |
|
|
import matplotlib.pyplot as plt |
|
|
import matplotlib.pyplot as plt |
|
@ -46,8 +46,10 @@ def create_circle( |
|
|
ckpt: Union[str, ColorTransformerModel], fname: str, skip: bool = True, **kwargs |
|
|
ckpt: Union[str, ColorTransformerModel], fname: str, skip: bool = True, **kwargs |
|
|
): |
|
|
): |
|
|
if isinstance(ckpt, str): |
|
|
if isinstance(ckpt, str): |
|
|
import yaml |
|
|
|
|
|
M = ColorTransformerModel.load_from_checkpoint(ckpt, map_location=lambda storage, loc: storage) |
|
|
M = ColorTransformerModel.load_from_checkpoint( |
|
|
|
|
|
ckpt, map_location=lambda storage, loc: storage |
|
|
|
|
|
) |
|
|
else: |
|
|
else: |
|
|
M = ckpt |
|
|
M = ckpt |
|
|
|
|
|
|
|
@ -152,7 +154,9 @@ if __name__ == "__main__": |
|
|
if len(ckpt) > 0: |
|
|
if len(ckpt) > 0: |
|
|
ckpt = ckpt[-1] |
|
|
ckpt = ckpt[-1] |
|
|
print(f"Generating image for checkpoint: {ckpt}") |
|
|
print(f"Generating image for checkpoint: {ckpt}") |
|
|
create_circle(ckpt, fname=name, dpi=args.dpi, figsize=[args.figsize] * 2, roll=False) |
|
|
create_circle( |
|
|
|
|
|
ckpt, fname=name, dpi=args.dpi, figsize=[args.figsize] * 2, roll=False |
|
|
|
|
|
) |
|
|
else: |
|
|
else: |
|
|
print(f"No checkpoint found for version {v}") |
|
|
print(f"No checkpoint found for version {v}") |
|
|
# make_image(ckpt, fname=name + "b", color=False, dpi=args.dpi,) |
|
|
# make_image(ckpt, fname=name + "b", color=False, dpi=args.dpi,) |
|
|