An Artifical Intelligence capable of generating entertaining compliments or insults based off of one's facial features.
-
Dataset Extracted from
https://www.kaggle.com/datasets/xhlulu/140k-real-and-fake-faces
Data Labelling done with
rateData.py
andgenerateData.py
-
General Adversial Network GAN AI
Generator (
GAN/generate.py
): Relies onpeekingduck_process/preprocess_image.py
which preprocesses the image usingpeekingduck
, before OPT is used to generate a statement Discerner (GAN/discern.py
): UsesSGNLP
andCLIP
to determine how 'real' a statement is compared to the image -
Training
The Generator and Discerner are ran in a loop to attempt to continuously optimise both the Generator and Discerner
-
App
The app uses the webcam to capture an image which is then fed to the generator to generate the statement.
Disclaimer: This app is powered by an artifical intelligence that generates text, be it compliments or insults. The developers have put it utmost effort to ensure insults do not cause excessive harm, but we are unable to control what text may be displayed. By continuing to use this app, you acknowledge the possibility that potentially hurtful text may be generated.
- Ensure that you have python version 3.9 installed
- Install the following dependencies in the given order:
If the installation order is followed, you may safely ignore warnings about dependency version conflicts. It is best to start with a clean version of python with no pre-installed packages.
pip3.9 install peekingduck pip3.9 install sgnlp pip3.9 install git+https://github.com/openai/CLIP.git pip3.9 install pyttsx3
- Run
python3.9 app.py
and wait for the window to launch Note: The app loads an untrained generator model due to file size limiations on Github and RAM limitations. You may find the model checkpoints uploaded on Google Drive here: https://drive.google.com/drive/folders/1F5Znp-fasrPhR_1y-CXTME8nyVdNEob5?usp=share_link
- When the app is first launched, a disclaimer is shown. Press any key to dismiss the disclaimer.
- Smile, wave, or simply face the camera, and when you're ready, press
c
to generate a compliment, ori
to generate an insult. - After it has finished generating, it will read out the statement and display it on the screen (remember to turn up your volume!)
- You may continuously use the app, or press
q
to quit.
Warning: It is a known issue that the app instantly closes after generating one statement on macOS. Please run this code on a Windows system instead.