rachana219 commited on
Commit
9dc1e33
·
1 Parent(s): 3a78219

updated track.py to delete the old output.mp4 file

Browse files
Files changed (1) hide show
  1. track.py +3 -1
track.py CHANGED
@@ -390,8 +390,10 @@ def MOT(yoloweights, trackingmethod, sourceVideo):
390
  save_dir = increment_path('exp', exist_ok=True)
391
  input = os.path.join(save_dir,'out.mp4')
392
  outpath = 'output.mp4' #'output/'+ 'output.mp4'
 
 
 
393
  command = f"ffmpeg -i {input} -vf fps=30 -vcodec libx264 {outpath}"
394
  print(command)
395
  os.system(command)
396
- #!ffmpeg -i $input -vf fps=30 -vcodec libx264 $outpath tbd
397
  return outpath
 
390
  save_dir = increment_path('exp', exist_ok=True)
391
  input = os.path.join(save_dir,'out.mp4')
392
  outpath = 'output.mp4' #'output/'+ 'output.mp4'
393
+ if os.path.exists(outpath):
394
+ os.remove(outpath)
395
+
396
  command = f"ffmpeg -i {input} -vf fps=30 -vcodec libx264 {outpath}"
397
  print(command)
398
  os.system(command)
 
399
  return outpath