No project description provided
Project description
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 time[^1].
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.
[^1]:pyodide.loadPackagesFromImports is used for it.
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,
)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file streamlit_fesion-0.5.6.tar.gz.
File metadata
- Download URL: streamlit_fesion-0.5.6.tar.gz
- Upload date:
- Size: 130.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a94465e2bd8df57b1760016960934d2308b40e588be2ff9a6e393303e6a9429f
|
|
| MD5 |
9a63663f2c54b91096c7952691867452
|
|
| BLAKE2b-256 |
099b57b109c1a46ba455a12c90766381af39854ae52a58fd73e88310d5ee1385
|
Provenance
The following attestation bundles were made for streamlit_fesion-0.5.6.tar.gz:
Publisher:
main.yml on whitphx/streamlit-fesion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
streamlit_fesion-0.5.6.tar.gz -
Subject digest:
a94465e2bd8df57b1760016960934d2308b40e588be2ff9a6e393303e6a9429f - Sigstore transparency entry: 188178249
- Sigstore integration time:
-
Permalink:
whitphx/streamlit-fesion@eb8055505ac163a3026385e3e0ffd08fa4d0db78 -
Branch / Tag:
refs/tags/v0.5.6 - Owner: https://github.com/whitphx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@eb8055505ac163a3026385e3e0ffd08fa4d0db78 -
Trigger Event:
push
-
Statement type:
File details
Details for the file streamlit_fesion-0.5.6-py3-none-any.whl.
File metadata
- Download URL: streamlit_fesion-0.5.6-py3-none-any.whl
- Upload date:
- Size: 129.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfe06db68d4ac9006d0b607f4df8f2e36aa4663661cc4a96d0ed102ebbc918ca
|
|
| MD5 |
fb2f140b7eb33f0667b8fc09586022e2
|
|
| BLAKE2b-256 |
dc345b780940568d08d10f9ebae4780a8046264fedcf44eb442e74235c9e95a4
|
Provenance
The following attestation bundles were made for streamlit_fesion-0.5.6-py3-none-any.whl:
Publisher:
main.yml on whitphx/streamlit-fesion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
streamlit_fesion-0.5.6-py3-none-any.whl -
Subject digest:
cfe06db68d4ac9006d0b607f4df8f2e36aa4663661cc4a96d0ed102ebbc918ca - Sigstore transparency entry: 188178250
- Sigstore integration time:
-
Permalink:
whitphx/streamlit-fesion@eb8055505ac163a3026385e3e0ffd08fa4d0db78 -
Branch / Tag:
refs/tags/v0.5.6 - Owner: https://github.com/whitphx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@eb8055505ac163a3026385e3e0ffd08fa4d0db78 -
Trigger Event:
push
-
Statement type: