Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
netrunner-exe committed Dec 22, 2022
1 parent f70a1ea commit acd13ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 1 addition & 3 deletions utils/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# @Author: netrunner-exe
# @Date: 2022-05-30 11:09:04
# @Last Modified by: netrunner-exe
# @Last Modified time: 2022-12-21 17:14:41
# @Last Modified time: 2022-12-22 14:45:11
import argparse


Expand Down Expand Up @@ -44,8 +44,6 @@ def initialize(self):
help='Path to output manipulated video.')
self.parser.add_argument('--img_output', type=str, default="results/swapped_image.jpg",
help='Path to output manipulated image.')
self.parser.add_argument('--compare', type=str2bool, default=False, const=False, nargs='?',
help='If true, concatenates the frame with the manipulated frame.')
self.parser.add_argument('--align_source', type=str2bool, default=True, const=True, nargs='?',
help='If true, detects the face and aligns it before extracting identity.')

Expand Down
5 changes: 1 addition & 4 deletions utils/swap_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# @Author: netrunner-exe
# @Date: 2022-11-23 09:52:13
# @Last Modified by: netrunner-exe
# @Last Modified time: 2022-12-21 17:19:56
# @Last Modified time: 2022-12-22 14:45:19
import glob
import os
import shutil
Expand Down Expand Up @@ -100,9 +100,6 @@ def run_inference(opt, source, target, RetinaFace,

total_img = (iim_aligned * blend_mask + total_img * (1 - blend_mask))

if opt.compare == True:
total_img = np.concatenate((im / 255.0, total_img), axis=1)

total_img = np.clip(total_img * 255, 0, 255).astype('uint8')

cv2.imwrite(result_img_path, cv2.cvtColor(total_img, cv2.COLOR_BGR2RGB))
Expand Down

0 comments on commit acd13ca

Please sign in to comment.