Comments (5)
@subzerofun Thanks for pointing that out.
-
It seems Tensorflow updated the split function from
tf.split(axis, num_or_size_splits, value)
totf.split(value, num_or_size_splits, axis)
-
Same change in tf.concat
tf.concat(axis, values)
totf.concat(values,axis)
-
tf.batch_matmul
is nowtf.matmul
These changes are in-order to make it work similar to Numpy.
I have pushed the changes. do a pull and it should work fine.
Also, for some reason the models load much slowly in newer version of TF but I have no idea what could be the issue.
from image-compression-cnn.
Thanks for the reply! I have just used the official upgrade script from the Tensorflow site, processed all your .py files (no errors after converting) and now everything is running fine!
I just tested a few images and the results are amazing. From what i have read the best JPEG compression algorithm out there is Mozillas mozjpeg – comparison:
Comparison of JPEG Lossless Compression Tools
I will try to process the images from the blog article above and the compare the results. The only problem is that the images are quite big (3000-4000px) and i don't have enough GPU memory at the moment (50+ Chrome tabs...). So the generate_map.py
script just crashes with an ResourceExhaustedError
error. Is there any way to reduce the memory usage?
And your algorithm can even reduce a moz-jpeg! Just a short result:
800 x 1000px ... moz-jpeg (quality 80/100) ... 172kb
... and after cnn compression: 62kb (!!!)
Of course you can see more artifacts (best visible in smooth regions) compared to the original file. And for some reason the cnn-image is sharper than the original.
Still – overall the ability to reduce the filesize of images, generated with the best jpeg algorithm out there, is amazing!
This is really a great solution for web images! The only downside is the computation time/effort.
from image-compression-cnn.
Thanks for the research. I am glad to hear that it is doing great on moz-jpeg.
-
Regardless of the size of the original image, the map being generated used the downsized image of 224x224. See this https://github.com/iamaaditya/image-compression-cnn/blob/master/util.py#L24
(This is because the TF model to generate the heatmaps are trained for specific input dimensions). -
If you give me what exact error you are getting I might be able to help.
-
I just did for an image with 5391x4048 pixels and it performed without problem.
-
Computation time is an issue, and we do understand that this makes it not feasible for quick deployment. However, encoding is a one time cost and decoding is as cheap/fast as JPEG. Also, since generating map is GPU based, it can take many images at a time (around 50 for my GPU) and generate the map at the same time.
If you looking to deploy this for an efficient system, get in touch with me. I can help you with that.
from image-compression-cnn.
Was trying a 2400 x 3000px image – but only with 1.6 of 6 GB VRAM available. For some reason it worked when i tried running it a second time.
The 3072 x 2304px image from the comparison site also worked now.
mozjpeg result: from 1,2 MB to 363 kb
CNN result: 305 kb
from compressed mozjpeg to CNN: 335 kb
Thanks for the deployment offer but i'm just testing this for fun :-). Maybe i'll use it for my next website, but since i only write small wordpress themes/sites, i will just need to convert ~50-200 images. That's manageable with a .sh script.
from image-compression-cnn.
Sure. I am glad it works. All the best with your work.
from image-compression-cnn.
Related Issues (20)
- errors in model.py HOT 4
- Some problems in codings HOT 2
- ValueError: invalid literal for int() with base 10: ''
- The map of one image is different from each time HOT 5
- the Output image size? HOT 8
- ROI range size HOT 2
- how to calculate PSNR of salient regions HOT 3
- Which software you have used to run this program? HOT 1
- How do you do JPEG compression?
- How did you get these indicators, PSNR-HVS?
- faild when python generate_map.py image.png HOT 2
- combine_images.py very slow?
- some questions of training HOT 5
- invalid link for downloading caffe_layers_value.pickle HOT 3
- Error with generate map HOT 1
- Error when train
- Error when train HOT 1
- Python3 support
- Image compression problem? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image-compression-cnn.