vibalab / CNNExplorer

0 stars 0 forks source link

CNNExplorer

This repository provides tools to load and inference Convolutional Neural Network (CNN) models using PyTorch and Python, as well as visualize the intermediate tensors using Svelte and JavaScript.

Watch the video

Features

  1. CNN Model Inference: Load pre-trained CNN models and perform inference on input data.
  2. Intermediate Tensor Visualization: Visualize intermediate tensors generated during model inference using an intuitive web interface.

Requirements

Installation

  1. Clone the repository:

    git clone https://github.com/vibalab/CNNExplorer
  2. Install conda environment and python dependencies:

    conda create -n cnnexplorer python==3.11.5
    conda activate cnnexplorer
    pip install -r requirements.txt
  3. Download imagenet sample images

    cd server
    git clone https://github.com/EliSchwartz/imagenet-sample-images
    cd ..
  4. Install nvm and NodeJS following link

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
    source ~/.bashrc
    nvm install node
  5. Install Svelte and JavaScript dependencies:

    cd client
    npm install
    cd ..

Usage

CNN Model Inference

  1. Download pre-trained CNN model weights.
  2. Use the provided Python scripts to perform inference on your desired input data.
  3. Run flask server app

Example:

cd server
mkdir weights
python get_pretrained.py # get pretrained torchvision models
python app.py

Intermediate Tensor Visualization

  1. Start the Svelte development server:

    cd client
    npm run dev
  2. Open your web browser and navigate to http://localhost:8080.

Contributing

Contributions are welcome! Please feel free to open issues or pull requests for any improvements or features you'd like to see.

License

This project is licensed under the MIT License - see the LICENSE file for details.