RepNet-Pytorch icon indicating copy to clipboard operation
RepNet-Pytorch copied to clipboard

synthetic dataset repFrames length is 0

Open qrsforever opened this issue 4 years ago • 1 comments

https://github.com/confifu/RepNet-Pytorch/blob/b655b8090132499a29d2f4a595d174ba56ee033f/SyntheticDataset.py#L148

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])

qrsforever avatar Jun 07 '21 07:06 qrsforever

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

confifu avatar Jun 07 '21 15:06 confifu