fab-jul / imgcomp-cvpr Goto Github PK
View Code? Open in Web Editor NEWTensorFlow implementation of Conditional Probability Models for Deep Image Compression, published in CVPR 2018
License: GNU General Public License v3.0
TensorFlow implementation of Conditional Probability Models for Deep Image Compression, published in CVPR 2018
License: GNU General Public License v3.0
How can i apply to testing your code for monochromatic images. Is it possible? Or what i need to change from your code? Could you please let me know?
when I used the follow comand to create tf_records of imagenet datasets:
pushd train
find . -name "*.JPEG" | parallel --bar -j64 -N 1250 \
'OUTPUT_PATH=$(printf "../records/train/train-%05d.tfrecord" {#});' \
'python -m fjcommon tf_records mk_img_rec {} -o $OUTPUT_PATH --feature_key image/encoded'
popd
pushd val
find . -name "*.JPEG" | parallel --bar -j16 -N 1250 \
'OUTPUT_PATH=$(printf "../records/val/val-%05d.tfrecord" {#});' \
'python -m fjcommon tf_records mk_img_rec {} -o $OUTPUT_PATH --feature_key image/encoded'
popd
I got the error log:
usage: __main__.py [-h] {mk_img_recs,mk_img_recs_dist,join,extract,check} ...
__main__.py: error: argument mode: invalid choice: 'mk_img_rec' (choose from 'mk_img_recs', 'mk_img_recs_dist', 'join', 'extract', 'check')
Hello!
I used your models and my trained models to compress images. Even though the bpp is low, the images reconstructed are large in size, e.g. the original image is 671.48kB, the compressed image is 500kB of 0.388 bpp, however, the image compressed by JPEG is 350kB of 0.6 bpp. I cannot find out why the JPEG-compressed image of a larger bpp is smaller than the model-compressed image of a small bpp.
Hello, when I using the argument of --restore, there is something wrong:
OutOfRangeError (see above for traceback): RandomShuffleQueue '2_input_glob__data_wency_CLIC_mobile_train_.png/shuffle_batch_join/random_shuffle_queue' is closed and has insufficient elements (requested 30, current size 0)
Can you give me some advice? Thank you~
Hello, there are some questions about the decoding of Bitstream.
1、How can we get the distribution of each location in the adaptive arithmetic decoding phase, by computing the distribution of each location one by one as an auto-regressive model through the context model?
2、 And what kind of information should be encoded into the bitstream?
Looking forward to your reply.
In quantizer.py (line 82), there are two softmax usages over distances. I wonder if there is any special meaning to phi_hard softmax.
I would say that argmax could have been done directly on distances, but I might be missing something here.
Hi, I cannot fully understand your parameters in val.py, such as job_ids, what kind of parameter should i give? I very appricate that you can give a detailed explation for others parameters. Thanks a lot.
In the quantizer.py file, soft quantization is used. How do I update the sigma parameter during training? Is sigma only 1 during training?
thank you
I am sorry for bothering you again, but please allow me to show my issue for the last time. After I prepared all the environment, including the python packages and TFrecords, my training always stopped at the string "-STARTING TRAINING-------------", then it won't show any infomation at all ,it just stopped there, and will never finish itself.I don't know why.Here is my training command:
Hello, the center of the quantized value is selected randomly, why? If it was randomly allocated, how to realize the part of arithmetic coding? Looking for your reply~
In the train process:
python train.py ae_configs/cvpr/low pc_configs/cvpr/res_shallow
--dataset_train ~/data/train
--dataset_test ~/data/val
--log_dir_root ~/imgcomp-cvpr-master/code/log
I got this error:
*- STARTING TRAINING ------------------------------------------------------------
Traceback (most recent call last):
File "train.py", line 530, in
main()
File "train.py", line 526, in main
description=flags.description if not flags.temporary else None)
File "train.py", line 194, in train
train_flags, logdir, saver, is_restored=restore_manager is not None)
File "/public/home/xqqstu/anaconda3/envs/py35/lib/python3.5/contextlib.py", line 66, in exit
next(self.gen)
File "/public/home/xqqstu/anaconda3/envs/py35/lib/python3.5/sitepackages/fjcommon/tf_helpers.py", l
ine 39, in start_queues_in_sess coord.join(threads)
File "/public/home/xqqstu/anaconda3/envs/py35/lib/python3.5/sitepackages/tensorflow/python/training/coordinator.py", line 389, in join six.reraise(self._exc_info_to_raise)
File
"/public/home/xqqstu/anaconda3/envs/py35/lib/python3.5/site-packages/six.py", line 703, in reraise raise value
File "/public/home/xqqstu/anaconda3/envs/py35/lib/python3.5/sitepackages/tensorflow/python/training/queue_runner_impl.py", line 238, in _run enqueue_callable()
File "/public/home/xqqstu/anaconda3/envs/py35/lib/python3.5/sitepackages/tensorflow/python/client/session.py", line 1231, in _single_operation_run target_list_as_strings, status, None)
File "/public/home/xqqstu/anaconda3/envs/py35/lib/python3.5/sitepackages/tensorflow/python/framework/errors_impl.py", line 473, in exit c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.FailedPreconditionError: /public/home/xqqstu/data/train; Is a directory
[[Node: input_glob__public_home_xqqstu_data_train/images_decoded/ReaderReadV2 = ReaderReadV2[_device="/job:localhost/replica:0/task:0/device:CPU:0"](input_glob__public_home_xqqstu_data_train/images_decoded/WholeFileReaderV2, input_glob__public_home_xqqstu_data_train/images_decoded/input_producer)]]
hello, I don't figure out that when testing the model , why to use the hardout for the input of the P network .In my opinions ,the hardout and the symbols are equal in a sense .
In the plot chapter,how can we get the *.csv files
Hello @fab-jul,
the download link seems to no longer work (https://data.vision.ee.ethz.ch/mentzerf/imgcomp-ckpts/ckpts.tar.gz). Is there any other way to get the checkpoints?
Thank you very much.
After I created the python3.4.5,I used "pip install -r requirements.txt" to install the packages,a warning appeared:imageio requires Python '>=3.5' but the running Python is 3.4.5.I don't whether I should switch to python3.5
@fab-jul Excuse me.The MS-SSIM of the model I trained is almost as high as described in the article, but the psnr and ssim have no performance of JPEG compression. Is this the case for your training model?
Why does the decompression images have chromatic aberration? @fab-jul
Sorry to bother you again!but a warming appers when I am train a model using ImageNet :
If I save the quantized volume after the quantizer, the numpy file is larger in size than the original image. How to save the compressed form so that it takes lesser memory than the original image ?
@fab-jul
hello~The Model-size of ckpts provied by you(0515_1103) is 136530KB = 1KB(checkpoint) +117723KB(.data) + 32KB(.index) + 18687KB(.meta) + 60KB(.pkl).
But the size of the model I trained with the network you provided is 232814 KB = 1KB(checkpoint) + 196160KB(.data) + 47KB(.index) + 36511KB(.meta) + 95KB(.pkl).
I think the model-size trained on the same network should be the same. So what i am confused about is whether the ckpts you provided are trained by the network you gave here? What is the difference between the network you trained and the network provided here?
I am looking forward to your reply.
I don't the meaning of "log_dir_root" in the training process
Excuse me. I'm confused with the configurations of training part.
I want to train a lower bit rate model such as bpp 0.2 or lower.
I used the ae_configs/cvpr/low
directly or modified it by H_target = 2*0.1
.
But after about 200000 iterations the average bpp of models on Kodak dataset are still about 0.35.
How can I train a lower bit rate model on Kodak dataset?
Thanks!
I noticed that in create_first/other_mask functions in probclass.py, you only set the causality mask on the last one on the C or D channel, which is different to Algo 1 in the supplemental material, where causality are supposed to be set across the C/D.
In other words, why not
mask[:, K // 2, K // 2:] instead of mask[-1, K // 2, K // 2:] ?
Thank you
hello!
If i want to optimized with mse, What should I change to mse?
I thought
"imgcomp-cvpr/code/ae_configs/cvpr/base
distortion_to_minimize=ms_ssim
-> distortion_to_minimize=mse" to optimize to mse.
Is it right???
Thank you.
Hello
I don't know if it still solves the issue related to the code, but I'll share it with you.
I would like to optimize the code you provided to me in mse.
I thought
"imgcomp-cvpr/code/ae_configs/cvpr/base
distortion_to_minimize=ms_ssim
-> distortion_to_minimize=mse" to optimize to mse.
However, the above method causes the following error.
For your information, there is nothing fixed except a distortion (ms-ssim optimization did a good job).
I tried to solve it by myself, but I'm a beginner, so I don't know how to solve it.
Thank you for sharing such a wonderful code. I'd appreciate it if you could help me with my problem.
Thank you :)
I want to compare the bpp between real value and estimated value, and I put the Kodak dataset named 'kodak' under the folder "code/ckpts", why I use the command "python val.py ../ckpts 0515_1103 ../ckpts/kodak --save_ours --real_bpp", I cannot see any results unless "***All given job_ids validated"?. Is there something wrong?
Hello, I am very confused of the part of context model in your code, what's the output of the context model represents? And what's the meaning of pc_loss = beta * tf.maximum(H_soft - H_target, 0), the reason for setting H_target is for what? Thank you very much and looking forward to your reply~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.