| 45 | exit(1) |
| 46 | |
| 47 | def setup_window(self): |
| 48 | cv2.namedWindow(self.window_name, cv2.WINDOW_NORMAL) |
| 49 | if self.is_video_file: |
| 50 | frame_count = int(self.vid_capture.get(cv2.CAP_PROP_FRAME_COUNT)) |
| 51 | cv2.createTrackbar('frame', self.window_name, 0, frame_count, self.update_frame_num) |
| 52 | cv2.createTrackbar('conf', self.window_name, int(self.conf * 100), 100, self.update_conf) |
| 53 | cv2.createTrackbar('imgsz', self.window_name, int((self.imgsz-self.imgsz_min)/32), int((self.imgsz_max-self.imgsz_min)/32), self.update_imgsz) |
| 54 | cv2.createTrackbar('iou', self.window_name, int(self.iou * 100 / 5), 20, self.update_iou) |
| 55 | |
| 56 | def update(self): |
| 57 | if self.is_video_file: |