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

Add CI for Super Resolution example and tqdm bar to the example #2899

Merged
merged 38 commits into from
Mar 29, 2023

Conversation

guptaaryan16
Copy link
Contributor

@guptaaryan16 guptaaryan16 commented Mar 22, 2023

Fixes #2885

Description: I have added the SR example to CI and it works on the unit tests

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

@github-actions github-actions bot added ci CI examples Examples labels Mar 22, 2023
@@ -45,7 +47,7 @@


class SRDataset(torch.utils.data.Dataset):
def __init__(self, dataset, scale_factor, crop_size=256):
def __init__(self, dataset, scale_factor, crop_size=180):
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you tweak this value for CI, let's make it as a parameter and keep default as 256

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok let me do that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @vfdev-5 , Actually I tested it again and it may not work for crop_size=256 always as some images may have a lower size than 200 pixels. So I have made it an argument of main.py that can be variable depending upon the choice of dataset for training and the upscale_factor

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @guptaaryan16
Can you retrain a bit longer a mode and add to the example README a matplotlib image of super-resolved CIFAR10 image vs bicubic upsampled image (similar to Colab).

Please also add a debug arg option to reduce dataset size to 5 train batches and run this example in debug mode to reduce CI time. Currently it takes around 3 minutes, we have to reduce that.

@@ -145,4 +149,6 @@ def checkpoint():
print("Checkpoint saved to {}".format(model_out_path))


ProgressBar().attach(trainer)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's remove log_training_loss handler and update ProgressBar options to display similar things.

@guptaaryan16
Copy link
Contributor Author

Hey @vfdev-5 please review

@guptaaryan16
Copy link
Contributor Author

guptaaryan16 commented Mar 27, 2023

Hey @vfdev-5 I have added the BasicProfileHandler and reduced the time of debug option to 24 seconds

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @guptaaryan16
Just few improvements in the readme and good to go

examples/super_resolution/README.md Outdated Show resolved Hide resolved
examples/super_resolution/README.md Outdated Show resolved Hide resolved
@guptaaryan16
Copy link
Contributor Author

Hey @vfdev-5 I have made the relevant changes in README.md

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @guptaaryan16 !

@vfdev-5 vfdev-5 enabled auto-merge (squash) March 29, 2023 13:30
@vfdev-5 vfdev-5 merged commit aa81057 into pytorch:master Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci CI examples Examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants