gradio-legacyimage


Namegradio-legacyimage JSON
Version 0.0.4 PyPI version JSON
download
home_page
SummaryPython library for easily interacting with trained machine learning models
upload_time2024-03-12 07:15:46
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords gradio gradio custom component gradio-template-image machine learning reproducibility visualization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# `gradio_legacyimage`
<a href="https://pypi.org/project/gradio_legacyimage/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_legacyimage"></a>  

Python library for easily interacting with trained machine learning models

## Installation

```bash
pip install gradio_legacyimage
```

## Usage

```python
import numpy as np

import gradio as gr
from gradio_legacyimage import LegacyImage

def process(x):
    flip = x.copy()
    flip["back"] = np.fliplr(flip["back"])
    mask = x.copy()
    mask["back"] = mask["mask"]
    return x, flip, mask

with gr.Blocks() as demo:
    with gr.Column():
        im1 = LegacyImage(source="upload", type="pil", tool="sketch")
        im2 = LegacyImage()
        im3 = LegacyImage()
        im4 = LegacyImage()

    btn = gr.Button()
    btn.click(process, inputs=im1, outputs=[im2, im3, im4])

if __name__ == "__main__":
    demo.launch()

```

## `LegacyImage`

### Initialization

<table>
<thead>
<tr>
<th align="left">name</th>
<th align="left" style="width: 25%;">type</th>
<th align="left">default</th>
<th align="left">description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><code>value</code></td>
<td align="left" style="width: 25%;">

```python
str | PIL.Image.Image | numpy.ndarray | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">A PIL LegacyImage, numpy array, path or URL for the default value that LegacyImage component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component.</td>
</tr>

<tr>
<td align="left"><code>height</code></td>
<td align="left" style="width: 25%;">

```python
int | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">Height of the displayed image in pixels.</td>
</tr>

<tr>
<td align="left"><code>width</code></td>
<td align="left" style="width: 25%;">

```python
int | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">Width of the displayed image in pixels.</td>
</tr>

<tr>
<td align="left"><code>image_mode</code></td>
<td align="left" style="width: 25%;">

```python
"1"
    | "L"
    | "P"
    | "RGB"
    | "RGBA"
    | "CMYK"
    | "YCbCr"
    | "LAB"
    | "HSV"
    | "I"
    | "F"
```

</td>
<td align="left"><code>"RGB"</code></td>
<td align="left">"RGB" if color, or "L" if black and white. See https://pillow.readthedocs.io/en/stable/handbook/concepts.html for other supported image modes and their meaning.</td>
</tr>

<tr>
<td align="left"><code>type</code></td>
<td align="left" style="width: 25%;">

```python
"numpy" | "pil" | "filepath"
```

</td>
<td align="left"><code>"numpy"</code></td>
<td align="left">The format the image is converted to before being passed into the prediction function. "numpy" converts the image to a numpy array with shape (height, width, 3) and values from 0 to 255, "pil" converts the image to a PIL image object, "filepath" passes a str path to a temporary file containing the image.</td>
</tr>

<tr>
<td align="left"><code>label</code></td>
<td align="left" style="width: 25%;">

```python
str | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.</td>
</tr>

<tr>
<td align="left"><code>every</code></td>
<td align="left" style="width: 25%;">

```python
float | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.</td>
</tr>

<tr>
<td align="left"><code>show_label</code></td>
<td align="left" style="width: 25%;">

```python
bool | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">if True, will display label.</td>
</tr>

<tr>
<td align="left"><code>show_download_button</code></td>
<td align="left" style="width: 25%;">

```python
bool
```

</td>
<td align="left"><code>True</code></td>
<td align="left">If True, will display button to download image.</td>
</tr>

<tr>
<td align="left"><code>container</code></td>
<td align="left" style="width: 25%;">

```python
bool
```

</td>
<td align="left"><code>True</code></td>
<td align="left">If True, will place the component in a container - providing some extra padding around the border.</td>
</tr>

<tr>
<td align="left"><code>scale</code></td>
<td align="left" style="width: 25%;">

