Closed sa92leh-fs closed 2 years ago
I was able to remove the error but the plot is not coming in the output box, please see below
@sa92leh-fs In terms of your original issue of updating and keeping track of plots from previous runs; you can use keep track of the session state. here's more info here (https://gradio.app/interface_state/#session-state). You can achieve keeping track of the previous plot figure with these steps:
Let me know if this solves your original issue.
Thanks @dawoodkhan82. Going to close this issue for lack of follow up
This is still an issue. Here is the most bare bones example and it still displays an empty plot:
import matplotlib.pyplot as plt
from sklearn import metrics
import numpy as np
import gradio as gr
def plot_conf_mat():
confusion_matrix = np.array([[2, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0],
[0, 0, 2, 0, 0, 0],
[0, 0, 0, 1, 0, 0],
[0, 0, 0, 0, 0, 0],
[1, 0, 1, 0, 2, 0]])
cm_display = metrics.ConfusionMatrixDisplay(confusion_matrix = confusion_matrix, display_labels=["Mr.", "Schmitty", "Warben", "Jaegar", "Man", "Jensen"])
cm_display.plot(xticks_rotation=85, cmap=plt.cm.Oranges)
figure = plt.figure()
return figure
demo = gr.Interface(
plot_conf_mat,
[],
gr.Plot(),
)
if __name__ == "__main__":
demo.launch(show_error=True)
Describe the bug
I want to plot the output of multiple runs on the Gradio interface but since the output is not stored, I will extract the data from the log file, and plot the count but this doesn't seem to be working. My ultimate goal is to show a plot that gets updated and does not get reset every time I submit
Is there an existing issue for this?
Reproduction
Read the video from specified path
Screenshot
Logs
System Info
Severity
annoying