CNN Raccoon v0.9.5
Create interactive dashboards for your Convolutional Neural Networks (CNNs) with a single line of code!
CNN Raccoon helps you with inspecting what's going on inside your Convolutional Neural Networks in a visual way that's easy to understand. Oh! Did I mention that you don't need to change your code at all? And that you can do all of this on a single line of Python code?
How to use it?
TensorFlow mode
When using CNN Raccoon for a TensorFlow (Keras) based model, you'll implement your model in the same way as before.
To load images from your dataset into CNN Raccoon, convert them to np.array object.
Check an example below for the CIFAR10 dataset.
model = tf.keras.models.Sequential([ ... ])
model.compile(...)
# You define and compile model in the same way
# Let's use Cifar-10 for this example, but can be any dataset
from tensorflow.keras.datasets import cifar10
(X_train, y_train), (X_test, y_test) = cifar10.load_data()
# CNN Raccoon magic!
from cnn_raccoon import inspector
# In a single line of code send your model to the Inspector
inspector(model=model, images=X_train[:10], number_of_classes=10, engine="keras")
PyTorch mode
If you decide to use CNN Raccoon for your PyTorch model, you'll implement your model in the same way as before.
To load images from your dataset into CNN Raccoon, convert them to the PyTorch.Variable object.
The best way to achieve this is by using PyTorch's dataset loader.
Check an example below for the CIFAR10 dataset.
# For PyTorch you define the model in the same way as before
model = Net()
# Load dataset using data loaders
transform = transforms.Compose(
[ transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
trainset = torchvision.datasets.CIFAR10(root='./data', train=True,
download=True, transform=transform)
trainloader = torch.utils.data.DataLoader(trainset, batch_size=4,
shuffle=True, num_workers=2)
dataiter = iter(trainloader)
images, labels = dataiter.next()
# CNN Raccoon magic!
from cnn_raccoon import inspector
# In a single line of code send your model to the Inspector
inspector(model=model, images=images, number_of_classes=10, engine="keras")
Interactive network graph
This library generates an interactive graph of your CNN directly in a browser. This graph allows you to click and inspect each layer inside your model.
Weights inspector
Visualization of each Convolutional filter from your network
GradCam
Based on the paper Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization .
To learn more about GradCam and Class Activation maps I do suggest reading through this post.
Siliency Maps
Based on the paper Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Maps .
To learn more about Saliency Maps I do suggest reading through this post.
Installation
Installation with pip
You can install CNN Raccoon directly from the PyPi repository using pip (or pip3):
pip install cnn-raccoon
Manual installation
If you prefer to install it from source:
- Clone this repository
git clone https://github.com/lucko515/cnn-raccoon
- Go to the library folder and run
pip install .
Requirements
PyTorch version
Install all requirements from requirements.txt file
pip install -r requirements.txt
After installing base, requirements make sure you have PyTorch >1.5.0 version.
Here is the PyTorch installation guide:
https://pytorch.org/get-started/locally/
TensorFlow version
Install all requirements from requirements.txt file
pip install -r requirements.txt
After installing base, requirements make sure you have TensorFlow (w/ Keras API) >2.0.0 version.
Here is the TensorFlow (w/ Keras API) installation guide:
https://www.tensorflow.org/install
TODO
If you want to contribute to the CNN Raccoon, here is what's on the TODO list:
- Silency Map for the TensorFlow mode
- Make dashboard responsive on smaller screens (< 1100px)
- Interactive CNN Builder
- Drag n Drop network builder
Contact
Add me on LinkedIn
Metadata
Release files for cnn-raccoon 0.9.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cnn-raccoon-0.9.5.tar.gz | 530.3 kB | Without provenance | Details |
Release files / cnn-raccoon-0.9.5.tar.gz
| Download URL | cnn-raccoon-0.9.5.tar.gz |
|---|---|
| Size | 530.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73afac40ecf575b560ab60495c5de813fea2143bf36271b5533bd0c38475114a
|
|
BLAKE2b-256 checksum How to use checksums |
0d7949bf1777329c0e5ca8f8ba66e5c57ff0ccf1fdad2fea0556d15f5bf90f06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0.post20201103 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.9
|
Security for cnn-raccoon 0.9.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.