use try except block even if the image is missing, the program should not crash: class…
Jump to turn (6)
- 1use try except block even if the image is missing, the program should not crash:
- 2rtsp link crashes the program.use try except for rtsp streamShare Prompt
- 3the rtsp can be connected but frames are mShare Prompt
- 4rtsp can be connected and if the frames are missing, then the program should not
- 5rtsp stream is at 1920\1080, how to reduce it so that the program is not crashin
- 6rtsp at 1920\1080 stream causes cv2 to crash since rtsp stream at high resolutio
- User
use try except block even if the image is missing, the program should not crash: class inferThread(threading.Thread): def __init__(self, yolov7_wrapper): threading.Thread.__init__(self) self.yolov7_wrapper = yolov7_wrapper self.cap = cv2.VideoCapture('rtsp://admin:Dats$123@192.168.2.241/Streaming/Channels/101/') self.fps=0 #self.YoLov7TRT=YoLov7TRT
HH
def run(self): while(True): ret, frame = self.cap.read() start_time=time.time() ################# img = cv2.resize(frame, (640, 480)) ###[:,240:1680] result, use_time,result_classid= self.yolov7_wrapper.infer(img) self.fps = 1.0 / (time.time() - start_time) cv2.imshow("Recognition result", result) #####################
img_class = self.yolo7_trt.img_class
img_class = self.YoLov7TRT.img_class
#if YoLov7TRT.non_max_suppression.img_class==1: if 1 in result_classid:
#if self.YoLov7TRT.img_class == 1:
encode_param = [int(cv2.IMWRITE_JPEG_QUALITY), 90]
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.