Sample code that select similar icons using the method from the paper Learning Icons Appearance Similarity.
./small_dataset
folder containing a small subset downloaded from the noun project.model_icons.pth
stores the weights of the model.model_icons.py
contains the description of the model.plot_similar.py
plots similar icons to a given reference.
First make sure that you have installed the following packages for python:
torch
torchvision
matplotlib
tqdm
Download the weights of the trained model using this link and make sure they are placed in the root folder of the project. Then, in order to find similar icons in the given dataset run:
python3 plot_similar.py
If you did not modify the code, after running the script, a new folder similar_icons will be created containing the images of the reference together with the k closest icons to it in ascending order of distance (the distance is also written in the image title).
Note that we have tested the code using Python 3.6
If you found this code useful please cite our work:
@Article{Lagunas2018,
author="Lagunas, Manuel and Garces, Elena and Gutierrez, Diego",
title="Learning icons appearance similarity",
journal="Multimedia Tools and Applications",
year="2018",
month="Sep",
issn="1573-7721",
doi="10.1007/s11042-018-6628-7"
}
For more information and related work visit my personal website.
If you have further questions feel free to open an issue or send an email to mlagunas at unizar dot es
.