Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问在哪里修改生成图像的名称 #134

Open
TXM-MB opened this issue Dec 4, 2022 · 1 comment
Open

请问在哪里修改生成图像的名称 #134

TXM-MB opened this issue Dec 4, 2022 · 1 comment

Comments

@TXM-MB
Copy link

TXM-MB commented Dec 4, 2022

请问在哪里修改生成图像的名称 想用NIQE进行图像质量评价 但是源文件图像和生成器保存图像的名称不一样 求指教

@jiayouaa
Copy link

EnlightenGAN/util/visualizer.py 中修改为
def save_images(self, webpage, visuals, image_path):
image_dir = webpage.get_image_dir()
short_path = ntpath.basename(image_path[0])
name = os.path.splitext(short_path)[0]

    webpage.add_header(name)
    ims = []
    txts = []
    links = []

    for label, image_numpy in visuals.items():
        if label == 'fake_B':
            # image_name = '%s_%s.png' % (name, label)
            image_name = '%s.png' % name
            save_path = os.path.join(image_dir, image_name)
            util.save_image(image_numpy, save_path)

            ims.append(image_name)
            txts.append(label)
            links.append(image_name)
    webpage.add_images(ims, txts, links, width=self.win_size)

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

No branches or pull requests

2 participants