vmoras commited on
Commit
d11a4d2
1 Parent(s): 9894b14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import os
 
2
  import cv2
3
  import torch
4
  import traceback
@@ -27,6 +28,7 @@ def set_predictor(image):
27
  predictor.set_image(image)
28
 
29
  if device == 'cuda':
 
30
  torch.cuda.empty_cache()
31
 
32
  return [image, predictor, 'Done']
 
1
  import os
2
+ import gc
3
  import cv2
4
  import torch
5
  import traceback
 
28
  predictor.set_image(image)
29
 
30
  if device == 'cuda':
31
+ gc.collect()
32
  torch.cuda.empty_cache()
33
 
34
  return [image, predictor, 'Done']