Naveenkumar1546 commited on
Commit
bd773c7
·
verified ·
1 Parent(s): 6d9524c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -49,16 +49,14 @@ def detect_faults(frame, results, frame_idx, fps):
49
  continue
50
 
51
  timestamp = round(frame_idx / fps, 2)
52
- faults_found.append({
53
- "Frame": frame_idx,
54
- "Time (s)": timestamp,
55
- "Fault Type": label,
56
- "Confidence": round(float(box.conf[0]), 2) if box.conf is not None else None,
57
- "Intensity": round(mean_intensity, 2),
58
- "Box": f"({x1}, {y1}, {x2}, {y2})"
59
- "Fault Type": label,
60
- "X1": x1, "Y1": y1, "X2": x2, "Y2": y2
61
- })
62
 
63
  cv2.rectangle(annotated_frame, (x1, y1), (x2, y2), color, 2)
64
  cv2.putText(annotated_frame, label, (x1, y1 - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.5, color, 2)
 
49
  continue
50
 
51
  timestamp = round(frame_idx / fps, 2)
52
+ faults_found.append({
53
+ "Frame": frame_idx,
54
+ "Fault Type": label,
55
+ "Confidence": round(float(box.conf[0]), 2) if box.conf is not None else None,
56
+ "Intensity": round(mean_intensity, 2),
57
+ "Box": f"({x1}, {y1}, {x2}, {y2})"
58
+ })
59
+
 
 
60
 
61
  cv2.rectangle(annotated_frame, (x1, y1), (x2, y2), color, 2)
62
  cv2.putText(annotated_frame, label, (x1, y1 - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.5, color, 2)