yonigozlan HF staff commited on
Commit
65082b9
·
1 Parent(s): 82b4cf3

update name of segment file

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -36,11 +36,6 @@ LABEL_ANNOTATOR = sv.LabelAnnotator()
36
  SUBSAMPLE = 2
37
 
38
 
39
- def calculate_end_frame_index(source_video_path):
40
- video_info = sv.VideoInfo.from_video_path(source_video_path)
41
- return min(video_info.total_frames, video_info.fps * 5)
42
-
43
-
44
  def annotate_image(input_image, detections, labels) -> np.ndarray:
45
  output_image = MASK_ANNOTATOR.annotate(input_image, detections)
46
  output_image = BOUNDING_BOX_ANNOTATOR.annotate(output_image, detections)
@@ -119,6 +114,7 @@ def process_video(
119
  visible=True,
120
  ),
121
  )
 
122
  segment_file = cv2.VideoWriter(
123
  result_file_name, video_codec, desired_fps, (width, height)
124
  ) # type: ignore
 
36
  SUBSAMPLE = 2
37
 
38
 
 
 
 
 
 
39
  def annotate_image(input_image, detections, labels) -> np.ndarray:
40
  output_image = MASK_ANNOTATOR.annotate(input_image, detections)
41
  output_image = BOUNDING_BOX_ANNOTATOR.annotate(output_image, detections)
 
114
  visible=True,
115
  ),
116
  )
117
+ result_file_name = f"output_{uuid.uuid4()}.mp4"
118
  segment_file = cv2.VideoWriter(
119
  result_file_name, video_codec, desired_fps, (width, height)
120
  ) # type: ignore