@@ -22,6 +22,21 @@ For an introduction to lossy image compression with machine learning, take a
22
22
look at @jonycgn 's
23
23
[ talk on Learned Image Compression] ( https://www.youtube.com/watch?v=x_q7cZviXkY ) .
24
24
25
+ ## Documentation & getting help
26
+
27
+ For usage questions and discussions, please head over to our
28
+ [ Google group] ( https://groups.google.com/forum/#!forum/tensorflow-compression ) .
29
+
30
+ Refer to
31
+ [ the API documentation] ( https://tensorflow.github.io/compression/docs/api_docs/python/tfc.html )
32
+ for a complete description of the Keras layers and TensorFlow ops this package
33
+ implements.
34
+
35
+ There's also an introduction to our ` EntropyBottleneck ` class
36
+ [ here] ( https://tensorflow.github.io/compression/docs/entropy_bottleneck.html ) ,
37
+ and a description of the range coding operators
38
+ [ here] ( https://tensorflow.github.io/compression/docs/range_coding.html ) .
39
+
25
40
## Quick start
26
41
27
42
### Installing release 1.1 (stable)
@@ -48,26 +63,27 @@ cd compression-1.1
48
63
for i in tensorflow_compression/python/* /* _test.py; do python $i ; done
49
64
```
50
65
51
- ### Installing release 1.2b1 (beta)
66
+ ### Installing release 1.2b2 (beta)
52
67
53
68
Set up an environment in which you can install precompiled binary Python
54
69
packages using the ` pip ` command. Refer to the
55
70
[ TensorFlow installation instructions] ( https://www.tensorflow.org/install/pip )
56
71
for more information on how to set up such a Python environment.
57
72
58
- Run the following command to install the binary PIP package:
73
+ Install TensorFlow 1.14 or above with or without GPU support:
74
+ ``` bash
75
+ pip install tensorflow
76
+ ```
77
+ or
78
+ ``` bash
79
+ pip install tensorflow-gpu
80
+ ```
59
81
82
+ Then, run the following command to install the binary PIP package:
60
83
``` bash
61
84
pip install tensorflow-compression
62
85
```
63
86
64
- *** Note: for this beta release, we only support Python 2.7 and 3.4 versions on
65
- Linux platforms. We are working on Darwin (Mac) binaries as well. For the time
66
- being, if you need to run the beta release on Mac, we suggest to use Docker
67
- Desktop for Mac, and run the above command inside a container based on the
68
- [ TensorFlow docker image] ( https://www.tensorflow.org/install/docker ) for
69
- Python 2.7.***
70
-
71
87
### Using the library
72
88
73
89
We recommend importing the library from your Python code as follows:
@@ -161,28 +177,13 @@ python bls2017.py [options] compress original.png compressed.bin
161
177
python bls2017.py [options] decompress compressed.bin reconstruction.png
162
178
```
163
179
164
- ## Help & documentation
165
-
166
- For usage questions and discussions, please head over to our
167
- [ Google group] ( https://groups.google.com/forum/#!forum/tensorflow-compression ) .
168
-
169
- Refer to
170
- [ the API documentation] ( https://tensorflow.github.io/compression/docs/api_docs/python/tfc.html )
171
- for a complete description of the Keras layers and TensorFlow ops this package
172
- implements.
173
-
174
- There's also an introduction to our ` EntropyBottleneck ` class
175
- [ here] ( https://tensorflow.github.io/compression/docs/entropy_bottleneck.html ) ,
176
- and a description of the range coding operators
177
- [ here] ( https://tensorflow.github.io/compression/docs/range_coding.html ) .
178
-
179
- ## Building PIP package
180
+ ## Building PIP packages
180
181
181
- This section describes steps to build PIP package .
182
+ This section describes steps to build PIP packages .
182
183
183
- Docker image ` tensorflow/tensorflow:custom-op ` is used for PIP package build.
184
- Note that this is different from ` tensorflow/tensorflow:devel ` . To be compatible
185
- with TensorFlow PIP package, the GCC version must match, but
184
+ We use the Docker image ` tensorflow/tensorflow:nightly- custom-op ` for building
185
+ PIP packages. Note that this is different from ` tensorflow/tensorflow:devel ` . To
186
+ be compatible with the TensorFlow PIP package, the GCC version must match, but
186
187
` tensorflow/tensorflow:devel ` has a different GCC version installed.
187
188
188
189
Inside a Docker container from the image, the following steps need to be done.
@@ -193,16 +194,15 @@ Inside a Docker container from the image, the following steps need to be done.
193
194
194
195
``` bash
195
196
sudo docker run -v /tmp/tensorflow_compression:/tmp/tensorflow_compression \
196
- tensorflow/tensorflow:custom-op \
197
+ tensorflow/tensorflow:nightly- custom-op \
197
198
bash -c " pip install tensorflow &&
198
199
git clone https://github.com/tensorflow/compression.git
199
200
/tensorflow_compression && cd /tensorflow_compression &&
200
- bazel run -c opt :build_pip_pkg"
201
+ bazel run -c opt --copt=-mavx :build_pip_pkg"
201
202
```
202
203
203
204
The wheel file is created inside ` /tmp/tensorflow_compression ` . Optimization
204
- flags can be passed via ` --copt ` to the ` bazel run ` command above. For example,
205
- ` bazel ` command above can be ` bazel run -c opt --copt=-mavx :build_pip_pkg ` .
205
+ flags can be passed via ` --copt ` to the ` bazel run ` command above.
206
206
207
207
### Testing PIP package
208
208
@@ -213,7 +213,7 @@ pip install /tmp/tensorflow_compression/tensorflow_compression-*.whl
213
213
```
214
214
215
215
And run tests. (Do not run the tests in the workspace directory where
216
- ` WORKSPACE ` of ` tensorflow_compression ` repo lives. In that case, Python
216
+ ` WORKSPACE ` of ` tensorflow_compression ` repo lives. In that case, the Python
217
217
interpreter attempts to import ` tensorflow_compression ` packages from the source
218
218
tree rather than from the installed package system directory.)
219
219
0 commit comments