History

Fix python3 format issue

Jerome Jiang committed 7 years ago

Commit 97cd0bd1 parent 4f69df93 files · +5 −5Browse files

Showing the changes to tools (3 of 3 files). Show all

Unified · Split

3 files
  1. tools/3D-Reconstruction/MotionEST/GroundTruth.py +1 −1
  2. tools/3D-Reconstruction/MotionEST/MotionEST.py +3 −3
  3. tools/3D-Reconstruction/genY4M/genY4M.py +1 −1
tools/3D-Reconstruction/MotionEST/GroundTruth.py+1−1
@@ -22,7 +22,7 @@ class GroundTruth(MotionEST): · 21 unmodified lines
22 self.name = 'ground truth'22 self.name = 'ground truth'
23 super(GroundTruth, self).__init__(cur_f, ref_f, blk_sz)23 super(GroundTruth, self).__init__(cur_f, ref_f, blk_sz)
24 self.mask = np.zeros((self.num_row, self.num_col), dtype=np.bool)24 self.mask = np.zeros((self.num_row, self.num_col), dtype=np.bool)
25 if not gt_path is None:25 if gt_path:
26 with open(gt_path) as gt_file:26 with open(gt_path) as gt_file:
27 lines = gt_file.readlines()27 lines = gt_file.readlines()
28 for i in xrange(len(lines)):28 for i in xrange(len(lines)):
tools/3D-Reconstruction/MotionEST/MotionEST.py+3−3
@@ -67,7 +67,7 @@ class MotionEST(object): · 66 unmodified lines
67 count = 067 count = 0
68 for i in xrange(self.num_row):68 for i in xrange(self.num_row):
69 for j in xrange(self.num_col):69 for j in xrange(self.num_col):
70 if not mask is None and mask[i, j]:70 if mask is not None and mask[i, j]:
71 continue71 continue
72 loss += self.block_dist(i, j, self.mf[i, j], metric)72 loss += self.block_dist(i, j, self.mf[i, j], metric)
73 count += 173 count += 1
@@ -82,7 +82,7 @@ class MotionEST(object): · 8 unmodified lines
82 mask = ground_truth.mask82 mask = ground_truth.mask
83 for i in xrange(self.num_row):83 for i in xrange(self.num_row):
84 for j in xrange(self.num_col):84 for j in xrange(self.num_col):
85 if not mask is None and mask[i][j]:85 if mask is not None and mask[i][j]:
86 continue86 continue
87 loss += LA.norm(gt[i, j] - self.mf[i, j])87 loss += LA.norm(gt[i, j] - self.mf[i, j])
88 count += 188 count += 1
@@ -101,7 +101,7 @@ class MotionEST(object): · 12 unmodified lines
101 plt.subplot(1, n_row, 1)101 plt.subplot(1, n_row, 1)
102 plt.imshow(cur_mf)102 plt.imshow(cur_mf)
103 plt.title('Estimated Motion Field')103 plt.title('Estimated Motion Field')
104 if not ground_truth is None:104 if ground_truth is not None:
105 plt.subplot(1, n_row, 2)105 plt.subplot(1, n_row, 2)
106 plt.imshow(gt_mf)106 plt.imshow(gt_mf)
107 plt.title('Ground Truth')107 plt.title('Ground Truth')
tools/3D-Reconstruction/genY4M/genY4M.py+1−1
@@ -57,7 +57,7 @@ if __name__ == "__main__": · 56 unmodified lines
57 else:57 else:
58 frames.append((idx, img))58 frames.append((idx, img))
59 if len(frames) == 0:59 if len(frames) == 0:
60 print "No frames in directory: " + args.frame_path60 print("No frames in directory: " + args.frame_path)
61 sys.exit()61 sys.exit()
62 print("----------------------Y4M Info----------------------")62 print("----------------------Y4M Info----------------------")
63 print("width: %d" % frames[0][1].width)63 print("width: %d" % frames[0][1].width)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t