```python
int | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer.</td>
</tr>

<tr>
<td align="left"><code>min_width</code></td>
<td align="left" style="width: 25%;">

```python
int
```

</td>
<td align="left"><code>160</code></td>
<td align="left">minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.</td>
</tr>

<tr>
<td align="left"><code>interactive</code></td>
<td align="left" style="width: 25%;">

```python
bool | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">if True, will allow users to upload and edit an image; if False, can only be used to display images. If not provided, this is inferred based on whether the component is used as an input or output.</td>
</tr>

<tr>
<td align="left"><code>visible</code></td>
<td align="left" style="width: 25%;">

```python
bool
```

</td>
<td align="left"><code>True</code></td>
<td align="left">If False, component will be hidden.</td>
</tr>

<tr>
<td align="left"><code>streaming</code></td>
<td align="left" style="width: 25%;">

```python
bool
```

</td>
<td align="left"><code>False</code></td>
<td align="left">If True when used in a `live` interface, will automatically stream webcam feed. Only valid is source is 'webcam'.</td>
</tr>

<tr>
<td align="left"><code>elem_id</code></td>
<td align="left" style="width: 25%;">

```python
str | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
</tr>

<tr>
<td align="left"><code>elem_classes</code></td>
<td align="left" style="width: 25%;">

```python
list[str] | str | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
</tr>

<tr>
<td align="left"><code>render</code></td>
<td align="left" style="width: 25%;">

```python
bool
```

</td>
<td align="left"><code>True</code></td>
<td align="left">If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.</td>
</tr>

<tr>
<td align="left"><code>mirror_webcam</code></td>
<td align="left" style="width: 25%;">

```python
bool
```

</td>
<td align="left"><code>True</code></td>
<td align="left">If True webcam will be mirrored. Default is True.</td>
</tr>

<tr>
<td align="left"><code>show_share_button</code></td>
<td align="left" style="width: 25%;">

```python
bool | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise.</td>
</tr>

<tr>
<td align="left"><code>source</code></td>
<td align="left" style="width: 25%;">

```python
"upload" | "webcam" | "canvas"
```

</td>
<td align="left"><code>"upload"</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>invert_colors</code></td>
<td align="left" style="width: 25%;">

```python
bool
```

</td>
<td align="left"><code>False</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>shape</code></td>
<td align="left" style="width: 25%;">

```python
tuple[int, int] | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>tool</code></td>
<td align="left" style="width: 25%;">

```python
"editor" | "select" | "sketch" | "color-sketch" | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>brush_radius</code></td>
<td align="left" style="width: 25%;">

```python
float | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>brush_color</code></td>
<td align="left" style="width: 25%;">

```python
str
```

</td>
<td align="left"><code>"#000000"</code></td>
<td align="left">None</td>
</tr>

<tr>
<td align="left"><code>mask_opacity</code></td>
<td align="left" style="width: 25%;">

```python
float
```

</td>
<td align="left"><code>0.7</code></td>
<td align="left">None</td>
</tr>
</tbody></table>


### Events

| name | description |
|:-----|:------------|
| `clear` | This listener is triggered when the user clears the LegacyImage using the X button for the component. |
| `change` | Triggered when the value of the LegacyImage changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input. |
| `stream` | This listener is triggered when the user streams the LegacyImage. |
| `select` | Event listener for when the user selects or deselects the LegacyImage. Uses event data gradio.SelectData to carry `value` referring to the label of the LegacyImage, and `selected` to refer to state of the LegacyImage. See EventData documentation on how to use this event data |
| `upload` | This listener is triggered when the user uploads a file into the LegacyImage. |
| `edit` | This listener is triggered when the user edits the LegacyImage (e.g. image) using the built-in editor. |



### User function

The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).

- When used as an Input, the component only impacts the input signature of the user function.
- When used as an output, the component only impacts the return signature of the user function.

The code snippet below is accurate in cases where the component is used as both an input and an output.

- **As output:** Is passed, the preprocessed input data sent to the user's function in the backend.


 ```python
 def predict(
     value: PreprocessData | None
 ) -> PreprocessData | None:
     return value
 ```
 

