Skip to content

Any way to compress/decompress multiple images at once? #128

Answered by jonarchist
saltwick asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @saltwick,

yes, you can pass a batch of images into pre-trained models. A batch dimension is added here:
https://github.com/tensorflow/compression/blob/master/models/tfci.py#L45
and removed again here:
https://github.com/tensorflow/compression/blob/master/models/tfci.py#L50

If you pass a batch of images to the models in that dimension, they should return batched compressed strings. Note we haven't tested this approach, and this would naturally only work if the images are all the same size, which is one reason why we didn't implement this. Also, when using the --target_bpp parameter, you'd need to iterate separately over each image, as the R/D tradeoff will be different for each one.

If…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@saltwick
Comment options

@jonarchist
Comment options

@gregg-p
Comment options

@jonarchist
Comment options

Answer selected by saltwick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants