GithubHelp home page GithubHelp logo

trendyol-cv-case's Introduction

Trendyol Image Similarity

Project Description:

This project focuses on measuring the similarity between two products.

The provided JSON file includes 20,000 fashion product images along with their bounding boxes. The goal is to identify the most similar fashion products within this dataset for a given input image.

The task involves randomly selecting 10 cropped images from the JSON file and identifying the 12 images that are most similar to each of them.

Installation Instructions:

To install the required dependencies, run the following command:

pip install -r requirements.txt

Usage Instructions:

  1. Specify the necessary paths in main.py:

    • images_folder: Path to the folder where images will be saved.
    • export_json_path: Path to the JSON file containing image and bounding box information.
    • crop_out_folder: Path to the folder where cropped images will be saved.
    • dataset_csv_out: Path to the CSV file for extracting dataset information.
  2. Run the main.py script:

python main.py

Features and Functionalities:

This project utilizes the following models for feature extraction:

Based on the results, ViT with DeepFashion In-shop pretrained weights outperforms other models.

Example Code Snippets:

from utils.image_cropper import ImageCropper
from utils.image_downloader import ImageDownloader
from utils.resnet_inference import ImageSimilarityResNet
from utils.vit_inference import ImageSimilarityViT


def main():
    
    images_folder = "data/images"
    export_json_path = "data/export.json"
    crop_out_folder = "data/cropped_images"
    dataset_csv_out = "data/dataset_info.csv"
    
    downloader = ImageDownloader(images_folder,
                                 export_json_path)
    downloader.download_images()

    cropper = ImageCropper(images_folder,
                           export_json_path,
                           crop_out_folder,
                           dataset_csv_out)
    cropper.crop_images()
    
    img_sim_resnet = ImageSimilarityResNet(crop_out_folder,
                                           dataset_csv_out,
                                           "faiss")
    img_sim_resnet.analyze_similarity()
    
    img_sim_vit = ImageSimilarityViT(crop_out_folder,
                                     dataset_csv_out,
                                     pretrained_dataset="StanfordOnline")
    img_sim_vit.analyze_similarity()

if __name__ == "__main__":
    main()

Results:

The outcomes of all models have been documented in PDF files, accessible in the results folder of this repository. Each PDF contains the query image and its top 12 similar images, providing a visual representation of the image retrieval process. You can click on the links below to view the PDF results:

Feel free to explore the similarity assessments achieved by each model.

License Information:

This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.

CC BY-NC 4.0 License

For more details, please refer to the LICENSE file.

trendyol-cv-case's People

Contributors

tekeburak avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.