Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Sourcery refactored main branch #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Jul 27, 2023

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from hacksider July 27, 2023 15:29
if has_frame:
return frame
return None
return frame if has_frame else None
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_video_frame refactored with the following changes:

if platform.system().lower() == 'darwin':
return 4
return 16
return 4 if platform.system().lower() == 'darwin' else 16
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function suggest_max_memory refactored with the following changes:

Comment on lines -92 to +90
if 'ROCMExecutionProvider' in roop.globals.execution_providers:
return 1
return 8
return 1 if 'ROCMExecutionProvider' in roop.globals.execution_providers else 8
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function suggest_execution_threads refactored with the following changes:

faces = get_many_faces(frame)
if faces:
if faces := get_many_faces(frame):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_one_face refactored with the following changes:

Comment on lines -24 to +32
commands = ['ffmpeg', '-hide_banner', '-hwaccel', 'auto', '-loglevel', roop.globals.log_level]
commands.extend(args)
commands = [
'ffmpeg',
'-hide_banner',
'-hwaccel',
'auto',
'-loglevel',
roop.globals.log_level,
*args,
]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function run_ffmpeg refactored with the following changes:

Comment on lines -84 to +93
return os.path.join(output_path, source_name + '-' + target_name + target_extension)
return os.path.join(
output_path, f'{source_name}-{target_name}{target_extension}'
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function normalize_output_path refactored with the following changes:

queues = []
for _ in range(queue_per_future):
if not queue.empty():
queues.append(queue.get())
return queues
return [queue.get() for _ in range(queue_per_future) if not queue.empty()]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function pick_queue refactored with the following changes:

many_faces = get_many_faces(temp_frame)
if many_faces:
if many_faces := get_many_faces(temp_frame):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function process_frame refactored with the following changes:

Comment on lines -59 to +63
many_faces = get_many_faces(temp_frame)
if many_faces:
if many_faces := get_many_faces(temp_frame):
for target_face in many_faces:
temp_frame = swap_face(source_face, target_face, temp_frame)
else:
target_face = get_one_face(temp_frame)
if target_face:
temp_frame = swap_face(source_face, target_face, temp_frame)
elif target_face := get_one_face(temp_frame):
temp_frame = swap_face(source_face, target_face, temp_frame)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function process_frame refactored with the following changes:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
0 participants