GithubHelp home page GithubHelp logo

fyp-ma-13's Introduction

Software Dependencies

  1. Python 3.6: https://www.python.org/downloads/release/python-3615/
  2. TensorFlow 2: https://www.tensorflow.org/install/
  3. Pillow: https://pillow.readthedocs.io/en/stable/installation.html
  4. NumPy: https://www.numpy.org/
  5. Matplotlib: https://matplotlib.org/install.html
  6. Pandas: https://pandas.pydata.org/pandas-docs/stable/install.html
  7. Jupyter Notebook: https://jupyter.org/install.html

Setup and Run

  1. Download and install all software dependencies listed above.

  2. Clone and navigate to our git repository here.

  3. To run the demonstration code GUI, run the following command:

    $ app/app.sh
  4. To view and perform model training and evaluation, run the code in fyp-models/poc_tl_all_cv.ipynb and fyp-models/gen_results.py by navigating to fyp-models and typing the command:

    $ jupyter notebook

Key Components

app/app.py

This is a software script that runs the GUI. It is modelled as a class and allows the customisation of:

  1. The image being selected in either JPG or PNG format
  2. The version of the model being used: baseline (unperturbed) or debiased
  3. The model architecture: ResNet50, DenseNet, or MobileNet
  4. The filter to apply: No filter, glasses filter, makeup filter, and N95 mask filter

An image can be loaded with the "Choose an image" button on the left of the screen and classified with the "Classify" button on the right of the screen.

For detailed documentation for the specific methods and variables used, please refer to the documentation in app/app.py.

fyp-models/poc_tl_all_cv.ipynb

This notebook is focused on model creation, model training, and model evaluation.

Outline

  1. Import libraries and initialise global variables
  2. Load data
  3. Data augmentation
  4. Load base models
  5. Model creation using transfer learning
    • Base models from step 4 are used here
  6. Model training
  7. Model analysis
    • Get model statistics
  8. Findings and results

fyp-models/gen_results.py

This Python script stores useful functions that allow us to perform useful actions, which include:

  • Adding a filter to a specific image
  • Making a single prediction with a confidence score for a specific image
Function Description
gen_metrics Generates classification report and confusion matrix (sklearn.metrics). Used by gen_save_cr_cm function.
gen_save_cr_cm Generates, saves and returns classification reports and confusion matrix. Used in poc_tl_all_cv.ipynb.
apply_filter Applies a filter to a specific image. Used by the GUI to apply a filter to a specific image and store it in a target file path.
make_pred Returns predicted class and confidence for a single image. Used by the GUI to get a prediction for a specified image.

fyp-ma-13's People

Contributors

alikachoo avatar theger14 avatar

fyp-ma-13's Issues

Design and implement a graphical user interface

A graphical user interface for image classification would be ideal for our project to demonstrate our findings.

Implement an application with the following features:

  • Loads any JPG or PNG image from the file system
  • Loads a single TensorFlow-compatible image classification model
  • Performs gender classification for the image
  • Displays the relevant statistics for the image and the classification model

Implement functional gender classification models

Previously, we had designed some preliminary models as an initial prototype during the Project Design phase.

Now, implement improved versions of that model with and without perturbations (such as makeup) for further testing.

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.