mirror of
https://github.com/YaoFANGUK/video-subtitle-remover.git
synced 2026-06-17 09:53:29 +08:00
minor
This commit is contained in:
@@ -774,8 +774,11 @@ class SubtitleRemover:
|
|||||||
sub_list = self.sub_detector.find_subtitle_frame_no(sub_remover=self)
|
sub_list = self.sub_detector.find_subtitle_frame_no(sub_remover=self)
|
||||||
self.lama_inpaint = LamaInpaint()
|
self.lama_inpaint = LamaInpaint()
|
||||||
original_frame = cv2.imread(self.video_path)
|
original_frame = cv2.imread(self.video_path)
|
||||||
mask = create_mask(original_frame.shape[0:2], sub_list[1])
|
if len(sub_list):
|
||||||
inpainted_frame = self.lama_inpaint(original_frame, mask)
|
mask = create_mask(original_frame.shape[0:2], sub_list[1])
|
||||||
|
inpainted_frame = self.lama_inpaint(original_frame, mask)
|
||||||
|
else:
|
||||||
|
inpainted_frame = original_frame
|
||||||
if self.gui_mode:
|
if self.gui_mode:
|
||||||
self.preview_frame = cv2.hconcat([original_frame, inpainted_frame])
|
self.preview_frame = cv2.hconcat([original_frame, inpainted_frame])
|
||||||
cv2.imencode(self.ext, inpainted_frame)[1].tofile(self.video_out_name)
|
cv2.imencode(self.ext, inpainted_frame)[1].tofile(self.video_out_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user