NyanSwanAung23 commited on
Commit
2b133a1
·
1 Parent(s): 02f8159

change vid writer for mp4

Browse files
Files changed (2) hide show
  1. app.py +3 -2
  2. classifier.py +1 -1
app.py CHANGED
@@ -67,9 +67,10 @@ with gr.Blocks() as demo:
67
  video_out = gr.Video(format='mp4')
68
 
69
  run_btn = gr.Button("Predict")
70
- run_btn.click(fn=predict, inputs=[video_in], outputs=[video_out])
 
71
  gr.Examples(fn=predict, examples=video_examples, inputs=[
72
- video_in], outputs=[video_out])
73
 
74
  with gr.Tab("Image"):
75
  with gr.Row():
 
67
  video_out = gr.Video(format='mp4')
68
 
69
  run_btn = gr.Button("Predict")
70
+ pred_tbox = gr.Textbox(label="Prediction Time")
71
+ run_btn.click(fn=predict, inputs=[video_in], outputs=[video_out, pred_tbox])
72
  gr.Examples(fn=predict, examples=video_examples, inputs=[
73
+ video_in], outputs=[video_out, pred_tbox])
74
 
75
  with gr.Tab("Image"):
76
  with gr.Row():
classifier.py CHANGED
@@ -64,7 +64,7 @@ class Classifier:
64
  fps = int(cap.get(5))
65
 
66
  # Define the codec and create a VideoWriter object to save the output video as .MOV
67
- fourcc = cv2.VideoWriter_fourcc('a', 'v', 'c', '1')
68
  out = cv2.VideoWriter(self.output_path, fourcc, fps,
69
  (frame_width, frame_height))
70
 
 
64
  fps = int(cap.get(5))
65
 
66
  # Define the codec and create a VideoWriter object to save the output video as .MOV
67
+ fourcc = cv2.VideoWriter_fourcc(*'MP4V')
68
  out = cv2.VideoWriter(self.output_path, fourcc, fps,
69
  (frame_width, frame_height))
70