Turn your pyTorch model into a web app
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file torchwebio-0.0.2.tar.gz
.
File metadata
- Download URL: torchwebio-0.0.2.tar.gz
- Upload date:
- Size: 25.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7db630c9c9ee366e0bf36601833e05bf5331202f1c2f94cb4ac3c31a9bc964e1 |
|
MD5 | e5f551a85035be4956d72c6fef603052 |
|
BLAKE2b-256 | 54cead99b3399ac15a20ddf00037d2abe55bdbd16e5d1f973ef52fee0af80896 |
File details
Details for the file torchwebio-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: torchwebio-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cd2e9a736846e77afd752b030de04f4c5ebea548b355bca6c4b17c804225a57 |
|
MD5 | 949269075a3afd0afeabb1a91216f073 |
|
BLAKE2b-256 | f6aff52417288fd577527d54b7c808ae017070e41a17594f71c5150a15fd4b0e |