confifu/RepNet-Pytorch

synthetic dataset repFrames length is 0

Opened this issue · 1 comments

repFrames = frames[begNoRepDur : -endNoRepDur]

SyntheticDataset.py: 125 - 149

begNoRepDur value is noRepDur ---> endNoRepDur == 0 ---> repFrames = frames[begNoRepDur : -0] ---> repFrames length is 0

        begNoRepDur = randint(0,  noRepDur)
        endNoRepDur = noRepDur - begNoRepDur
        totalDur = noRepDur + repDur
            
        startFrame = randint(0, total - (clipDur + noRepDur))
        cap.set(cv2.CAP_PROP_POS_FRAMES, startFrame)
        
        frames = []
        while cap.isOpened():
            ret, frame = cap.read()
            if ret is False or len(frames) == clipDur + noRepDur:
                break
            frame = cv2.resize(frame , (112, 112), interpolation = cv2.INTER_AREA)
            frames.append(frame)
        
        cap.release()
        
        
        numBegNoRepFrames = begNoRepDur*64//totalDur
        periodLength = np.zeros((64, 1))
        begNoRepFrames = self.getNFrames(frames[:begNoRepDur], numBegNoRepFrames)
        finalFrames = begNoRepFrames
        
        repFrames = frames[begNoRepDur : -endNoRepDur]
        repFrames.extend(repFrames[::-1])

I think replacing -endNoRepDur with begNoRepDur+clipDur will fix this.