Disable stream for expression restorer

This commit is contained in:
henryruhs 2024-10-11 00:38:30 +02:00
parent 0e4f69ce56
commit 8ef133ace9
2 changed files with 5 additions and 1 deletions

View File

@ -108,6 +108,9 @@ def pre_check() -> bool:
def pre_process(mode : ProcessMode) -> bool:
if mode == 'stream':
logger.error(wording.get('stream_not_supported') + wording.get('exclamation_mark'), __name__)
return False
if mode in [ 'output', 'preview' ] and not is_image(state_manager.get_item('target_path')) and not is_video(state_manager.get_item('target_path')):
logger.error(wording.get('choose_image_or_video_target') + wording.get('exclamation_mark'), __name__)
return False
@ -222,7 +225,7 @@ def prepare_crop_frame(crop_vision_frame : VisionFrame) -> VisionFrame:
def normalize_crop_frame(crop_vision_frame : VisionFrame) -> VisionFrame:
crop_vision_frame = crop_vision_frame.transpose(1, 2, 0).clip(0, 1)
crop_vision_frame = (crop_vision_frame * 255.0)
crop_vision_frame = crop_vision_frame * 255.0
crop_vision_frame = crop_vision_frame.astype(numpy.uint8)[:, :, ::-1]
return crop_vision_frame

View File

@ -46,6 +46,7 @@ WORDING : Dict[str, Any] =\
'ui_layout_not_loaded': 'UI layout {ui_layout} could not be loaded',
'ui_layout_not_implemented': 'UI layout {ui_layout} not implemented correctly',
'stream_not_loaded': 'Stream {stream_mode} could not be loaded',
'stream_not_supported': 'Stream not supported',
'job_created': 'Job {job_id} created',
'job_not_created': 'Job {job_id} not created',
'job_submitted': 'Job {job_id} submitted',