Skip to content

henrylevesque/Visual_Analysis_Tool

Repository files navigation

Visual Analysis Tool

This repository provides a framework for analysis based on visual data. The current implementation is set up for sentiment analysis from a sequence of images of a face, assigning a sentiment score (percentages for Angry, Disgust, Fear, Happy, Sad, Surprise, and Neutral) using the fer library by Justin Shenk. The tool outputs an Excel file with the image name, emotion percentages, and the dominant emotion.

This tool is designed to be used with data collected from the RPi Data Collection repository, also available on GitHub.

Project Structure

Visual_Analysis_Tool
├── main.py                # Entry point of the application
├── requirements.txt       # Project dependencies
├── .gitignore             # Files and directories to ignore in Git
├── example_images         # Folder with example images
├── example_results.xlsx   # Example results from running the example images
└── README.md              # Project documentation

Installation

  1. Clone the repository:

    git clone https://github.com/hleve/Visual_Analysis_Tool
    
  2. Navigate to the cloned directory:

    cd Visual_Analysis_Tool
    
  3. Create a virtual environment:

    python -m venv venv
    
  4. Activate the virtual environment:

    On Windows:

    venv\Scripts\activate
    

    On macOS and Linux:

    source venv/bin/activate
    
  5. Install the required dependencies:

    pip install -r requirements.txt
    
  6. Run the python file:

    python main.py
    

Configuration

You can specify the image folder and output file path using either command-line arguments or a configuration file (config.yaml).

Using config.yaml (recommended for general users)

Edit the config.yaml file in the project root:

# config.yaml example
image_folder: ./example_images
output_file: ./example_results.xlsx

Then simply run:

python main.py

Using command-line arguments (overrides config.yaml)

You can also specify options directly:

python main.py --image_folder ./my_images --output_file ./results.xlsx

If the output file already exists, the script will automatically create a new file with an incremented name (e.g., results_1.xlsx).

Output

The application will generate an Excel file containing the image names and their corresponding sentiment scores. The output file name will not overwrite previous results.

Usage

  1. Place your images in a designated directory.

  2. Navigate to the designated directory

  3. Update the image directory path in main.py.

  4. Update the output directory path in main.py.

  5. Run the application:

    python main.py
    

Output

The application will generate an Excel file containing the image names and their corresponding sentiment scores.

Contributing

Feel free to submit issues or pull requests for improvements or bug fixes.

License

This project is licensed under the MIT License. Details can be found in the LICENSE file.

About

An open source visual analysis tool based on FER

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages