Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Hillobar authored Dec 28, 2023
1 parent 65185a8 commit eeec589
Show file tree
Hide file tree
Showing 4 changed files with 322 additions and 227 deletions.
14 changes: 12 additions & 2 deletions rope/Coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ def coordinator():
if not vm.swapper_model:
swapper, emap = load_swapper_model()
vm.set_swapper_model(swapper, emap)
if not vm.detection_model:
vm.detection_model = load_detection_model()
vm.recognition_model = load_recognition_model()

vm.swap = action[0][1]
action.pop(0)
elif action[0][0] == "target_faces":
Expand All @@ -97,8 +101,8 @@ def coordinator():
# action.pop(0)
elif action [0][0] == "parameters":
if action[0][1]['UpscaleState']:
# if not vm.resnet_model:
# vm.resnet_model = load_resnet_model()
if not vm.resnet_model:
vm.resnet_model = load_resnet_model()
index = action[0][1]['UpscaleMode']
if action[0][1]['UpscaleModes'][index] == 'GFPGAN':
if not vm.GFPGAN_model:
Expand Down Expand Up @@ -141,6 +145,12 @@ def coordinator():
elif action [0][0] == "load_models":
gui.populate_target_videos()
gui.load_source_faces()
action.pop(0)
elif action[0][0] == "function":
eval(action[0][1])
action.pop(0)
elif action [0][0] == "clear_mem":
vm.clear_mem()
action.pop(0)


Expand Down
57 changes: 32 additions & 25 deletions rope/Dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'UpscaleInc': 5,
'UpscaleUnit': '%',
'UpscaleIcon': './rope/media/gfpgan_logo.png',
'UpscaleMessage': 'UPSCALER - Upscales faces. [LB: on/off, RB: GFPGAN/Codeformer, MW: amount]',
'UpscaleMessage': 'UPSCALER - Upscales faces. [LB: on/off, RB: GFPGAN/Codeformer/GPEN256/GPEN512, MW: amount]',

'DiffState': False,
'DiffMode': 0,
Expand Down Expand Up @@ -52,7 +52,7 @@
'CLIPInc': 1,
'CLIPUnit': '%',
'CLIPIcon': './rope/media/CLIP.png',
'CLIPMessage': 'CLIP - Text based occluder. Occluded objects are visible in the final image (occluded from the mask). [LB: on/off, MW: amount]',
'CLIPMessage': 'CLIP - Text based occluder. Occluded objects are visible in the final image (occluded from the mask). [LB: on/off, MW: strength]',

'OccluderState': False,
'OccluderMode': 0,
Expand All @@ -63,7 +63,7 @@
'OccluderInc': 1,
'OccluderUnit': '%',
'OccluderIcon': './rope/media/occluder.png',
'OccluderMessage': 'OCCLUDER - Automatic occluder. Any object in the face region is occluded. [LB: on/off]',
'OccluderMessage': 'OCCLUDER - Automatic occluder. Any object in the face region is occluded. [LB: on/off, MW: additional size]',

'FaceParserState': False,
'FaceParserMode': 0,
Expand Down Expand Up @@ -120,24 +120,15 @@
'OrientationIcon': './rope/media/orient.png',
'OrientationMessage': 'ORIENTATION - Rotate the face detector to better detect faces at different angles. [MW: angle]',

'EnhancerRefState': False,
'EnhancerRefMode': 0,
'EnhancerRefModes': ['Adjust'],
'EnhancerRefAmount': [0.0, 0.0, 0.0, 0.0],
'EnhancerRefMin': 0,
'EnhancerRefMax': 100,
'EnhancerRefInc': 10,
'EnhancerRefUnit': '%',
'EnhancerRefIcon': './rope/media/orient.png',
'EnhancerRefMessage': 'ORIENTATION - Rotate the face detector to better detect faces at different angles. [MW: angle]',


'RefDelState': False,
'RefDelMode': 0,
'RefDelModes': ['del_x', 'del_y', 'scale'],
'RefDelAmount': [0, 0, 0],
'RefDelMin': -100,
'RefDelMax': 100,
'RefDelInc': 2,
'RefDelInc': 1,
'RefDelUnit': '%',
'RefDelIcon': './rope/media/construction.png',
'RefDelMessage': 'REFERENCE DELTA - Modify the reference points. Turn on mask preview to see adjustments. [LB: on/off, RB: translate x/y, and scale, MW: amount]',
Expand All @@ -146,11 +137,11 @@
'TransformMode': 0,
'TransformModes': ['Scale'],
'TransformAmount': [0],
'TransformMin': -100,
'TransformMax': 100,
'TransformInc': 2,
'TransformMin': -20,
'TransformMax': 20,
'TransformInc': 1,
'TransformUnit': '%',
'TransformIcon': './rope/media/construction.png',
'TransformIcon': './rope/media/scale.png',
'TransformMessage': 'SCALE - Adjust the scale of the face. Use with Background parser to blend into the image. [LB: on/off, MW: amount]',

'ColorState': False,
Expand All @@ -161,8 +152,8 @@
'ColorMax': 100,
'ColorInc': 1,
'ColorUnit': 'i',
'ColorIcon': './rope/media/construction.png',
'ColorMessage': 'SCALE - Adjust the scale of the face. Use with Background parser to blend into the image. [LB: on/off, MW: amount]',
'ColorIcon': './rope/media/rgb.png',
'ColorMessage': 'RGB ADJUSTMENT - Fine-tune the RGB color values of the swap. [LB: on/off, RB: Red/Green/Blue, MW: amount]',

"CLIPText": '',

Expand All @@ -178,15 +169,15 @@
'DockMode': 0,
'DockModes': [''],
'DockIcon': './rope/media/dock.png',
'DockMessage': 'UNDOCK WINDOW - Undocks the wimdow area. Cannot be re-docked.',
'DockMessage': 'DOCK/UNDOCK WINDOW - Undocks and docks the preview wimdow area.',
'DockButton': [],
'DockIconHolder': [],

'ImgDockState': False,
'ImgDockMode': 0,
'ImgDockModes': [''],
'ImgDockIcon': './rope/media/dock.png',
'ImgDockMessage': 'UNDOCK WINDOW - Undocks the wimdow area. Cannot be re-docked.',
'ImgDockMessage': 'DOCK/UNDOCK WINDOW - Undocks and docks the preview wimdow area.',
'ImgDockButton': [],
'ImgDockIconHolder': [],

Expand All @@ -198,6 +189,14 @@
'SaveImageButton': [],
'SaveImageIconHolder': [],

'AutoSwapState': False,
'AutoSwapMode': 0,
'AutoSwapModes': ['Auto'],
'AutoSwapIcon': './rope/media/construction.png',
'AutoSwapMessage': 'AUTO SWAP - Automatically swaps the first person in an image to the selcted source faces [LB: Turn on/off]',
'AutoSwapButton': [],
'AutoSwapIconHolder': [],

'PlayState': False,
'PlayMode': 0,
'PlayModes': [''],
Expand Down Expand Up @@ -336,7 +335,7 @@
'ThreadsMode': 0,
'ThreadsModes': [''],
'ThreadsIcon': './rope/media/threads.png',
'ThreadsMessage': 'THREADS - Set number of execution threads. Once PLAY is pressed, reducing the number of threads will not release memory.',
'ThreadsMessage': 'THREADS - Set number of execution threads. [MW: set number of threads]',
'ThreadsButton': [],
'ThreadsIconHolder': [],

Expand All @@ -352,9 +351,17 @@
'PerfTestMode': 0,
'PerfTestModes': ['Perf Test'],
'PerfTestIcon': './rope/media/test.png',
'PerfTestMessage': '()',
'PerfTestMessage': 'PERFORMANCE DATA - Displays timing data in the console for critical Rope functions. [LB: on/off]',
'PerfTestButton': [],
'PerfTestIconHolder': [],
'PerfTestIconHolder': [],

'ClearmemState': False,
'ClearmemMode': 0,
'ClearmemModes': ['Clear'],
'ClearmemIcon': './rope/media/clear_mem.png',
'ClearmemMessage': 'CLEAR VRAM - Clears all models from VRAM [LB: Clear]',
'ClearmemButton': [],
'ClearmemIconHolder': [],

# 'State': False,
# 'Mode': 0,
Expand Down
Loading

0 comments on commit eeec589

Please sign in to comment.