Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. def computeOpticalFlows(self, targetRgb, sourceRgbs):
  2. print(sourceRgbs.shape)
  3. MB, seqSize, _, height, width = sourceRgbs.shape
  4. firstResult = self.opticalFlowNet(targetRgb, sourceRgbs[:, 0])
  5. results = [tr.zeros(MB, seqSize, 2, h, w).to(device) for (h, w) in map(lambda x : x.shape[2 : 4], firstResult)]
  6. for scaleIx in range(len(results)):
  7. results[scaleIx][:, 0] = firstResult[scaleIx]
  8.  
  9. for i in range(1, seqSize):
  10. res = self.opticalFlowNet(targetRgb, sourceRgbs[:, i])
  11. for scaleIx in range(len(results)):
  12. results[scaleIx][:, i] = res[scaleIx]
  13. return results
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement