Skip to content

[Examples] Computing FID in unconditional image generation#9245

Open
alirezadizaji wants to merge 3 commits intohuggingface:mainfrom
alirezadizaji:main
Open

[Examples] Computing FID in unconditional image generation#9245
alirezadizaji wants to merge 3 commits intohuggingface:mainfrom
alirezadizaji:main

Conversation

@alirezadizaji
Copy link
Copy Markdown

@alirezadizaji alirezadizaji commented Aug 22, 2024

What does this PR do?

Since sometimes there's a need for quantitative assessment of image generation, this PR brings an example of FID computation, particularly for unconditional image generation. Using it is quite straightforward: simply by passing the --compute_fid argument in CLI, now it's possible to log the FID score in the tracker.

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@alirezadizaji
Copy link
Copy Markdown
Author

@sayakpaul

Copy link
Copy Markdown
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Would it not make sense to default to clean-fid instead?

Comment on lines +625 to +626
if global_step % args.checkpointing_steps == 0:
if accelerator.is_main_process:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe both of these could be clubbed together?

@alirezadizaji
Copy link
Copy Markdown
Author

Thank you! Would it not make sense to default to clean-fid instead?

Yes, it's a great idea to include clean FID. We could also add an option for clean-fid to let the user decide. It could be implemented in a separate PR after this one.

Comment thread examples/unconditional_image_generation/train_unconditional.py
@alirezadizaji
Copy link
Copy Markdown
Author

@sayakpaul

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 5, 2024

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions Bot added the stale Issues that haven't received updates label Oct 5, 2024
@sayakpaul
Copy link
Copy Markdown
Member

@alirezadizaji gentle ping regarding the open comments.

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@github-actions github-actions Bot removed the stale Issues that haven't received updates label Oct 6, 2024
@github-actions
Copy link
Copy Markdown
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions Bot added the stale Issues that haven't received updates label Oct 30, 2024
@sayakpaul sayakpaul removed the stale Issues that haven't received updates label Oct 30, 2024
@github-actions
Copy link
Copy Markdown
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions Bot added the stale Issues that haven't received updates label Nov 24, 2024
@sayakpaul sayakpaul removed the stale Issues that haven't received updates label Nov 24, 2024
@alirezadizaji
Copy link
Copy Markdown
Author

Thank you! Would it not make sense to default to clean-fid instead?

One nice property of the current FID computation is that it only processes real images once before the beginning of training (lines 549 to 566), which is faster than passing them every time to compute the scores, as clean-fid does.

@sayakpaul
Copy link
Copy Markdown
Member

I think multiple works now have reported enough issues about FID and have resorted to using lcean-fid despite the computational intensity. So, I think that would be preferrable.

@github-actions
Copy link
Copy Markdown
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions Bot added the stale Issues that haven't received updates label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Issues that haven't received updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants