doublelotus commited on
Commit
dce6539
·
1 Parent(s): b026005

clearing cache

Browse files
Files changed (1) hide show
  1. main.py +7 -0
main.py CHANGED
@@ -58,7 +58,14 @@ def get_masks():
58
  if image is None:
59
  raise ValueError("Image not found or unable to read.")
60
 
 
 
 
61
  masks = mask_generator.generate(image)
 
 
 
 
62
  masks = sorted(masks, key=(lambda x: x['area']), reverse=True)
63
 
64
  def is_background(segmentation):
 
58
  if image is None:
59
  raise ValueError("Image not found or unable to read.")
60
 
61
+ if cudaOrNah == "cuda":
62
+ torch.cuda.empty_cache()
63
+
64
  masks = mask_generator.generate(image)
65
+
66
+ if cudaOrNah == "cuda":
67
+ torch.cuda.empty_cache()
68
+
69
  masks = sorted(masks, key=(lambda x: x['area']), reverse=True)
70
 
71
  def is_background(segmentation):