From 352f67e27aee12c399200493084bfe3b74ade6bc Mon Sep 17 00:00:00 2001 From: saurabh Date: Wed, 25 Mar 2020 19:13:47 +0530 Subject: [PATCH] annotation bug fix cont.. --- common/videoRecorder.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/videoRecorder.py b/common/videoRecorder.py index 0ffa289..9c9cb59 100644 --- a/common/videoRecorder.py +++ b/common/videoRecorder.py @@ -78,9 +78,10 @@ def write(self, imgcv, annotations = None): # Start new recording datestr = datetime.now().strftime("%d-%m-%y-%H%M%S") self.vname = self.filename_pattern.format(datestr) - self.aname=self.filename_pattern_annotations.format(datestr) - logger.info('Annotations file created - %s', self.aname) - self.writeAnnotationHeader() + if self.annotations: + self.aname=self.filename_pattern_annotations.format(datestr) + logger.info('Annotations file created - %s', self.aname) + self.writeAnnotationHeader() self.videow = cv2.VideoWriter(self.vname, self.fourcc, int(self.fps), self.frameSize) logger.info('Video Saved - %s', self.vname) # Frame Count and fps calculation variable init