Browse Source

added torch.cuda.empty_cache()

client-connection
s_kiani 1 month ago
parent
commit
c13e231bec
  1. 2
      core.py
  2. 1
      tracker/pytracking/tracker/dimp/dimp.py

2
core.py

@ -5,6 +5,7 @@ from threading import Event, Thread
from typing import List
import numpy as np
import torch
from PyQt5.QtCore import QThread, pyqtSlot, pyqtSignal, QUrl, QDir, pyqtProperty
#from icecream import ic
@ -60,6 +61,7 @@ class Core(QThread):
def __detection(self):
while self.__is_detecting:
try:
torch.cuda.empty_cache()
source = self.__processing_source
roi = self.__detection_roi
frame = source.get_frame()

1
tracker/pytracking/tracker/dimp/dimp.py

@ -65,6 +65,7 @@ class DiMP():
def track(self, image) -> dict:
torch.cuda.empty_cache()
# Convert image
im = numpy_to_torch(image)

Loading…
Cancel
Save