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

Feature/image saving callback #407

Merged
merged 19 commits into from
Aug 1, 2024
Merged

Conversation

benjijamorris
Copy link
Contributor

What does this PR do?

  • move image saving from each head to a ImageSave callback
  • remove save-input argument from im2im heads
  • move all example im2im configs to using an image saving callback

PLUGIN DEVS

This should preserve format except for saved out image filenames (which I don't think we're relying on anymore?) Feel free to chime in if you have more questions/tests I should run.

Before submitting

  • Did you make sure title is self-explanatory and the description concisely explains the PR?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you test your PR locally with pytest command?
  • Did you run pre-commit hooks with pre-commit run -a command?

Did you have fun?

Make sure you had fun coding 🙃

Benjamin Morris and others added 3 commits July 18, 2024 16:27
ritvikvasan
ritvikvasan previously approved these changes Jul 19, 2024
Copy link
Member

@ritvikvasan ritvikvasan 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 to me!

# stages: ["predict"]
# save_input: False
# training
saving:
Copy link
Member

Choose a reason for hiding this comment

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

what is the saving key here? Shouldnt callbacks just be a list of callbacks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they all have a key :

model_checkpoint:

if stage != "predict"
else None,
"input": self._postprocess(
batch[self.x_key], img_type="input", n_postprocess=n_postprocess
Copy link
Member

Choose a reason for hiding this comment

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

what is "img_type" here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in the config I broke down postprocesssing by whether it's applied to the input/target/prediction

Copy link
Member

@ritvikvasan ritvikvasan left a comment

Choose a reason for hiding this comment

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

LGTM!

@benjijamorris benjijamorris merged commit bd15888 into main Aug 1, 2024
4 of 6 checks passed
@benjijamorris benjijamorris deleted the feature/image_saving_callback branch August 1, 2024 19:59
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

Successfully merging this pull request may close these issues.

2 participants