gifs in readme (#1298)
* hello world * gif * sepia * replace calc gifs * crop calculator gif * final gifs Co-authored-by: Dawood <dawoodkhan82@gmail.com> Co-authored-by: AK391 <81195143+AK391@users.noreply.github.com>
Before Width: | Height: | Size: 157 KiB After Width: | Height: | Size: 723 KiB |
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 1.8 MiB |
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 219 KiB |
@ -1,6 +1,7 @@
|
|||||||
|
import matplotlib
|
||||||
|
matplotlib.use('Agg')
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
|
||||||
|
|
||||||
import gradio as gr
|
import gradio as gr
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 346 KiB After Width: | Height: | Size: 424 KiB |
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 638 KiB |
@ -3417,7 +3417,7 @@ class Plot(Changeable, Clearable, IOComponent):
|
|||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
value,
|
value: Optional[Any] = None,
|
||||||
*,
|
*,
|
||||||
label: Optional[str] = None,
|
label: Optional[str] = None,
|
||||||
show_label: bool = True,
|
show_label: bool = True,
|
||||||
@ -3468,7 +3468,9 @@ class Plot(Changeable, Clearable, IOComponent):
|
|||||||
(str): plot type
|
(str): plot type
|
||||||
(str): plot base64 or json
|
(str): plot base64 or json
|
||||||
"""
|
"""
|
||||||
if isinstance(y, (ModuleType, matplotlib.pyplot.Figure)):
|
if y is None:
|
||||||
|
return None
|
||||||
|
elif isinstance(y, (ModuleType, matplotlib.pyplot.Figure)):
|
||||||
dtype = "matplotlib"
|
dtype = "matplotlib"
|
||||||
out_y = processing_utils.encode_plot_to_base64(y)
|
out_y = processing_utils.encode_plot_to_base64(y)
|
||||||
elif isinstance(y, dict):
|
elif isinstance(y, dict):
|
||||||
|