hacksider / Deep-Live-Cam

real time face swap and one-click video deepfake with only a single image
GNU Affero General Public License v3.0
41.26k stars 6.02k forks source link

UI, D&D, Opacity, Hotswap #746

Closed KRSHH closed 3 weeks ago

KRSHH commented 1 month ago

Summary by Sourcery

Enhance the UI with a new dropdown menu and reorganize layout for better usability. Add features for saving and loading switch states, and implement face opacity and mouth mask in face swapping. Update documentation with new media paths and additional guidance.

New Features:

Enhancements:

Documentation:

sourcery-ai[bot] commented 1 month ago

Reviewer's Guide by Sourcery

This PR introduces significant UI improvements and new features for face swapping functionality. The changes include a modernized dropdown menu, persistent switch states, enhanced face opacity controls, and mouth masking capabilities. The UI has been reorganized into a two-column layout for better organization of controls, and new visualization features have been added for debugging purposes.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Added a modern dropdown menu component for camera selection
  • Implemented a custom ModernOptionMenu class with improved styling
  • Added dropdown visibility toggle functionality
  • Implemented click-outside behavior to close dropdown
  • Added scrollable frame support for long lists
modules/ui.py
Implemented persistent switch states for user preferences
  • Added save_switch_states function to store settings in JSON
  • Added load_switch_states function to restore settings on startup
  • Initialized default values for all switch states
modules/ui.py
modules/globals.py
Enhanced face swapping with new masking and opacity features
  • Added face opacity controls with slider
  • Implemented mouth masking functionality
  • Added mask size and feather controls
  • Added visualization options for debugging masks
modules/processors/frame/face_swapper.py
Reorganized UI layout and improved controls
  • Split options into two columns for better organization
  • Added new switches for FPS display and mouth mask controls
  • Improved camera selection frame styling
  • Added minimum window size constraint
modules/ui.py
Updated documentation and media references
  • Updated image paths to use media directory
  • Added new feature demonstrations and tips
  • Updated version number to 1.6.0
  • Added star history chart
README.md
modules/metadata.py

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).
hacksider commented 1 month ago

Awesome work @KRSHH but there's still frame dips on the new theme.

https://github.com/user-attachments/assets/23495085-1d90-4497-8d92-c6b7416174cc

https://github.com/user-attachments/assets/9b127668-97fe-4028-bf12-8ce4e4b62eb5

See comparison video on the push

KRSHH commented 1 month ago

Thanks, Looking into it.

Cesarsilva000 commented 4 weeks ago

what is mask size and mask feather pls

KRSHH commented 4 weeks ago

what is mask size and mask feather pls

This PR is still not there. use main

Cesarsilva000 commented 4 weeks ago

i don't get what you mean by main but bro i used yours/pulled yours into my project and its working very well, in terms of performance with my GPU i was having performance issues with the main one and also some issues with the slider but this one is working perfectly, but i don't know what mask size and mask feather is so i wanted to know if its something that will help me, the "show fps" button really helped me out honestly thansk

KRSHH commented 4 weeks ago

i don't get what you mean by main but bro i used yours/pulled yours into my project and its working very well, in terms of performance with my GPU i was having performance issues with the main one and also some issues with the slider but this one is working perfectly, but i don't know what mask size and mask feather is so i wanted to know if its something that will help me, the "show fps" button really helped me out honestly thansk

Mask size is the size of the cropping of mouth region from faceswap and feather is the smoothening of it. you can see it by enabling show mouth box

How much FPS are you getting on main compared to this?

Cesarsilva000 commented 4 weeks ago

thanks, I'm getting at least 4 times more fps when I use this one with CUDA or tensorrt when i was using main I was getting max 0.8 fps with my NVIDIA RTX 6GB graphics card(on main CUDA isnt working so i could only use CPU), when i used this I'm getting from 2.9 to 6fps on CUDA and tensorrt, using CPU gives me like 1.8, now the difference between 0.8 and 2.9 fps is very big and its more than enough for me i just need to find a good webcam because some webcams slow it down so thanks a lot