This repository contains the code to construct the photomosaic of an image using a flower dataset.
Description of Dataset
Flower102 : Flower dataset consisting of 102 classes.
Flower17 : You can alternatively use the flower dataset with 17 classes.
infile
: path to target image
outfile
: path to output image
tol
: tolerance, if tol=5 then every patch in target image will be replaced randomly by one of the top 5 matches from the library
f
: scale, every library image replaces an fxf patch of the target image. Lower f corresponds to higher resolution of the output image.
./setup.sh
python mosaic.py --infile images/input/uiuc.jpg --outfile images/output/uiuc.png --tol 5 --f 16
Replaceinfile
,outfile
with your image paths. Tweaktol
andf
until you get the desired output.