| @@ -67,7 +67,7 @@ class MotionEST(object): · 66 unmodified lines |
| 67 | 67 | count = 0 |
| 68 | 68 | for i in xrange(self.num_row): |
| 69 | 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 | 71 | continue |
| 72 | 72 | loss += self.block_dist(i, j, self.mf[i, j], metric) |
| 73 | 73 | count += 1 |
| @@ -82,7 +82,7 @@ class MotionEST(object): · 8 unmodified lines |
| 82 | 82 | mask = ground_truth.mask |
| 83 | 83 | for i in xrange(self.num_row): |
| 84 | 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 | 86 | continue |
| 87 | 87 | loss += LA.norm(gt[i, j] - self.mf[i, j]) |
| 88 | 88 | count += 1 |
| @@ -101,7 +101,7 @@ class MotionEST(object): · 12 unmodified lines |
| 101 | 101 | plt.subplot(1, n_row, 1) |
| 102 | 102 | plt.imshow(cur_mf) |
| 103 | 103 | plt.title('Estimated Motion Field') |
| 104 | | − if not ground_truth is None: |
| 104 | + if ground_truth is not None: |
| 105 | 105 | plt.subplot(1, n_row, 2) |
| 106 | 106 | plt.imshow(gt_mf) |
| 107 | 107 | plt.title('Ground Truth') |