Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,8 +36,10 @@ def doo(video):
|
|
| 36 |
|
| 37 |
# Release GPU memory after processing a certain number of frames
|
| 38 |
if processed_frames % 100 == 0:
|
|
|
|
| 39 |
del out # Delete the variable holding the processed frame
|
| 40 |
gc.collect() # Perform manual garbage collection to release GPU memory
|
|
|
|
| 41 |
|
| 42 |
cap.release()
|
| 43 |
writer.release()
|
|
|
|
| 36 |
|
| 37 |
# Release GPU memory after processing a certain number of frames
|
| 38 |
if processed_frames % 100 == 0:
|
| 39 |
+
processed_frames = 0
|
| 40 |
del out # Delete the variable holding the processed frame
|
| 41 |
gc.collect() # Perform manual garbage collection to release GPU memory
|
| 42 |
+
print("Memory reset")
|
| 43 |
|
| 44 |
cap.release()
|
| 45 |
writer.release()
|