Skip to content

Conversation

mst-rajatmishra
Copy link

Hi,
I tried making Some Changes,

  1. I’ve replaced print statements with logging to track progress and handle errors.
  2. The code has been broken into smaller, more manageable functions:
  • load_faces handles loading and cropping faces from image paths.
  • process_source_and_target handles loading the source and target images.
  • perform_inference handles the inference step.
  • enhance_faces handles the optional super-resolution step.
  • save_output handles saving the result (either a video or image).
  1. The inference step is wrapped in torch.no_grad() to save memory and speed up processing.

  2. Errors during face cropping are logged to ensure smooth execution even if a face is not detected in an image.

Thank You,
Rajat Mishra.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant