Code Monkey home page Code Monkey logo

explainable-ai-through-generating-counterfactual-explanations-for-stable-diffusion's Introduction

EE 452: Project

Explainable AI through generating counterfactual explanations for Stable Diffusion

This is a companion repository titled after our associated research paper

Initial Setup

In this section, we will prepare the necessary files and configurations required to run the project. We will download and upload various components such as the ResNetV2 classifier, the CelebA-HQ dataset, and the diffusion model checkpoints. Follow these steps to set up your environment properly.

Step 1: Downloading and Uploading Files

  1. ResNetV2 Classifier:

    • Download the ResNetV2 classifier model file. This file should be a trained model checkpoint that is compatible with PyTorch.
    • Upload the file to your Google Colab session.
    • Move the uploaded file to the /content/classifier directory using the following command:
      !mkdir -p /content/classifier
      !mv path_to_your_uploaded_classifier_file /content/classifier/
  2. CelebA-HQ Dataset:

    • Download the CelebA-HQ dataset. This dataset can typically be found on websites like Kaggle or directly from the original source that hosts this dataset.
    • Due to the large size of the dataset, it's recommended to upload it to your Google Drive.
    • Mount your Google Drive in this notebook:
      from google.colab import drive
      drive.mount('/content/drive')
    • Ensure that the dataset is accessible at /content/drive/MyDrive/path_to_celebA-HQ/. You can create a symbolic link to make it accessible under /content/data:
      !ln -s /content/drive/MyDrive/path_to_celebA-HQ /content/data
  3. Diffusion Model Checkpoints:

    • Download the checkpoints for your diffusion model. These are typically provided by the model developers or through a community repository.
    • Upload these checkpoints to your Colab session.
    • Move them into the /content/diffusion directory:
      !mkdir -p /content/diffusion
      !mv path_to_your_uploaded_diffusion_model_checkpoint /content/diffusion/

Step 2: Verifying File Locations

After uploading and moving the files, it's a good practice to verify that everything is in the correct location. Use the following command to check the contents of each directory:

!ls /content/classifier
!ls /content/data
!ls /content/diffusion

explainable-ai-through-generating-counterfactual-explanations-for-stable-diffusion's People

Contributors

smabbasht 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.