## `PreprocessData`
```python
class PreprocessData(TypedDict):
    back: Optional[Union[np.ndarray, _Image.Image, str]]
    mask: Optional[Union[np.ndarray, _Image.Image, str]]
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "gradio-legacyimage",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "gradio,gradio custom component,gradio-template-Image,machine learning,reproducibility,visualization",
    "author": "",
    "author_email": "Herve Lin <herve.vesync@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/a6/e1/6fe6cb846c418c4443683c4cc17667b5f642b536f333b1433c1d4b793560/gradio_legacyimage-0.0.4.tar.gz",
    "platform": null,
    "description": "\n# `gradio_legacyimage`\n<a href=\"https://pypi.org/project/gradio_legacyimage/\" target=\"_blank\"><img alt=\"PyPI - Version\" src=\"https://img.shields.io/pypi/v/gradio_legacyimage\"></a>  \n\nPython library for easily interacting with trained machine learning models\n\n## Installation\n\n```bash\npip install gradio_legacyimage\n```\n\n## Usage\n\n```python\nimport numpy as np\n\nimport gradio as gr\nfrom gradio_legacyimage import LegacyImage\n\ndef process(x):\n    flip = x.copy()\n    flip[\"back\"] = np.fliplr(flip[\"back\"])\n    mask = x.copy()\n    mask[\"back\"] = mask[\"mask\"]\n    return x, flip, mask\n\nwith gr.Blocks() as demo:\n    with gr.Column():\n        im1 = LegacyImage(source=\"upload\", type=\"pil\", tool=\"sketch\")\n        im2 = LegacyImage()\n        im3 = LegacyImage()\n        im4 = LegacyImage()\n\n    btn = gr.Button()\n    btn.click(process, inputs=im1, outputs=[im2, im3, im4])\n\nif __name__ == \"__main__\":\n    demo.launch()\n\n```\n\n## `LegacyImage`\n\n### Initialization\n\n<table>\n<thead>\n<tr>\n<th align=\"left\">name</th>\n<th align=\"left\" style=\"width: 25%;\">type</th>\n<th align=\"left\">default</th>\n<th align=\"left\">description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"left\"><code>value</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr | PIL.Image.Image | numpy.ndarray | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">A PIL LegacyImage, numpy array, path or URL for the default value that LegacyImage component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>height</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nint | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">Height of the displayed image in pixels.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>width</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nint | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">Width of the displayed image in pixels.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>image_mode</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\n\"1\"\n    | \"L\"\n    | \"P\"\n    | \"RGB\"\n    | \"RGBA\"\n    | \"CMYK\"\n    | \"YCbCr\"\n    | \"LAB\"\n    | \"HSV\"\n    | \"I\"\n    | \"F\"\n```\n\n</td>\n<td align=\"left\"><code>\"RGB\"</code></td>\n<td align=\"left\">\"RGB\" if color, or \"L\" if black and white. See https://pillow.readthedocs.io/en/stable/handbook/concepts.html for other supported image modes and their meaning.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>type</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\n\"numpy\" | \"pil\" | \"filepath\"\n```\n\n</td>\n<td align=\"left\"><code>\"numpy\"</code></td>\n<td align=\"left\">The format the image is converted to before being passed into the prediction function. \"numpy\" converts the image to a numpy array with shape (height, width, 3) and values from 0 to 255, \"pil\" converts the image to a PIL image object, \"filepath\" passes a str path to a temporary file containing the image.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>label</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>every</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nfloat | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>show_label</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">if True, will display label.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>show_download_button</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">If True, will display button to download image.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>container</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">If True, will place the component in a container - providing some extra padding around the border.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>scale</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nint | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>min_width</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nint\n```\n\n</td>\n<td align=\"left\"><code>160</code></td>\n<td align=\"left\">minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>interactive</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">if True, will allow users to upload and edit an image; if False, can only be used to display images. If not provided, this is inferred based on whether the component is used as an input or output.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>visible</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">If False, component will be hidden.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>streaming</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>False</code></td>\n<td align=\"left\">If True when used in a `live` interface, will automatically stream webcam feed. Only valid is source is 'webcam'.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>elem_id</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>elem_classes</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nlist[str] | str | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>render</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>mirror_webcam</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">If True webcam will be mirrored. Default is True.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>show_share_button</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise.</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>source</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\n\"upload\" | \"webcam\" | \"canvas\"\n```\n\n</td>\n<td align=\"left\"><code>\"upload\"</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>invert_colors</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>False</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>shape</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\ntuple[int, int] | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>tool</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\n\"editor\" | \"select\" | \"sketch\" | \"color-sketch\" | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>brush_radius</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nfloat | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>brush_color</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr\n```\n\n</td>\n<td align=\"left\"><code>\"#000000\"</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>mask_opacity</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nfloat\n```\n\n</td>\n<td align=\"left\"><code>0.7</code></td>\n<td align=\"left\">None</td>\n</tr>\n</tbody></table>\n\n\n### Events\n\n| name | description |\n|:-----|:------------|\n| `clear` | This listener is triggered when the user clears the LegacyImage using the X button for the component. |\n| `change` | Triggered when the value of the LegacyImage changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input. |\n| `stream` | This listener is triggered when the user streams the LegacyImage. |\n| `select` | Event listener for when the user selects or deselects the LegacyImage. Uses event data gradio.SelectData to carry `value` referring to the label of the LegacyImage, and `selected` to refer to state of the LegacyImage. See EventData documentation on how to use this event data |\n| `upload` | This listener is triggered when the user uploads a file into the LegacyImage. |\n| `edit` | This listener is triggered when the user edits the LegacyImage (e.g. image) using the built-in editor. |\n\n\n\n### User function\n\nThe impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).\n\n- When used as an Input, the component only impacts the input signature of the user function.\n- When used as an output, the component only impacts the return signature of the user function.\n\nThe code snippet below is accurate in cases where the component is used as both an input and an output.\n\n- **As output:** Is passed, the preprocessed input data sent to the user's function in the backend.\n\n\n ```python\n def predict(\n     value: PreprocessData | None\n ) -> PreprocessData | None:\n     return value\n ```\n \n\n## `PreprocessData`\n```python\nclass PreprocessData(TypedDict):\n    back: Optional[Union[np.ndarray, _Image.Image, str]]\n    mask: Optional[Union[np.ndarray, _Image.Image, str]]\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python library for easily interacting with trained machine learning models",
    "version": "0.0.4",
    "project_urls": null,
    "split_keywords": [
        "gradio",
        "gradio custom component",
        "gradio-template-image",
        "machine learning",
        "reproducibility",
        "visualization"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "67de0aab243be8464ff3671c6d8ed51c92d9c2d49d00a6571c25f831698d381d",
                "md5": "9f69edf7689ddd273429e95c873acc74",
                "sha256": "cc8e810c46a721fc66173e0bbfa44e93301f25d5871924cc14df222083c16f2b"
            },
            "downloads": -1,
            "filename": "gradio_legacyimage-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9f69edf7689ddd273429e95c873acc74",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 162227,
            "upload_time": "2024-03-12T07:15:44",
            "upload_time_iso_8601": "2024-03-12T07:15:44.155586Z",
            "url": "https://files.pythonhosted.org/packages/67/de/0aab243be8464ff3671c6d8ed51c92d9c2d49d00a6571c25f831698d381d/gradio_legacyimage-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a6e16fe6cb846c418c4443683c4cc17667b5f642b536f333b1433c1d4b793560",
                "md5": "7ec437fa2787954688e87d2fe40eece8",
                "sha256": "2a83fc25c9c144d45daad155c058869170dc8b0c71c3c12a2f77cbde9f62ea2c"
            },
            "downloads": -1,
            "filename": "gradio_legacyimage-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "7ec437fa2787954688e87d2fe40eece8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 182250,
            "upload_time": "2024-03-12T07:15:46",
            "upload_time_iso_8601": "2024-03-12T07:15:46.983584Z",
            "url": "https://files.pythonhosted.org/packages/a6/e1/6fe6cb846c418c4443683c4cc17667b5f642b536f333b1433c1d4b793560/gradio_legacyimage-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-12 07:15:46",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "gradio-legacyimage"
}
        
Elapsed time: 0.21032s