GithubHelp home page GithubHelp logo

alcibiadescleinias / hinzu-online Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 20.65 MB

The public version of the Hinzu project has been started since photolab TikTok hackathon (#noPep8, #LeadSeniorReasearchCode).

Home Page: https://hinzu.ru

Python 37.32% Dockerfile 0.57% Shell 0.57% CSS 48.80% JavaScript 0.80% HTML 11.95%
reactapp django-backend hinzu

hinzu-online's Introduction

Hinzu <#-#>


The directory represents the project which has been started during PhotoHack TikTok (March 2019). Since the event project evolves from a tiny Flask app to the Django-backend and ReactApp-frontend as one app with a neural model for searching similar images through our parsed-downloaded image db and other features, e.g. index search optimizations, calculation of offline, online metrics for analyzing and validation.

In two words, there are two fully similar apps:

  1. Django app (hinzu-django) with templated views.
  2. The next one (completed frontend for the previous) is ReactApp (hinzu.ru) which processing with the backend Django side, i.e. Django-Rest-Framework.

In addition, we save user appreciations as binary marks for resulted in a concatenated image (a user passed img with picked up the similar image from the film-image-base). So, we leave the possibility to improve our neural model.

Note

Structure of the web_app/views.py file is a bit odd. The reasons are the following: we have created the app with views on Flask firstly then we decided to migrate in a "one day" to Django and after that, in one day we created the reactApp as a frontend side. Thus, in views.py there are some active rudiments of Django's templated views and in Django RFW classes there are some odd session checks from the Flask app.

Briefly

Disclaimer: this is not a well-written doc, thereby read on your own risk. Or merely check the bottom for creds.

  • django-app/: web Hinzu as -//- app into 8000 port;

    • web_app/: django-app with few views & postgresql user rated data and made embeds;
      • data/: dir for data to match with. Should include following dirs as well:
        • movies/
        • memes/
        • pinterest/

        this dirs should contain embeds.npy or hnsw.zip files and also images/ dir with images accordingly;

    • Dockerfile: develop version of web_app uses entrypoint.sh;
    • Dockerfile.prod: production version uses entrypoint.prod.sh;
  • react-hinzu-app: tiny front app. It uses django api-rest-framework. Nginx serves built files. So, after success npm run build and scp -r build <server>:/home/ivan/, change previous build/ directory in a sec like following:

mv Hinzu/react-hinzu-app/build/ Hinzu/react-hinzu-app/last_build/ && mv build/ Hinzu/react-hinzu-app/build/ && rm -rf Hinzu/react-hinzu-app/last_build
  • docker-compose.yml: develop version of app uses .env.dev;

  • docker-compose.prod.yml: production version uses .env.prod & .env.prod.db. To start type the following

docker-compose -f docker-compose.prod.yml up

If want also build image and run just diemon use flags --build and -d accordingly. To see logs after used diemon flag type logs -f:

docker-compose -f docker-compose.prod.yml logs -f
  • hinzu_project: conf file from hinzu dev. server with nginx settings, should be located in /etc/nginx/sites-available/. To activate this configuration dnf to pass those settings to sites-enable/ dir:
sudo ln -s /etc/nginx/sites-available/hinzu_project /etc/nginx/sites-enabled
  • search/: scripts for making embeds & hnsw and other investigating/searching staff;

  • SCRAPPER/: additional code of imgs scrapping (Selenium and BeautifulSoup);

Tips & tricks

  • Where is reports&logs when it is prod version is running: all in volume and can be founded into mounted dirs on host. How to find:
docker volume ls
docker volume inspect <volume name>

What templates for similar images are used there?

All magic happens according to django-app/web_app/script.py file. There is ImageTemplate class with a few methods:

  • to_movie : this template runs on server,
  • to_blurface : just available template with 2 backgrounds.

Credential (c)

The Team:

hinzu-online's People

Contributors

alcibiadescleinias avatar

Stargazers

 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.