Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

software-assignments-spring2021/spring-2019-profile-photo-lookup

Repository files navigation

Build Status

Reverse Profile Image Search

Introduction

Our project aims to create a general purpose reverse image search engine. Specifically, we implemented two individual modules, one focuses on celebrity and another focuses for NYU students, by using Amazon’s facial recognition API and natural language processing libraries. Given an user-uploaded image, the system detects and identifies human faces present in the image. If there is a potential match to a NYU student or a public figure, the system will return key information about the queried person, such as their name, picture, college, and facebook profile for an NYU student, or for celebrities, it returns information specific to the celebrities occupation. For example, if the celebrity is a musician, our system would return their music genres, a spotify playlist of their top songs, and their related artists. And currently, we have implemented four categories for celebrities and they are politician, actor, musician, athlete. We return different information for each category.

Built With

Prerequisites

Node.js

  • Download and Install Node.js here (now includes NPM).

Python/Anaconda

  • This project requires python version 3.X (specifically 3.6 was used in development). Additionally, we recommend using the Anaconda distribution of Python to take advantage of its virtual environment funationality.

Download the Anaconda Python 3.7 version here.

Set up Conda Environment(Optional)

If you have Anaconda installed:

Create a new environment

$ conda create -n <env_name> python=3.6

Activate environment

$ conda activate <env_name>

Deactivate the environment

$ conda deactivate

Replace <env_name> with the name of your environment. For more instructions, see here.

If you have Anaconda, please activate your conda environment BEFORE you do the following steps.

AWS Command-Line-Interface(CLI)

If you have Anaconda installed, then run

$ conda install -c conda-forge awscli

If you don't, then you have to follow the instruction here.

AWS Set Up

On your terminal, run aws configure

It will prompt you to enter "AWS Access Key ID", "AWS Secret Access Key", "Default Region Name"(you should enter "us-east-1"), and leave the "output format" blank by just pressing enter. Please message me if you need the credentials for grading purposes(I have already slacked it to both the tutor and professor).

If it says something like "aws: command not found" you should go back here and keep following the instructions to set the program PATH and bash profile. It was really messy for me so I'd suggest you download Anaconda and use conda install if you run into this problem.

API Setup

All API credentials should be entered in .envs under app/server. There are only placeholder values in the current file.

NOTE: the code will not run properly if API credentials are not valid! Please message me if you need the credentials for grading purposes(I have already slacked it to both the tutor and professor). If you already have a .envs file with the proper API keys, simply replace the placeholder .envs file under app/server with the .envs file that I sent you

Our Django backend uses Google Custom Search API for image query, Youtube API for video query, and Spotify API for playlist query.

ReactJS

Go to app/client and run

$ npm install

Django

Go to the directory where "requirements.txt" is located and run

$ pip install -r requirements.txt

It should install all necesary libraries for the Django Environment(new libraries will be added as project expands, run this command again if neccesary).

Start the App

  1. On two separate terminal windows
  2. Go to folder app/client, do
    • npm install(ignore if done in previous step)
    • npm start
  3. Go to app/server, do
    • python manage.py migrate (if starting first time)
    • python manage.py runserver

Once you are on our website with both the client and server systems running, there are sample images of students and celebrities under the images folder that you can use to test our system

Unit Test Coverage

Front-End

  1. Go to app/client
  2. To run test
    • npm test
  3. To generate coverage report
    • npm run converage
  4. To view the coverage report in your browser
    • cd coverage/lcov-report
    • open index.html

Back-End

  1. Go to app/server
  2. To run tests
    • coverage run --source='.' manage.py test crawler rekognition
  3. To see coverage report
    • coverage report or coverage html(for a more detailed report)
    • the report will be save in a folder named "htmlcov" inside the "server" folder
    • open "index.html" inside "htmlcov" to see the detailed report

Project Requirements

On project requirements, see REQUIREMENTS.md

Contributing

On how to contribute, see CONTRIBUTING.md

Authors