8000 Evaluation metrics(FID) · Issue #124 · Yuanshi9815/OminiControl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Evaluation metrics(FID) #124

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

Open
Zhu1116 opened this issue Apr 28, 2025 · 12 comments
Open

Evaluation metrics(FID) #124

Zhu1116 opened this issue Apr 28, 2025 · 12 comments

Comments

@Zhu1116
Copy link
Zhu1116 commented Apr 28, 2025

Great work! I have a question here. When I was replicating the paper, under the conditional control of Canny, I generated 1000 images. Then I used the following code to calculate the FID metric and got a result of around 70, which is quite different from the result of more than twenty in the paper. May I ask what the reason for this is?

from torch_fidelity import calculate_metrics
input1=''
input2=''
metrics = calculate_metrics(input1=input1, input2=input2, fid=True)
@Yuanshi9815
Copy link
Owner
Yuanshi9815 commented Apr 28, 2025

Hi @Zhu1116 ,

May I check the inference code you used?

Thanks!

@Zhu1116
Copy link
Author
Zhu1116 commented Apr 28, 2025
for sent_key,sent_info in tqdm(content):

    imgid=str(sent_key).zfill(12)

    img_prompt_path = os.path.join(condition_image_folder_path, f"{imgid}.jpg")
    image = Image.open(img_prompt_path).convert("RGB")

    w, h, min_dim = image.size + (min(image.size),)
    image = image.crop(
        ((w - min_dim) // 2, (h - min_dim) // 2, (w + min_dim) // 2, (h + min_dim) // 2)
    ).resize((512, 512))

    condition = Condition("canny", image)

    result_img = generate(
        pipe,
        prompt=sent_info[0],
        conditions=[condition],
    ).images[0]

    result_img.save(os.path.join(save_dir_gen, f"{imgid}.jpg"))
    image.save(os.path.join(save_dir_resized, f"{imgid}.jpg"))
    condition.condition.save(os.path.join(save_dir_canny, f"{imgid}.jpg"))

like this,prompts and images are from coco val dataset

@Zhu1116
Copy link
Author
Zhu1116 commented Apr 28, 2025

Almostly copy from examples/spatial.ipynb

@Yuanshi9815
Copy link
Owner
Yuanshi9815 commented Apr 28, 2025

Hi @Zhu1116 ,

The inference code looks good and the only thing different from our implementation is that there is an extra central croping. But I dont think it will cause such a performance drop.

  1. Are the generated images look normal?
  2. Is the FID metrics are calculated by the generated images with size of 512x512 and the original coco images without any post-processing?

@Zhu1116
Copy link
Author
Zhu1116 commented Apr 28, 2025

oh, use the original coco images? I use the central cropped 512x512 images

@Yuanshi9815
Copy link
Owner
Yuanshi9815 commented Apr 28, 2025

@Zhu1116

No. Actually you should use the central cropped images.

@Zhu1116
Copy link
Author
Zhu1116 commented Apr 28, 2025

That's strange. The quality of the generated images is good. May I have a copy of your FID evaluation code?

Image

@Yuanshi9815
Copy link
Owner

@Zhu1116

We use the evaluate function from pyiqa.

@Yuanshi9815
Copy link
Owner

Could you please your email for further discussion?

@Zhu1116
Copy link
Author
Zhu1116 commented Apr 28, 2025

OK, OK. Thank you very much for your careful reply.

@Zhu1116
Copy link
Author
Zhu1116 commented Apr 28, 2025

Sure, I'd be more than happy to. 246939556@qq.com

@Zhu1116
Copy link
Author
Zhu1116 commented Apr 28, 2025

sorry, email is wrong. 2469395556@qq.com

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
0