Skip to content

fix(show1by1): --output_folder is parsed but images always (+1 more) - #95

Open
andrewwhitecdw wants to merge 1 commit into
NVlabs:masterfrom
andrewwhitecdw:bugfix/show1by1-assorted-764e8cd5
Open

fix(show1by1): --output_folder is parsed but images always (+1 more)#95
andrewwhitecdw wants to merge 1 commit into
NVlabs:masterfrom
andrewwhitecdw:bugfix/show1by1-assorted-764e8cd5

Conversation

@andrewwhitecdw

@andrewwhitecdw andrewwhitecdw commented Jul 27, 2026

Copy link
Copy Markdown

Small fixes in visual_tools/show1by1.py:

fix: --output_folder is parsed but images always written to hardcoded ./visual_data/rainbow

Fix: Replace:

save_path = './visual_data/rainbow'
if not os.path.isdir(save_path):
    os.mkdir(save_path)

with:

save_path = opts.output_folder

fix: --a2b option is ignored; only the a-side generator/ID models are used

Fix: Replace:

state_dict_gen = torch.load(opts.checkpoint_gen)
trainer.gen_a.load_state_dict(state_dict_gen['a'], strict=False)
trainer.gen_b = trainer.gen_a

state_dict_id = torch.load(opts.checkpoint_id)
trainer.id_a.load_state_dict(state_dict_id['a'])
trainer.id_b = trainer.id_a

trainer.cuda()
trainer.eval()
encode = trainer.gen_a.encode # encode function
style_encode = trainer.gen_a.encode # encode function
id_encode = trainer.id_a # encode function
decode = trainer.gen_a.decode # decode function

with:

state_dict_gen = torch.load(opts.checkpoint_gen)
trainer.gen_a.load_state_dict(state_dict_gen['a'], strict=False)
trainer.gen_b.load_state_dict(state_dict_gen['b'], strict=False)

state_dict_id = torch.load(opts.checkpoint_id)
trainer.id_a.load_state_dict(state_dict_id['a'])
trainer.id_b.load_state_dict(state_dict_id['b'])

trainer.cuda()
trainer.eval()
if opts.a2b == 1:
    encode = trainer.gen_a.encode # encode function
    style_encode = trainer.gen_a.encode # encode function
    id_encode = trainer.id_a # encode function
    decode = trainer.gen_a.decode # decode function
else:
    encode = trainer.gen_b.encode # encode function
    style_encode = trainer.gen_b.encode # encode function
    id_encode = trainer.id_b # encode function
    decode = trainer.gen_b.decode # decode function

Files changed

  • visual_tools/show1by1.py

@andrewwhitecdw
andrewwhitecdw marked this pull request as ready for review August 3, 2026 22:07
@andrewwhitecdw

Copy link
Copy Markdown
Author

Closing this sweep-generated PR: PR has 2 commits; sweep requires exactly one commit per PR. It does not meet the sweep requirements (single signed-off commit).

Signed-off-by: Andrew White <andrewwhitecdw@users.noreply.github.com>
Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
@andrewwhitecdw
andrewwhitecdw force-pushed the bugfix/show1by1-assorted-764e8cd5 branch from 79ea8fb to a0c668b Compare August 18, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant