mmgeneration
mmgeneration copied to clipboard
How to inference my data with a pix2pix model?
Hello,i have train a pix2pix model with my own dataset,and now i want to inference this model.I try the way in translation_demo.py. But i found that when i takes paired image as input, i can get a comparatively good result, when i takes a source image as input, i got very bad result. what should i do if i want to get a good result only input a source image?
Hi @xiaojifu , you may modify the test_pipeline in your config this way.
test_pipeline = [
dict(
type='LoadImageFromFile',
io_backend='disk',
key='pair',
domain_a=domain_a,
flag='color'),
dict(
type='Resize',
keys=[f'img_{domain_a}'],
scale=(256, 256),
interpolation='bicubic'),
dict(type='RescaleToZeroOne', keys=[f'img_{domain_a}']),
dict(
type='Normalize',
keys=[f'img_{domain_a}'],
to_rgb=False,
**img_norm_cfg),
dict(type='ImageToTensor', keys=[f'img_{domain_a}']),
dict(
type='Collect',
keys=[f'img_{domain_a}'],
meta_keys=[f'img_{domain_a}_path'])
]