History

Fix python3 format issue

Jerome Jiang committed 7 years ago

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

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
2222 self.name = 'ground truth'
2323 super(GroundTruth, self).__init__(cur_f, ref_f, blk_sz)
2424 self.mask = np.zeros((self.num_row, self.num_col), dtype=np.bool)
25− if not gt_path is None:
25+ if gt_path:
2626 with open(gt_path) as gt_file:
2727 lines = gt_file.readlines()
2828 for i in xrange(len(lines)):
tools/3D-Reconstruction/MotionEST/MotionEST.py+3−3
@@ -67,7 +67,7 @@ class MotionEST(object): · 66 unmodified lines
6767 count = 0
6868 for i in xrange(self.num_row):
6969 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]:
7171 continue
7272 loss += self.block_dist(i, j, self.mf[i, j], metric)
7373 count += 1
@@ -82,7 +82,7 @@ class MotionEST(object): · 8 unmodified lines
8282 mask = ground_truth.mask
8383 for i in xrange(self.num_row):
8484 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]:
8686 continue
8787 loss += LA.norm(gt[i, j] - self.mf[i, j])
8888 count += 1
@@ -101,7 +101,7 @@ class MotionEST(object): · 12 unmodified lines
101101 plt.subplot(1, n_row, 1)
102102 plt.imshow(cur_mf)
103103 plt.title('Estimated Motion Field')
104− if not ground_truth is None:
104+ if ground_truth is not None:
105105 plt.subplot(1, n_row, 2)
106106 plt.imshow(gt_mf)
107107 plt.title('Ground Truth')
tools/3D-Reconstruction/genY4M/genY4M.py+1−1
@@ -57,7 +57,7 @@ if __name__ == "__main__": · 56 unmodified lines
5757 else:
5858 frames.append((idx, img))
5959 if len(frames) == 0:
60− print "No frames in directory: " + args.frame_path
60+ print("No frames in directory: " + args.frame_path)
6161 sys.exit()
6262 print("----------------------Y4M Info----------------------")
6363 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