diff --git a/README.md b/README.md index 3b90adc..ff8efa6 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,11 @@ If you find this project useful, please star it. It is the greatest appreciation [![logo](./docs/img/vggface2_hq_compare.png)](https://github.com/NNNNAI/VGGFace2-HQ) + +## This project also received support from [SocialBook](https://socialbook.io). + + + ## Dependencies - python3.6+ - pytorch1.5+ diff --git a/models/fs_model.py b/models/fs_model.py index 2ff18d1..95ac877 100644 --- a/models/fs_model.py +++ b/models/fs_model.py @@ -59,9 +59,6 @@ class fsModel(BaseModel): self.netG = Generator_Adain_Upsample(input_nc=3, output_nc=3, latent_size=512, n_blocks=9, deep=False) self.netG.to(device) - - - # Id network netArc_checkpoint = opt.Arc_path netArc_checkpoint = torch.load(netArc_checkpoint, map_location=torch.device("cpu")) diff --git a/models/models.py b/models/models.py index 8e71f2f..bf9e84e 100644 --- a/models/models.py +++ b/models/models.py @@ -7,13 +7,9 @@ from .config import device, num_classes def create_model(opt): - if opt.model == 'pix2pixHD': - #from .pix2pixHD_model import Pix2PixHDModel, InferenceModel - from .fs_model import fsModel - model = fsModel() - else: - from .ui_model import UIModel - model = UIModel() + #from .pix2pixHD_model import Pix2PixHDModel, InferenceModel + from .fs_model import fsModel + model = fsModel() model.initialize(opt) if opt.verbose: diff --git a/models/projected_model.py b/models/projected_model.py index 477f63e..15d70f9 100644 --- a/models/projected_model.py +++ b/models/projected_model.py @@ -5,7 +5,7 @@ # Created Date: Wednesday January 12th 2022 # Author: Chen Xuanhong # Email: chenxuanhongzju@outlook.com -# Last Modified: Thursday, 21st April 2022 8:13:37 pm +# Last Modified: Saturday, 13th May 2023 9:56:35 am # Modified By: Chen Xuanhong # Copyright (c) 2022 Shanghai Jiao Tong University ############################################################# @@ -46,7 +46,7 @@ class fsModel(BaseModel): # Id network netArc_checkpoint = opt.Arc_path netArc_checkpoint = torch.load(netArc_checkpoint, map_location=torch.device("cpu")) - self.netArc = netArc_checkpoint['model'].module + self.netArc = netArc_checkpoint self.netArc = self.netArc.cuda() self.netArc.eval() self.netArc.requires_grad_(False) diff --git a/options/base_options.py b/options/base_options.py index 4ee0209..14f817b 100644 --- a/options/base_options.py +++ b/options/base_options.py @@ -13,7 +13,7 @@ class BaseOptions(): self.parser.add_argument('--name', type=str, default='people', help='name of the experiment. It decides where to store samples and models') 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') self.parser.add_argument('--checkpoints_dir', type=str, default='./checkpoints', help='models are saved here') - self.parser.add_argument('--model', type=str, default='pix2pixHD', help='which model to use') + # self.parser.add_argument('--model', type=str, default='pix2pixHD', help='which model to use') self.parser.add_argument('--norm', type=str, default='batch', help='instance normalization or batch normalization') self.parser.add_argument('--use_dropout', action='store_true', help='use dropout for the generator') self.parser.add_argument('--data_type', default=32, type=int, choices=[8, 16, 32], help="Supported data type i.e. 8, 16, 32 bit") diff --git a/options/test_options.py b/options/test_options.py index c36849b..3562671 100644 --- a/options/test_options.py +++ b/options/test_options.py @@ -24,7 +24,7 @@ class TestOptions(BaseOptions): self.parser.add_argument("--onnx", type=str, help="run ONNX model via TRT") self.parser.add_argument("--Arc_path", type=str, default='arcface_model/arcface_checkpoint.tar', help="run ONNX model via TRT") 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") - 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") + self.parser.add_argument("--pic_b_path", type=str, default='./demo_file/multi_people.jpg', help="Person who provides information other than their identity") self.parser.add_argument("--pic_specific_path", type=str, default='./crop_224/zrf.jpg', help="The specific person to be swapped") self.parser.add_argument("--multisepcific_dir", type=str, default='./demo_file/multispecific', help="Dir for multi specific") 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 @@ class TestOptions(BaseOptions): self.parser.add_argument('--id_thres', type=float, default=0.03, help='how many test images to run') self.parser.add_argument('--no_simswaplogo', action='store_true', help='Remove the watermark') self.parser.add_argument('--use_mask', action='store_true', help='Use mask for better result') - self.parser.add_argument('--crop_size', type=int, default=224, help='Crop of size of input image') + self.parser.add_argument('--crop_size', type=int, default=512, help='Crop of size of input image') self.isTrain = False \ No newline at end of file diff --git a/output/result.jpg b/output/result.jpg index edd5322..ca332d9 100644 Binary files a/output/result.jpg and b/output/result.jpg differ diff --git a/simswaplogo/socialbook_logo.2020.357eed90add7705e54a8.svg b/simswaplogo/socialbook_logo.2020.357eed90add7705e54a8.svg new file mode 100644 index 0000000..dd04f00 --- /dev/null +++ b/simswaplogo/socialbook_logo.2020.357eed90add7705e54a8.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + +