{"id":13562190,"url":"https://github.com/tomasrasymas/simimg","last_synced_at":"2025-04-03T18:32:55.675Z","repository":{"id":39736973,"uuid":"193967708","full_name":"tomasrasymas/simimg","owner":"tomasrasymas","description":"Similar image search","archived":false,"fork":false,"pushed_at":"2022-12-08T05:17:25.000Z","size":6263,"stargazers_count":48,"open_issues_count":9,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-04T14:43:52.275Z","etag":null,"topics":["image-processing","python","similarity-search"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomasrasymas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-26T19:45:14.000Z","updated_at":"2024-07-29T06:36:33.000Z","dependencies_parsed_at":"2023-01-24T12:15:40.762Z","dependency_job_id":null,"html_url":"https://github.com/tomasrasymas/simimg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasrasymas%2Fsimimg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasrasymas%2Fsimimg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasrasymas%2Fsimimg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasrasymas%2Fsimimg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomasrasymas","download_url":"https://codeload.github.com/tomasrasymas/simimg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247056933,"owners_count":20876481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-processing","python","similarity-search"],"created_at":"2024-08-01T13:01:05.586Z","updated_at":"2025-04-03T18:32:51.695Z","avatar_url":"https://github.com/tomasrasymas.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# SimImg (Similar Image)\n\nSimImg is a set of tools used to find similar images. In this repo I am providing example using DeepFashion dataset. If you have image with some kind of outfit in it, you can search for similar ones by visual similarity.\n\n## Pipeline\n* Every image in image dataset is converted to multidimensional feature vector (`pre-trained ResNet50`)\n* Source image is converted to same feature vector\n* Similarity between source image and every dataset images is calculated (`cosine similarity`)\n* Most similar images are selected as result\n\n## Files description\n* `config.py` - main config file of a system\n* `download_dataset.py` - downloads DeepFashion dataset into local hard drive (`data/deepfashion/`)\n* `generate_features_db.py` - generates feature vectors for every image in a dataset (`data/features_db.pckl`)\n* `search.py` - loads generated features DB and makes search for similar images in DB\n* `image_2_vector.py` - converts image to its feature vector\n* `generate_td_projector_data.py` - generates tensorboard projector files two view feature vectors in thier embeddings space (`data/projector/`) \n \n## Image embeddings\nOutput of pre-trained model: `ResNet50(weights='imagenet', include_top=False, pooling='avg')`\n\n## TensorBoard projector\nIt is very resource intensive task. Be careful when selecting number of images to add to projector, cause in order to use TB projector all images are merged into singe montage image. \n\n![montage](docs/montage.png)\n\n```\npython generate_tb_projector_data.py --path data/montage --output data/projector --dataset_num 3000\n\ncd data/projector\n\ntensorboard --logdir .\n```\n\n![tensorboard](docs/tensorboard.png)\n\n## Google Colab\nTo speed up features DB generation Google Colab with it's free GPU was used. Notebook is located in colab_notebooks folder. After features DB is created copy it to `data/` folder. \n\n## Search for similar images (interactive)\n```\npython search.py --num 20\n```\n\nSearch result is similar images merged into single montage image, keeping source image the first one.\n### Sample 1\n![source_1](docs/sample_1_source.jpg)\n![results_1](docs/sample_1_results.png)\n\n\n### Sample 2\n![source_2](docs/sample_2_source.jpg)\n![results_2](docs/sample_2_results.png)\n\n\n### Sample 3\n![source_3](docs/sample_3_source.jpg)\n![results_3](docs/sample_3_results.png)\n\n\n## Dataset\nhttps://drive.google.com/open?id=0B7EVK8r0v71pQ2FuZ0k0QnhBQnc\n\nhttp://mmlab.ie.cuhk.edu.hk/projects/DeepFashion.html  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasrasymas%2Fsimimg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomasrasymas%2Fsimimg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasrasymas%2Fsimimg/lists"}