Coder Social home page Coder Social logo

image-similarity-flask's Introduction

License Python Python Docker

image-similarity-flask

Flask app for getting the similar products by photo. Similarity is calculated by Tensorflow+Keras. List of products and photos is coming from scraping the websites. Images are stored in directory of scraper and product data is stored in MongoDB. Image predictions are also stored in same MongoDB.

Features

  • This project is depending on the other scrapy-spiders project, that is scraping products (photos and data).
  • Built on back of docker & docker compose v2.
  • Makefile for easy use.
  • Backend: Flask + uWSGI + Nginx + Supervisord + external Mongo. Frontend Bootstrap 5 + jQuery UI.
  • Project will be ready on port:8080 and it's under basic htpasswd authentication.
  • Shares same network with scrapy Mongo.
  • Image similarity is calculated by 3 models: ResNet50 Avg-Pool, VGG16 FC2, and VGG16 Flatten. Top 10-15 results (by picture) from each model by each site are chosen.
  • List of bestsellers with filter by report date.

First-time setup

  1. Set Mongo connection data and path to images in .env. Settings are equivalent to the scrapy project. Note: IP address of Mongo will be equal to Mongo container name.
  2. Set Exchangerate API key.
  3. Add user for Nginx authentication. More details in the README at server/nginx/auth.
  4. Download Tensorflow wheel for Non-AVX and SSE2 CPU wget https://tf.novaal.de/core2/tensorflow-2.8.0-cp38-cp38-linux_x86_64.whl Or use the wheel with needed instructions.
  5. Pre-downloaded models' weights can be put into models folder.
  6. Build project make build and start make start.

Prediction tool

  1. Build image make build-tools.
  2. Run calculation make calc-predictions every day at same time for new images from past day.

TODO

  • Replace Threading with Celery task manager.
  • Drop-down list with collections in DB.
  • Bestsellers statistics.

License

This project is licensed under the terms of the Apache license.

image-similarity-flask's People

Contributors

mozgito 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.