RepNet-Pytorch
RepNet-Pytorch copied to clipboard
synthetic dataset repFrames length is 0
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])
I think replacing -endNoRepDur with begNoRepDur+clipDur will fix this.