Skip to content

Commit

Permalink
fix: suppress mypy error
Browse files Browse the repository at this point in the history
  • Loading branch information
HiroIshida committed Jul 23, 2023
1 parent 046e082 commit 4b7fcb2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mohou/model/third_party/variational_lstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _setweights(self):

mask = torch.autograd.Variable(torch.ones(raw_w.size(0), 1))
if raw_w.is_cuda:
mask = mask.cuda()
mask = mask.cuda() # type: ignore[assignment]
mask = dropout(mask, p=self.dropout, training=True) # type: ignore
w = mask.expand_as(raw_w) * raw_w
setattr(self.module, name_w, w)
Expand Down
2 changes: 1 addition & 1 deletion mohou/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def extract_contour_by_laplacian(
blur_kernel_size = (int(rgb.shape[0] * 0.02), int(rgb.shape[1] * 0.02))

src_gray = cv2.cvtColor(rgb.numpy(), cv2.COLOR_BGR2GRAY)
dst = cv2.Laplacian(src_gray, cv2.CV_8U, ksize=laplace_kernel_size)
dst = cv2.Laplacian(src_gray, cv2.CV_8U, ksize=laplace_kernel_size) # type: ignore[attr-defined]
dst2 = cv2.blur(dst, (blur_kernel_size[0], blur_kernel_size[1]))
return GrayImage(np.expand_dims(np.uint8(dst2), axis=2))

Expand Down

0 comments on commit 4b7fcb2

Please sign in to comment.