Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -93,6 +93,7 @@ def generate_line_chart() -> Optional[str]:
|
|
93 |
plt.close()
|
94 |
return chart_path
|
95 |
|
|
|
96 |
def process_video(video, resize_width=320, resize_height=240, frame_skip=5):
|
97 |
global frame_count, last_metrics, detected_counts, detected_issues, gps_coordinates, log_entries
|
98 |
frame_count = 0
|
@@ -160,7 +161,7 @@ def process_video(video, resize_width=320, resize_height=240, frame_skip=5):
|
|
160 |
if frame_count % frame_skip != 0:
|
161 |
continue
|
162 |
processed_frames += 1
|
163 |
-
|
164 |
|
165 |
frame = cv2.resize(frame, (out_width, out_height))
|
166 |
results = model(frame, verbose=False, conf=0.5, iou=0.7)
|
@@ -271,7 +272,6 @@ def process_video(video, resize_width=320, resize_height=240, frame_skip=5):
|
|
271 |
chart_path,
|
272 |
map_path
|
273 |
)
|
274 |
-
|
275 |
# Gradio interface
|
276 |
with gr.Blocks(theme=gr.themes.Soft(primary_hue="orange")) as iface:
|
277 |
gr.Markdown("# Road Defect Detection Dashboard")
|
|
|
93 |
plt.close()
|
94 |
return chart_path
|
95 |
|
96 |
+
|
97 |
def process_video(video, resize_width=320, resize_height=240, frame_skip=5):
|
98 |
global frame_count, last_metrics, detected_counts, detected_issues, gps_coordinates, log_entries
|
99 |
frame_count = 0
|
|
|
161 |
if frame_count % frame_skip != 0:
|
162 |
continue
|
163 |
processed_frames += 1
|
164 |
+
frame_start = time.time()
|
165 |
|
166 |
frame = cv2.resize(frame, (out_width, out_height))
|
167 |
results = model(frame, verbose=False, conf=0.5, iou=0.7)
|
|
|
272 |
chart_path,
|
273 |
map_path
|
274 |
)
|
|
|
275 |
# Gradio interface
|
276 |
with gr.Blocks(theme=gr.themes.Soft(primary_hue="orange")) as iface:
|
277 |
gr.Markdown("# Road Defect Detection Dashboard")
|