Skip to main content

Coveralls Tests Documentation Status PyPI version

torchwebio

Yet another model to web app generator

torchwebio is a simple package that turns your pytorch model into a web application.

Why?

Researchers often train models or fine tune models using pytorch and use dashboards like tensorboard to track the progress of the training routine.

These dashboards often give you metrics like loss and accuracies and visualizing some sample images. But they don't help you visualize the actual real-world performance of your model in-training.

Imagine you want to test your model against some other sample images that you didn't plan before starting the training routine. Imagine you want to share your "latest-greatest-and-bestest" model with your manager. Imagine you wanted to continuously train your model and always share the latest-and-greatest with the world.

That's where this package comes in.

Read the relevant blog post here

Find the documentation here

How?

The code that powers this package is actually very, very simple. It is built upon the shoulders of giants: pywebio for app generation, and timm for Image classification models.

I am to be very opinionated, and support interfaces set out by the popular neural network libraries. This allows the webalyzer interface to be extremely simple, without needing to support all the "chaos" that exists out there.

Problem type Library Status
Image Classification timm Implemented
Object detection, Instance segmentation detectron2 Coming Soon
NLP models transformers Coming soon

Credits to pywebio for a super simple framework for python web UI generation.

Install

pip install torchwebio

Usage

Simple visualization

import timm
from torchwebio.webalyzer import webalyzer

# Load a TIMM-like model or a regular pytorch model
model = timm.create_model('tf_efficientnet_b0_apss', pretrained=True)

# ....
# Fine tune the model
# ....


# Launch the web UI
webalyzer(model)

Auto-updating application (coming soon!)

import timm
from torchwebio.webalyzer import webalyzer, updater

# Load a TIMM-like model or a regular pytorch model
model = timm.create_model('tf_efficientnet_b0_apss', pretrained=True)

webalyzer(model)

for idx, (data, labels) in enumerate(dataloader):
     # do some finetuning
     outputs = model(data)
     loss = criterion(outputs, labels)
     loss.backward()
     # ....

     # update the app every 1000 iterations
     if idx % 1000 == 0:
          updater(model)

For more examples, look into the demo folder

Contribute

Check out CONTRIBUTING.md. More to come!

Help out

I don't do this a day job, but if you do want to help out, buy me a coffee. I promise to donate 100% of the proceeds on the account :)

More than the money, this give me a data point on people "actually" interested in this project

"Buy Me A Coffee"

Metadata

Release files for torchwebio 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torchwebio 0.0.2
File Size Uploaded
torchwebio-0.0.2.tar.gz 25.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for torchwebio 0.0.2
File Interpreter ABI Platform
torchwebio-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 34.2 kB

Release files / torchwebio-0.0.2.tar.gz

Download URL torchwebio-0.0.2.tar.gz
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7db630c9c9ee366e0bf36601833e05bf5331202f1c2f94cb4ac3c31a9bc964e1
BLAKE2b-256 checksum
How to use checksums
54cead99b3399ac15a20ddf00037d2abe55bdbd16e5d1f973ef52fee0af80896
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / torchwebio-0.0.2-py3-none-any.whl

Download URL torchwebio-0.0.2-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1cd2e9a736846e77afd752b030de04f4c5ebea548b355bca6c4b17c804225a57
BLAKE2b-256 checksum
How to use checksums
f6aff52417288fd577527d54b7c808ae017070e41a17594f71c5150a15fd4b0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page