Skip to main content

An API for streamlining unsupervised ML ops such as visualizations, clustering, CNN insights, etc.

Project description

OpticalToolkit

A collection of deep learning -- computer vision utility functions

Installation

pip install optical_toolkit

Visualize

  • Visualize a dataset in a grid
  • Visualize the 2d and 3d embeddings of images
from sklearn.datasets import load_digits
from optical_toolkit.embeddings import get_embeddings

X, y = load_digits()

2d_embeddings, fig_2d = get_embeddings(X, y, dims=2, embedding_type="tsne", return_plot=True)
3d_embeddings, fig_3d = get_embeddings(X, y, dims=3, embedding_type="tsne", return_plot=True)

embedding2d embedding3d

embedding2d_comp embedding3d_comp

Insight

  • Visualize the filters of a (trained) CNN model
from optical_toolkit.cnn_filters import display_filters, display_model_filters

model_name = "xception"

layer_names = [
    "block2_sepconv1",
    "block5_sepconv1",
    "block9_sepconv1",
    "block14_sepconv1",
]

for layer_name in layer_names:
    display_filters(
    model=model_name,
    layer_name=layer_name,
)

filters filters filters filters

display_model_filters(model=model_name)

model_filters

  • Visualize the filters of your custom CNN with custom objects
import keras

model_name = "examples/custom_models/svdnet.keras"
dir_name = "examples/insights"

@keras.saving.register_keras_serializable()
class ResidualConvBlock(keras.layers.Layer):
    ...

display_model_filters(
    model_name,
    custom_layer_prefix="residual",
)

model_filters

Analyze

  • Analyze 'highly confident' errors in classification tasks
    • Confusion matrix normalized by row/column

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

optical_toolkit-0.8.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

optical_toolkit-0.8.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file optical_toolkit-0.8.0.tar.gz.

File metadata

  • Download URL: optical_toolkit-0.8.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.16 Linux/6.8.0-1021-azure

File hashes

Hashes for optical_toolkit-0.8.0.tar.gz
Algorithm Hash digest
SHA256 e7f21d7f1b68b74129f9e20e962ae50eabfba576b69e714ba721b4526620a754
MD5 74cae1cb0bf3918595cb632771fa6930
BLAKE2b-256 0eba7bf3a94a2ec6c05d51dd57d927f2abf1a473779a43ceba928d27bde240ca

See more details on using hashes here.

File details

Details for the file optical_toolkit-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: optical_toolkit-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.16 Linux/6.8.0-1021-azure

File hashes

Hashes for optical_toolkit-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c17bcec248027ce40ff77449b4f32fd98d7480f73d8c9d18848ae33990abfae
MD5 e1f29a0c30d734e64c7d7484075859ca
BLAKE2b-256 96d9c819650ac6eb08a36b47058e4055cff0652718d754ba00773bbd329c53a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page