MCPcopy
hub / github.com/facefusion/facefusion / apply_args

Function apply_args

facefusion/args.py:10–86  ·  view source on GitHub ↗
(args : Args, apply_state_item : ApplyStateItem)

Source from the content-addressed store, hash-verified

8
9
10def apply_args(args : Args, apply_state_item : ApplyStateItem) -> None:
11 apply_state_item('command', args.get('command'))
12 apply_state_item('temp_path', args.get('temp_path'))
13 apply_state_item('jobs_path', args.get('jobs_path'))
14 apply_state_item('source_paths', args.get('source_paths'))
15 apply_state_item('target_path', args.get('target_path'))
16 apply_state_item('output_path', args.get('output_path'))
17 apply_state_item('source_pattern', args.get('source_pattern'))
18 apply_state_item('target_pattern', args.get('target_pattern'))
19 apply_state_item('output_pattern', args.get('output_pattern'))
20 apply_state_item('face_detector_model', args.get('face_detector_model'))
21 apply_state_item('face_detector_size', args.get('face_detector_size'))
22 apply_state_item('face_detector_margin', normalize_space(args.get('face_detector_margin')))
23 apply_state_item('face_detector_angles', args.get('face_detector_angles'))
24 apply_state_item('face_detector_score', args.get('face_detector_score'))
25 apply_state_item('face_landmarker_model', args.get('face_landmarker_model'))
26 apply_state_item('face_landmarker_score', args.get('face_landmarker_score'))
27 apply_state_item('face_selector_mode', args.get('face_selector_mode'))
28 apply_state_item('face_selector_order', args.get('face_selector_order'))
29 apply_state_item('face_selector_age_start', args.get('face_selector_age_start'))
30 apply_state_item('face_selector_age_end', args.get('face_selector_age_end'))
31 apply_state_item('face_selector_gender', args.get('face_selector_gender'))
32 apply_state_item('face_selector_race', args.get('face_selector_race'))
33 apply_state_item('reference_face_position', args.get('reference_face_position'))
34 apply_state_item('reference_face_distance', args.get('reference_face_distance'))
35 apply_state_item('reference_frame_number', args.get('reference_frame_number'))
36 apply_state_item('face_tracker_score', args.get('face_tracker_score'))
37 apply_state_item('face_occluder_model', args.get('face_occluder_model'))
38 apply_state_item('face_parser_model', args.get('face_parser_model'))
39 apply_state_item('face_mask_types', args.get('face_mask_types'))
40 apply_state_item('face_mask_areas', args.get('face_mask_areas'))
41 apply_state_item('face_mask_regions', args.get('face_mask_regions'))
42 apply_state_item('face_mask_blur', args.get('face_mask_blur'))
43 apply_state_item('face_mask_padding', normalize_space(args.get('face_mask_padding')))
44 apply_state_item('voice_extractor_model', args.get('voice_extractor_model'))
45 apply_state_item('trim_frame_start', args.get('trim_frame_start'))
46 apply_state_item('trim_frame_end', args.get('trim_frame_end'))
47 apply_state_item('temp_frame_format', args.get('temp_frame_format'))
48 apply_state_item('keep_temp', args.get('keep_temp'))
49 apply_state_item('target_frame_amount', args.get('target_frame_amount'))
50 apply_state_item('output_image_quality', args.get('output_image_quality'))
51 apply_state_item('output_image_scale', args.get('output_image_scale'))
52 apply_state_item('output_audio_encoder', args.get('output_audio_encoder'))
53 apply_state_item('output_audio_quality', args.get('output_audio_quality'))
54 apply_state_item('output_audio_volume', args.get('output_audio_volume'))
55 apply_state_item('output_video_encoder', args.get('output_video_encoder'))
56 apply_state_item('output_video_preset', args.get('output_video_preset'))
57 apply_state_item('output_video_quality', args.get('output_video_quality'))
58 apply_state_item('output_video_scale', args.get('output_video_scale'))
59
60 if args.get('output_video_fps') or is_video(args.get('target_path')):
61 output_video_fps = normalize_fps(args.get('output_video_fps')) or detect_video_fps(args.get('target_path'))
62 apply_state_item('output_video_fps', output_video_fps)
63
64 available_processors = [ get_file_name(file_path) for file_path in resolve_file_paths('facefusion/processors/modules') ]
65 apply_state_item('processors', args.get('processors'))
66
67 for processor_module in get_processors_modules(available_processors):

Callers 2

cliFunction · 0.90
process_stepFunction · 0.90

Calls 7

normalize_spaceFunction · 0.90
is_videoFunction · 0.90
normalize_fpsFunction · 0.90
detect_video_fpsFunction · 0.90
get_file_nameFunction · 0.90
resolve_file_pathsFunction · 0.90
get_processors_modulesFunction · 0.90

Tested by

no test coverage detected