Skip to main content

streamlit-fesion

Streamlit component for frontend computer vision processing with Wasm/Pyodide.

Sister project: streamlit-webrtc


You write an image filter function in Python that receives an image frame, transforms it, and returns a processed image frame. streamlit-fesion exports it to the frontend environment and executes it with Pyodide to process the WebCam video stream.

Look at the code below. It is a grayscale filter example.

from streamlit_fesion import streamlit_fesion


def image_filter(input_image):
    import skimage

    grayscale = skimage.color.rgb2gray(input_image)
    return skimage.color.gray2rgb(grayscale)


streamlit_fesion(image_filter, [], key="fesion")

image_filter() is the filter function. streamlit-fesion will call it with an input image frame of type np.ndarray with 3 channels (RGB-ordered), and the filter function returns a processed image frame with the same type and shape.

Note that the image_filter() will be sent to the frontend environment and executed there, but any other parts of the code will not. Therefore, the packages used in the filter function must be imported inside it, like import skimage in the example above.

streamlit-fesion automatically detects the imported packages and installs them to the frontend environment at the initialization time1. However, if necessary, you can explicitly pass the requirements list to the second argument of streamlit_fesion(), where an empty list [] is passed in the example above.

The signature of streamlit_fesion() follows.

streamlit_fesion(
    filter_func: Callable[[np.ndarray], np.ndarray],
    dep_packages: Optional[List[str]] = None,
    key: Optional[str] = None,
)
  1. pyodide.loadPackagesFromImports is used for it. ↩

Metadata

Release files for streamlit-fesion 0.5.6

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

Source distribution (sdist)

Source distribution for streamlit-fesion 0.5.6
File Size Uploaded
streamlit_fesion-0.5.6.tar.gz 130.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-fesion 0.5.6
File Interpreter ABI Platform
streamlit_fesion-0.5.6-py3-none-any.whl Python 3 none any Details

Total release size: 259.9 kB

Release files / streamlit_fesion-0.5.6.tar.gz

Download URL streamlit_fesion-0.5.6.tar.gz
Size 130.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a94465e2bd8df57b1760016960934d2308b40e588be2ff9a6e393303e6a9429f
BLAKE2b-256 checksum
How to use checksums
099b57b109c1a46ba455a12c90766381af39854ae52a58fd73e88310d5ee1385
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2025.

Transparency log

Release files / streamlit_fesion-0.5.6-py3-none-any.whl

Download URL streamlit_fesion-0.5.6-py3-none-any.whl
Size 129.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cfe06db68d4ac9006d0b607f4df8f2e36aa4663661cc4a96d0ed102ebbc918ca
BLAKE2b-256 checksum
How to use checksums
dc345b780940568d08d10f9ebae4780a8046264fedcf44eb442e74235c9e95a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.6 This release

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

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