EndPresso compresses an image by detecting the important and unimportant objects inside a frame and compressing them accordingly. In short, YOLO is used to detect and segment the objects and then the compression is done respectively.
- Python 3.6
- OpenCV
- PyTorch 0.4
- Numpy
*Using PyTorch 0.3 will break the detector.
-
Clone, and
cd
into the repo directory.git clone https://github.com/zeeem/EndPresso.git cd EndPresso
-
Install the required dependencies if necessary:
- Python 3
- Install Pytorch following THIS LINK
- Other python dependencies: PIL (Pillow version), numpy, openCV
The app is still in alpha so there is no GUI developed yet.
cd
to the prject directory and run the app by the following command in the terminal.
python detect.py --images images/test3.jpg --quality 10
Here,
--images
flag defines the directory to load images from,
--quality
is an optional flag. Its the rate of the compression where 0 = highest compression (lowest quality) and 100 = lowest compression(highest quality). As default it's 10.
images/test3.jpg
is the source image. Change it accordingly.
The output file will be saved in the output
directory with the filename res.jpg
.
The code is based on the official code of YOLO v3, PyTorch part of the original code, by marvis, as well as PyTorch implementation of the YOLO v3 by ayooshkathuria
The weights file "yolov3.weights" is downloaded from here
If needed, please contact at rahmanje[at]ualberta[dot]ca, hanming[at]ualberta[dot]ca.