Write inference parameters into generated files as image metadata #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes demo.py write the parameters used when invoking it as EXIF or as PNG text chunks into the generated images.
That should make it a bit easier to go back to previous attempts and continue working from there.
EXIF for JPEG and TIFF output data contains the contents of the received argparser
args
as a single json string. PNG metadata additionally contains every argument as a seperate field.Filenames passed into
init-image
,mask
andoutput
are modified to only contain the files basename, not the entire path for privacy reasons.In addition to storing parameters when saving the image,
demo.py
can now also load and re-use parameters from a previously generated image via the--params-from
argument. When using--params-from
and passing additional parameters via the command-line, the additionally passed parameters will be preferentially used. This way, an old image can be re-created with higher iteration count, or identical parameters but a different seed.Example Metadata as displayed by exiftool:
PNG
TIFF
JPEG