Skip to content

Commit

Permalink
Update video_classification.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jonafeucht committed Jun 12, 2024
1 parent 43922c4 commit 4ec45a1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/routes/api/video_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ async def video_classification(
except Exception as e:
return {"error": e}

finally:
tf.close()
os.remove(tf.name)
del classifier
torch.cuda.empty_cache()

return totalResults

except Exception as e:
print("File is not a valid image.")
return {"error": str(e)}

finally:
tf.close()
os.remove(tf.name)
del classifier
torch.cuda.empty_cache()

0 comments on commit 4ec45a1

Please sign in to comment.