Skip to content

Commit

Permalink
chore: remove the file after the operation has ended
Browse files Browse the repository at this point in the history
Signed-off-by: Snehil Shah <[email protected]>
  • Loading branch information
Snehil-Shah committed Aug 8, 2024
1 parent 8874ce5 commit 4a384f5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/operators/vid_vec_rep_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def initialize(param):
param (dict): Parameters for initialization
"""
print("Installing packages for vid_vec_rep_clip")
global os
global VideoAnalyzer, gendata

# Imports
Expand Down Expand Up @@ -147,8 +148,11 @@ def run(file):
generator: Yields video and I-frame vector representations
"""
fname = file["path"]
vid_analyzer = VideoAnalyzer(fname)
return gendata(vid_analyzer)
try:
vid_analyzer = VideoAnalyzer(fname)
return gendata(vid_analyzer)
finally:
os.remove(fname)

def cleanup(param):
pass
Expand Down

0 comments on commit 4a384f5

Please sign in to comment.