diff --git a/mohou/model/third_party/variational_lstm.py b/mohou/model/third_party/variational_lstm.py index eb34e1f..3cfcfc0 100644 --- a/mohou/model/third_party/variational_lstm.py +++ b/mohou/model/third_party/variational_lstm.py @@ -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) diff --git a/mohou/types.py b/mohou/types.py index 6ec942c..d591916 100644 --- a/mohou/types.py +++ b/mohou/types.py @@ -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))