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.
- CNN Model Inference: Load pre-trained CNN models and perform inference on input data.
- Intermediate Tensor Visualization: Visualize intermediate tensors generated during model inference using an intuitive web interface.
- Python 3.11.5
- PyTorch 2.0.1
- Svelte
- JavaScript
-
Clone the repository:
git clone https://github.com/vibalab/CNNExplorer
-
Install conda environment and python dependencies:
conda create -n cnnexplorer python==3.11.5 conda activate cnnexplorer pip install -r requirements.txt
-
Download imagenet sample images
cd server git clone https://github.com/EliSchwartz/imagenet-sample-images cd ..
-
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
-
Install Svelte and JavaScript dependencies:
cd client npm install cd ..
- Download pre-trained CNN model weights.
- Use the provided Python scripts to perform inference on your desired input data.
- Run flask server app
Example:
cd server
mkdir weights
python get_pretrained.py # get pretrained torchvision models
python app.py-
Start the Svelte development server:
cd client npm run dev -
Open your web browser and navigate to
http://localhost:8080.
Contributions are welcome! Please feel free to open issues or pull requests for any improvements or features you'd like to see.
This project is licensed under the MIT License - see the LICENSE file for details.
