hb-setosys commited on
Commit
5f1292c
·
verified ·
1 Parent(s): ab003fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -30,7 +30,7 @@ TIME_INTERVALS = {
30
  "city": 8, # City road footage
31
  }
32
 
33
- def determine_time_interval(video_filename):
34
  """
35
  Determines the time interval based on keywords found in the video filename.
36
  Defaults to 7 seconds if no matching keyword is found.
@@ -40,6 +40,15 @@ def determine_time_interval(video_filename):
40
  return interval
41
  return 5 # Default interval if no keyword matches
42
 
 
 
 
 
 
 
 
 
 
43
 
44
  def count_unique_trucks(video_path):
45
  cap = cv2.VideoCapture(video_path)
 
30
  "city": 8, # City road footage
31
  }
32
 
33
+ def old_determine_time_interval(video_filename):
34
  """
35
  Determines the time interval based on keywords found in the video filename.
36
  Defaults to 7 seconds if no matching keyword is found.
 
40
  return interval
41
  return 5 # Default interval if no keyword matches
42
 
43
+ def determine_time_interval(video_filename):
44
+ print(f"Checking filename: {video_filename}") # Debugging
45
+ for keyword, interval in TIME_INTERVALS.items():
46
+ if keyword in video_filename:
47
+ print(f"Matched keyword: {keyword} -> Interval: {interval}") # Debugging
48
+ return interval
49
+ print("No keyword match, using default interval: 5") # Debugging
50
+ return 5 # Default interval if no keyword matches
51
+
52
 
53
  def count_unique_trucks(video_path):
54
  cap = cv2.VideoCapture(video_path)