Skip to content

Commit b74a7ba

Browse files
committed
minor
1 parent 11ab97f commit b74a7ba

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,15 @@ tensorboard --logdir experiments/my_experiment/tensorboard
8484
```
8585

8686
### Compression + Pretrained Model
87-
* To obtain a _theoretical_ measure of the storage bitrate under some trained model, run `compress.py`. This performs a forward pass through the model to obtain the reconstructed image. This model will work with images of arbitrary size/resolution (subject to memory).
87+
* To obtain a _theoretical_ measure of the storage bitrate of generic images under some trained model, run `compress.py`. This performs a forward pass through the model to obtain the reconstructed image. This model will work with images of arbitrary size/resolution (subject to memory).
8888
```
8989
python3 compress.py -i path/to/image/dir -ckpt path/to/trained/model
9090
```
91-
* A pretrained model using the OpenImages dataset [can be found here](https://drive.google.com/file/d/1QYylAsbYl2T-7l2jurtLPGNUW0pro7zW/view). The examples at the end of this readme were produced using this model. This model was trained for around 2e5 warmup steps and 2e5 steps with the full generative loss, with a target bitrate of `bpp=0.3` and using a discretized mixture of logistics to model the latent likelihood. To use this, download the model and point the `-ckpt` argument in the command above to the corresponding path.
91+
* A pretrained model using the OpenImages dataset [can be found here](https://drive.google.com/file/d/1QYylAsbYl2T-7l2jurtLPGNUW0pro7zW/view). The examples at the end of this readme were produced using this model. This model was trained for around 2e5 warmup steps and 2e5 steps with the full generative loss, with a target bitrate of `bpp=0.3` and using a discretized mixture of logistics to model the latent likelihood. To use this, download the model (around 2 GB) and point the `-ckpt` argument in the command above to the corresponding path. If you want to finetune this model on some domain-specific dataset, use the following options (you will probably need to play around with the learning rate yourself):
92+
93+
```
94+
python3 train.py --model_type compression_gan --regime med --likelihood_type logistic --warmstart -ckpt /path/to/trained/model
95+
```
9296

9397
* The reported `bpp` is the theoretical bitrate required to losslessly store the quantized latent representation of an image. Comparing this (not the size of the reconstruction) against the original size of the image will give you an idea of the reduction in memory footprint. This repository does not currently support actual compression to a bitstring ([TensorFlow Compression](https://github.com/tensorflow/compression) does this well). We're working on an ANS entropy coder to support this in the future.
9498

@@ -100,18 +104,18 @@ python3 compress.py -i path/to/image/dir -ckpt path/to/trained/model
100104
All content in this repository is licensed under the Apache-2.0 license. Feel free to submit any corrections or suggestions as issues.
101105

102106
### Examples
103-
The images below are taken from the CLIC2020 dataset. It's interesting to try to guess which image is the original (images are saved as PNG for viewing). You can expand the spoiler tags below each image to reveal the answer.
107+
The samples below are taken from the CLIC2020 dataset, external to the training set. It's interesting to try to guess which image is the original (images are saved as PNG for viewing). You can expand the spoiler tags below each image to reveal the answer.
104108

105109
A | B
106110
:-------------------------:|:-------------------------:
107-
![guess](assets/originals/CLIC2020_5.png) | ![guess](assets/hific/CLIC2020_5_RECON_0.160bpp.png)
111+
![guess](assets/hific/CLIC2020_5_RECON_0.160bpp.png) | ![guess](assets/originals/CLIC2020_5.png)
108112

109113
<details>
110114

111115
<summary>Image 1</summary>
112116

113117
```python
114-
Original: Right (11.6 bpp) | HIFIC: Left (0.160 bpp). Ratio: 72.5.
118+
Original: B (11.6 bpp) | HIFIC: A (0.160 bpp). Ratio: 72.5.
115119
```
116120

117121
</details>
@@ -125,7 +129,7 @@ A | B
125129
<summary>Image 2</summary>
126130

127131
```python
128-
Original: Left (14.6 bpp) | HIFIC: Right (0.330 bpp). Ratio: 44.2
132+
Original: A (14.6 bpp) | HIFIC: B (0.330 bpp). Ratio: 44.2
129133
```
130134

131135
</details>
@@ -141,20 +145,20 @@ A | B
141145
<summary>Image 3</summary>
142146

143147
```python
144-
Original: Left (12.3 bpp) | HIFIC: Right (0.209 bpp). Ratio: 58.9
148+
Original: A (12.3 bpp) | HIFIC: B (0.209 bpp). Ratio: 58.9
145149
```
146150

147151
</details>
148152

149153
A | B
150154
:-------------------------:|:-------------------------:
151-
![guess](assets/originals/CLIC2020_19.png) | ![guess](assets/hific/CLIC2020_19_RECON_0.565bpp.png)
155+
![guess](assets/hific/CLIC2020_19_RECON_0.565bpp.png) | ![guess](assets/originals/CLIC2020_19.png)
152156

153157
<details>
154158
<summary>Image 4</summary>
155159

156160
```python
157-
Original: Right (19.9 bpp) | HIFIC: Left (0.565 bpp). Ratio: 35.2
161+
Original: B (19.9 bpp) | HIFIC: A (0.565 bpp). Ratio: 35.2
158162
```
159163

160164
</details>
@@ -167,6 +171,7 @@ The last two shows interesting failure modes: small figures in the distance are
167171

168172
### References
169173
The following additional papers were useful to understand implementation details.
174+
170175
0. Fabian Mentzer, George Toderici, Michael Tschannen, Eirikur Agustsson. High-Fidelity Generative Image Compression. [arXiv:2006.09965 (2020)](https://arxiv.org/abs/2006.09965).
171176
1. Johannes Ballé, David Minnen, Saurabh Singh, Sung Jin Hwang, Nick Johnston. Variational image compression with a scale hyperprior. [arXiv:1802.01436 (2018)](https://arxiv.org/abs/1802.01436).
172177
2. David Minnen, Johannes Ballé, George Toderici. Joint Autoregressive and Hierarchical Priors for Learned Image Compression. [arXiv 1809.02736 (2018)](https://arxiv.org/abs/1809.02736).

0 commit comments

Comments
 (0)