Comments (3)
To save the resulting image it has to be completely re-encoded, so both size changes and a slight drop in image quality can be expected.
The relevant code line for saving anonymization results to new images is here:
Line 183 in f668068
imsave()
is an alias to imwrite
, which is documented at https://imageio.readthedocs.io/en/stable/userapi.html#imageio.imwrite.
Here you see that you can pass image format-specific options through the **kwargs
, e.g. for .jpg see here: https://imageio.readthedocs.io/en/stable/format_jpeg-pil.html#parameters-for-saving
For decreasing the output file sizes, I would try lowering the quality
setting to something lower than 75.
Can you change the line referenced above to something like
imageio.imwrite(opath, frame, optimize=True, quality=50)
and report if it works?
We can also make this configurable through a command line flag similar to the --ffmpeg-config
option, which already exists to control video output codec options.
from deface.
Sorry, I see I forgot to reply.
For now I decided not to go ahead with this package. Although it would be great to make it more easily configurable, as the file size difference is quite big.
from deface.
@mdraw maybe a option to run the images through https://github.com/tjko/jpegoptim or http://optipng.sourceforge.net/ would be great.
from deface.
Related Issues (20)
- cv2.error: OpenCV HOT 5
- Adding -vf to ffmpeg HOT 2
- Enhancement Suggestion: add timespan(s) option HOT 1
- Doesn't seem to use hardware acceleration despite it being available HOT 2
- cuda_path is set but cuda wasn't able to be loaded HOT 6
- Feature Request: Add support for Coral TPU HOT 1
- Consider switching model to centerface_bnmerged.onnx HOT 1
- OpenVino for onnxruntime-openvino HOT 3
- Error when entering images of different sizes HOT 4
- Limit mask size to filter out unrealistic false positives HOT 3
- (Question) use with live streams (rtsp)
- Output has no audio HOT 1
- [macOS] Could not open file <file> as a video file with imageio
- select faces to not be blurred HOT 8
- Videos are sped-up when anonymized HOT 2
- Failed to load library libonnxruntime_providers_tensorrt.so with error HOT 1
- [macOS] RuntimeError: Could not get number of frames HOT 2
- Request: GUI and/or mobile apps HOT 2
- Add tracking as well as detection to improve speed
- executing in windows cmd
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 deface.