Justin-Tan / generative-compression

TensorFlow Implementation of Generative Adversarial Networks for Extreme Learned Image Compression
MIT License
512 stars 106 forks source link

can I use your trained model directly #3

Closed sixleaves closed 6 years ago

sixleaves commented 6 years ago

If I want to compress my pictures, can I use your trained model directly or do I have to train with my own data set?

sixleaves commented 6 years ago

I still have doubts.

Justin-Tan commented 6 years ago

If you want to compress arbitrary images it would be better to train on the ADE20k dataset rather than the cityscapes dataset. For the ADE20k dataset you will need to write a script that resizes images to 512px width. The compression works by storing the image as a compressed intermediate representation that is restricted to integer values. The channel dimension of this compressed representation determines the compression factor, measured in bits per pixel. The authors choose C=2,4,8,16 in their paper. From what I understand, you need to use the decoder to retrieve the compressed image.

I haven't computed the memory footprint of the weight matrices explicitly, but should be fairly large, most likely the whole model is O(100) MB.

You can consult the paper for further details.

sixleaves commented 6 years ago

What is the difference between this decoder and the model and how large is the decoder?

Justin-Tan commented 6 years ago

The model consists of encoder -> quantizer -> decoder, the decoder is part of the model. I would estimate the size of the decoder weights to be O(100 MB).

If you want to understand the compression more thoroughly, I recommend reading the paper.

sixleaves commented 6 years ago

Thank you very much. I just want to use it directly in the project. I understand that if the decoder is so large, then it is not suitable for us to use in the project unless the number of pictures in the project is more than 10 times that of the decoder.