Update
This commit is contained in:
parent
5c3106935d
commit
0adf8c0841
@ -7,6 +7,9 @@ import logging
|
|||||||
import platform
|
import platform
|
||||||
import math
|
import math
|
||||||
|
|
||||||
|
import os
|
||||||
|
import psutil
|
||||||
|
|
||||||
logging.basicConfig(level='INFO')
|
logging.basicConfig(level='INFO')
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@ -51,6 +54,10 @@ class VideoStream:
|
|||||||
def update(self):
|
def update(self):
|
||||||
while self.running:
|
while self.running:
|
||||||
success, frame = self.stream.read()
|
success, frame = self.stream.read()
|
||||||
|
if not success:
|
||||||
|
current_system_pid = os.getpid()
|
||||||
|
ThisSystem = psutil.Process(current_system_pid)
|
||||||
|
ThisSystem.terminate()
|
||||||
assert success
|
assert success
|
||||||
self.buffer = frame
|
self.buffer = frame
|
||||||
self.stream.release()
|
self.stream.release()
|
||||||
|
|||||||
@ -6,6 +6,8 @@ import sys
|
|||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
from queue import Queue
|
from queue import Queue
|
||||||
|
import os
|
||||||
|
import psutil
|
||||||
|
|
||||||
import flask
|
import flask
|
||||||
from flask import jsonify, request
|
from flask import jsonify, request
|
||||||
|
|||||||
@ -7,6 +7,9 @@ import platform
|
|||||||
import math
|
import math
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
import os
|
||||||
|
import psutil
|
||||||
|
|
||||||
logging.basicConfig(level='DEBUG')
|
logging.basicConfig(level='DEBUG')
|
||||||
|
|
||||||
class CUDA:
|
class CUDA:
|
||||||
@ -54,6 +57,10 @@ class VideoStream:
|
|||||||
def update(self):
|
def update(self):
|
||||||
while self.running:
|
while self.running:
|
||||||
success, frame = self.stream.read()
|
success, frame = self.stream.read()
|
||||||
|
if not success:
|
||||||
|
current_system_pid = os.getpid()
|
||||||
|
ThisSystem = psutil.Process(current_system_pid)
|
||||||
|
ThisSystem.terminate()
|
||||||
assert success
|
assert success
|
||||||
self.buffer = frame
|
self.buffer = frame
|
||||||
self.stream.release()
|
self.stream.release()
|
||||||
|
|||||||
@ -5,6 +5,9 @@ import platform
|
|||||||
import time
|
import time
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
import os
|
||||||
|
import psutil
|
||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
|
|
||||||
import apriltag_detector
|
import apriltag_detector
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user