Spaces:
Runtime error
Runtime error
history_table
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ def convert_to_grayscale(video_file, history):
|
|
36 |
current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
37 |
memory_usage = psutil.Process(os.getpid()).memory_info().rss / 1024 / 1024 # in MB
|
38 |
|
39 |
-
history.append(f"#{len(history)+1}
|
40 |
|
41 |
return output_file, history
|
42 |
|
@@ -60,7 +60,7 @@ with gr.Blocks() as demo:
|
|
60 |
history_output = gr.HTML(label="History")
|
61 |
|
62 |
history_output.change(
|
63 |
-
fn=lambda history: "<
|
64 |
inputs=history_state,
|
65 |
outputs=history_output,
|
66 |
queue=False,
|
|
|
36 |
current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
37 |
memory_usage = psutil.Process(os.getpid()).memory_info().rss / 1024 / 1024 # in MB
|
38 |
|
39 |
+
history.append(f"#{len(history)+1} {file_name} {current_time} {video_duration:.2f} {process_time:.2f} {memory_usage:.2f}")
|
40 |
|
41 |
return output_file, history
|
42 |
|
|
|
60 |
history_output = gr.HTML(label="History")
|
61 |
|
62 |
history_output.change(
|
63 |
+
fn=lambda history: "<table><tr><th>Entry</th><th>File Name</th><th>Collected On</th><th>Video Duration</th><th>Processing Time</th><th>Memory Usage</th></tr>" + "".join([f"<tr><td>{entry.split()[0]}</td><td>{entry.split()[1]}</td><td>{entry.split()[2]+' '+entry.split()[3]}</td><td>{entry.split()[4]} seconds</td><td>{entry.split()[5]} seconds</td><td>{entry.split()[6]} MB</td></tr>" for entry in history]) + "</table>",
|
64 |
inputs=history_state,
|
65 |
outputs=history_output,
|
66 |
queue=False,
|