PrashanthB461 commited on
Commit
7fb6e3e
·
verified ·
1 Parent(s): 547ffb5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -38,7 +38,7 @@ CONFIG = {
38
  "domain": "login"
39
  },
40
  "PUBLIC_URL_BASE": "https://huggingface.co/spaces/PrashanthB461/AI_Safety_Demo2/resolve/main/static/output/",
41
- "FRAME_SKIP": 15,
42
  "MAX_PROCESSING_TIME": 30,
43
  "CONFIDENCE_THRESHOLD": 0.5
44
  }
@@ -343,13 +343,13 @@ def gradio_interface(video_file):
343
  return
344
 
345
  # Build violation table only if violations exist
346
- header = "| Violation | Timestamp (s) | Confidence | Bounding Box |\n"
347
- separator = "|------------------------|---------------|------------|--------------------------|\n"
348
  rows = []
349
  violation_name_map = CONFIG["DISPLAY_NAMES"]
350
  for v in result["violations"]:
351
  display_name = violation_name_map.get(v["violation"], v["violation"])
352
- row = f"| {display_name:<22} | {v['timestamp']:.2f} | {v['confidence']:.2f} | {v['bounding_box']} |"
353
  rows.append(row)
354
  violation_table = header + separator + "\n".join(rows)
355
 
 
38
  "domain": "login"
39
  },
40
  "PUBLIC_URL_BASE": "https://huggingface.co/spaces/PrashanthB461/AI_Safety_Demo2/resolve/main/static/output/",
41
+ "FRAME_SKIP": 1, # Adjust this to process more frames (set to 1 to process every frame)
42
  "MAX_PROCESSING_TIME": 30,
43
  "CONFIDENCE_THRESHOLD": 0.5
44
  }
 
343
  return
344
 
345
  # Build violation table only if violations exist
346
+ header = "| Violation | Timestamp (s) | Confidence |\n"
347
+ separator = "|------------------------|---------------|------------|\n"
348
  rows = []
349
  violation_name_map = CONFIG["DISPLAY_NAMES"]
350
  for v in result["violations"]:
351
  display_name = violation_name_map.get(v["violation"], v["violation"])
352
+ row = f"| {display_name:<22} | {v['timestamp']:.2f} | {v['confidence']:.2f} |"
353
  rows.append(row)
354
  violation_table = header + separator + "\n".join(rows)
355