fabioantonini commited on
Commit
12bfe7e
·
verified ·
1 Parent(s): 8687d88

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -31,11 +31,11 @@ def analyze_pcap(pcap_file):
31
 
32
  # Prepare outputs
33
  html_report_path = os.path.join(output_dir, "sip_rtp_report.html")
34
- rtp_graphs = [f for f in os.listdir(output_dir) if f.startswith("rtp_visualization") and f.endswith(".png")]
35
- sequence_diagrams = [f for f in os.listdir(output_dir) if f.startswith("sip_sequence") and f.endswith(".png")]
36
  dashboard = os.path.join(output_dir, "call_quality_dashboard.png")
37
 
38
- return result_text, html_report_path, [os.path.join(output_dir, f) for f in sequence_diagrams], [os.path.join(output_dir, f) for f in rtp_graphs], dashboard
39
 
40
  with gr.Blocks(title="SIP & RTP PCAP Analyzer") as demo:
41
  gr.Markdown("""
@@ -48,8 +48,8 @@ with gr.Blocks(title="SIP & RTP PCAP Analyzer") as demo:
48
 
49
  result_text = gr.Textbox(label="Analysis Summary", lines=15)
50
  html_report = gr.File(label="Download HTML Report")
51
- sequence_images = gr.Gallery(label="SIP Sequence Diagrams").style(grid=2)
52
- rtp_images = gr.Gallery(label="RTP Stream Visualizations").style(grid=2)
53
  dashboard_image = gr.Image(label="Call Quality Dashboard")
54
 
55
  run_btn.click(
 
31
 
32
  # Prepare outputs
33
  html_report_path = os.path.join(output_dir, "sip_rtp_report.html")
34
+ rtp_graphs = [os.path.join(output_dir, f) for f in os.listdir(output_dir) if f.startswith("rtp_visualization") and f.endswith(".png")]
35
+ sequence_diagrams = [os.path.join(output_dir, f) for f in os.listdir(output_dir) if f.startswith("sip_sequence") and f.endswith(".png")]
36
  dashboard = os.path.join(output_dir, "call_quality_dashboard.png")
37
 
38
+ return result_text, html_report_path, sequence_diagrams, rtp_graphs, dashboard
39
 
40
  with gr.Blocks(title="SIP & RTP PCAP Analyzer") as demo:
41
  gr.Markdown("""
 
48
 
49
  result_text = gr.Textbox(label="Analysis Summary", lines=15)
50
  html_report = gr.File(label="Download HTML Report")
51
+ sequence_images = gr.Gallery(label="SIP Sequence Diagrams")
52
+ rtp_images = gr.Gallery(label="RTP Stream Visualizations")
53
  dashboard_image = gr.Image(label="Call Quality Dashboard")
54
 
55
  run_btn.click(