Skip to content

Commit 70b22c4

Browse files
committed
update
1 parent 7a6c92a commit 70b22c4

File tree

8 files changed

+77
-15
lines changed

8 files changed

+77
-15
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ If you find this project useful, please star it. It is the greatest appreciation
5252

5353
[![logo](./docs/img/vggface2_hq_compare.png)](https://github.com/NNNNAI/VGGFace2-HQ)
5454

55+
56+
## This project also received support from [SocialBook](https://socialbook.io).
57+
<!-- [![logo](./simswaplogo/socialbook_logo.2020.357eed90add7705e54a8.svg)](https://socialbook.io) -->
58+
<img width=30% src="./simswaplogo/socialbook_logo.2020.357eed90add7705e54a8.svg"/>
59+
5560
## Dependencies
5661
- python3.6+
5762
- pytorch1.5+

models/fs_model.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ def initialize(self, opt):
5959
self.netG = Generator_Adain_Upsample(input_nc=3, output_nc=3, latent_size=512, n_blocks=9, deep=False)
6060
self.netG.to(device)
6161

62-
63-
64-
6562
# Id network
6663
netArc_checkpoint = opt.Arc_path
6764
netArc_checkpoint = torch.load(netArc_checkpoint, map_location=torch.device("cpu"))

models/models.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@
77

88

99
def create_model(opt):
10-
if opt.model == 'pix2pixHD':
11-
#from .pix2pixHD_model import Pix2PixHDModel, InferenceModel
12-
from .fs_model import fsModel
13-
model = fsModel()
14-
else:
15-
from .ui_model import UIModel
16-
model = UIModel()
10+
#from .pix2pixHD_model import Pix2PixHDModel, InferenceModel
11+
from .fs_model import fsModel
12+
model = fsModel()
1713

1814
model.initialize(opt)
1915
if opt.verbose:

models/projected_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Created Date: Wednesday January 12th 2022
66
# Author: Chen Xuanhong
77
# Email: chenxuanhongzju@outlook.com
8-
# Last Modified: Thursday, 21st April 2022 8:13:37 pm
8+
# Last Modified: Saturday, 13th May 2023 9:56:35 am
99
# Modified By: Chen Xuanhong
1010
# Copyright (c) 2022 Shanghai Jiao Tong University
1111
#############################################################
@@ -46,7 +46,7 @@ def initialize(self, opt):
4646
# Id network
4747
netArc_checkpoint = opt.Arc_path
4848
netArc_checkpoint = torch.load(netArc_checkpoint, map_location=torch.device("cpu"))
49-
self.netArc = netArc_checkpoint['model'].module
49+
self.netArc = netArc_checkpoint
5050
self.netArc = self.netArc.cuda()
5151
self.netArc.eval()
5252
self.netArc.requires_grad_(False)

options/base_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def initialize(self):
1313
self.parser.add_argument('--name', type=str, default='people', help='name of the experiment. It decides where to store samples and models')
1414
self.parser.add_argument('--gpu_ids', type=str, default='0', help='gpu ids: e.g. 0 0,1,2, 0,2. use -1 for CPU')
1515
self.parser.add_argument('--checkpoints_dir', type=str, default='./checkpoints', help='models are saved here')
16-
self.parser.add_argument('--model', type=str, default='pix2pixHD', help='which model to use')
16+
# self.parser.add_argument('--model', type=str, default='pix2pixHD', help='which model to use')
1717
self.parser.add_argument('--norm', type=str, default='batch', help='instance normalization or batch normalization')
1818
self.parser.add_argument('--use_dropout', action='store_true', help='use dropout for the generator')
1919
self.parser.add_argument('--data_type', default=32, type=int, choices=[8, 16, 32], help="Supported data type i.e. 8, 16, 32 bit")

options/test_options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def initialize(self):
2424
self.parser.add_argument("--onnx", type=str, help="run ONNX model via TRT")
2525
self.parser.add_argument("--Arc_path", type=str, default='arcface_model/arcface_checkpoint.tar', help="run ONNX model via TRT")
2626
self.parser.add_argument("--pic_a_path", type=str, default='G:/swap_data/ID/elon-musk-hero-image.jpeg', help="Person who provides identity information")
27-
self.parser.add_argument("--pic_b_path", type=str, default='G:/swap_data/ID/bengio.jpg', help="Person who provides information other than their identity")
27+
self.parser.add_argument("--pic_b_path", type=str, default='./demo_file/multi_people.jpg', help="Person who provides information other than their identity")
2828
self.parser.add_argument("--pic_specific_path", type=str, default='./crop_224/zrf.jpg', help="The specific person to be swapped")
2929
self.parser.add_argument("--multisepcific_dir", type=str, default='./demo_file/multispecific', help="Dir for multi specific")
3030
self.parser.add_argument("--video_path", type=str, default='G:/swap_data/video/HSB_Demo_Trim.mp4', help="path for the video to swap")
@@ -33,6 +33,6 @@ def initialize(self):
3333
self.parser.add_argument('--id_thres', type=float, default=0.03, help='how many test images to run')
3434
self.parser.add_argument('--no_simswaplogo', action='store_true', help='Remove the watermark')
3535
self.parser.add_argument('--use_mask', action='store_true', help='Use mask for better result')
36-
self.parser.add_argument('--crop_size', type=int, default=224, help='Crop of size of input image')
36+
self.parser.add_argument('--crop_size', type=int, default=512, help='Crop of size of input image')
3737

3838
self.isTrain = False

output/result.jpg

653 KB
Loading
Lines changed: 64 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)