SimSwap icon indicating copy to clipboard operation
SimSwap copied to clipboard

Cannot do "Face_detect_crop" function

Open TransAmMan opened this issue 11 months ago • 10 comments

The --no-check-certificate file "antelope.zip" https://sh23tw.dm.files.1drv.com/y4mmGiIkNVigkSwOKDcV3nwMJulRGhbtHdkheehR5TArc52UjudUYNXAEvKCii2O5LAmzGCGK6IfleocxuDeoKxDZkNzDRSt4ZUlEt8GlSOpCXAFEkBwaZimtWGDRbpIGpb_pz9Nq5jATBQpezBS6G_UtspWTkgrXHHxhviV2nWy8APPx134zOZrUIbkSF6xnsqzs3uZ_SEX_m9Rey0ykpx9w" -O antelope.zip is unavailable. I get errors: "FileNotFoundError Traceback (most recent call last) and "FileNotFoundError: [Errno 2] No such file or directory: './insightface_func/models'"

Is there a workaround? I need your help. Please.

TransAmMan avatar Dec 11 '24 23:12 TransAmMan

You need to follow the https://github.com/neuralchen/SimSwap/blob/main/docs/guidance/preparation.md to download face detection and alignment models, but the download link doesn't work now.

luoxyhappy avatar Dec 17 '24 03:12 luoxyhappy

@luoxyhappy can confirm link seems to be down at the moment.

Any idea how to source necessary files? Can anyone provide alternative download link?

R3PO97 avatar Dec 17 '24 06:12 R3PO97

@neuralchen @R3PO97 @luoxyhappy @bfirsh @TransAmMan In below code , there is link and this link is not available ? how i download ???

The --no-check-certificate file "antelope.zip" https://sh23tw.dm.files.1drv.com/y4mmGiIkNVigkSwOKDcV3nwMJulRGhbtHdkheehR5TArc52UjudUYNXAEvKCii2O5LAmzGCGK6IfleocxuDeoKxDZkNzDRSt4ZUlEt8GlSOpCXAFEkBwaZimtWGDRbpIGpb_pz9Nq5jATBQpezBS6G_UtspWTkgrXHHxhviV2nWy8APPx134zOZrUIbkSF6xnsqzs3uZ_SEX_m9Rey0ykpx9w" -O antelope.zip is unavailable.

Maryam483 avatar Dec 17 '24 06:12 Maryam483

#474 solved the problem. https://drive.google.com/file/d/1goH5lO8BAhTpRhpBeXqWEcGkxiiLlgx9/view @Maryam483 @TransAmMan @R3PO97

luoxyhappy avatar Dec 17 '24 07:12 luoxyhappy

Can confirm link above works. Thanks!

R3PO97 avatar Dec 18 '24 12:12 R3PO97

The link in #474 appears to work. However, when you try to unzip the file "!unzip ./antelope.zip -d ./insightface_func/models/", it fails with error: "Archive: ./antelope.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of ./antelope.zip or ./antelope.zip.zip, and cannot find ./antelope.zip.ZIP, period."

I probably have to point the "unzip" command at a different directory. I am working on the issue. If anyone has an answer please let me know. @neuralchen @R3PO97 @luoxyhappy @bfirsh

TransAmMan avatar Dec 19 '24 20:12 TransAmMan

@neuralchen @R3PO97 @luoxyhappy @bfirsh yes the above .zip file works , thanks alot, but when i run this code as per steps mention in colab file, then the resulting generated video has blurr faces like an image below i have attached ??? why??? https://colab.research.google.com/github/neuralchen/SimSwap/blob/main/SimSwap%20colab.ipynb#scrollTo=wwJOwR9LNKRz

when i run: !python test_one_image.py --name people --Arc_path arcface_model/arcface_checkpoint.tar --pic_a_path crop_224/6.jpg --pic_b_path crop_224/ds.jpg --output_path output/

it generates warnings also: -------------- End ----------------

/content/SimSwap/models/base_model.py:70: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. pretrained_dict = torch.load(save_path) Pretrained network G has fewer layers; The following are not initialized: ['down0', 'first_layer', 'last_layer', 'up0']

and wrong image image

Uploading img.PNG…

image

Maryam483 avatar Dec 24 '24 14:12 Maryam483

Hi: @Maryam483

I still cant get the zip file link to work for me. As for your problem with the distorted images. Try this change in the last cell.

opt.use_mask = True ## new feature up-to-date opt.Arc_path = './arcface_model/arcface_checkpoint.tar'

opt.isTrain = False opt.crop_size = 224 crop_size = opt.crop_size torch.nn.Module.dump_patches = True model = create_model(opt) model.eval() if crop_size == 512: opt.which_epoch = 550000 opt.name = '512' mode = 'ffhq' else: mode = 'None' app = Face_detect_crop(name='antelope', root='./insightface_func/models') app.prepare(ctx_id= 0, det_thresh=0.6, det_size=(640,640),mode=mode)

with torch.no_grad(): pic_a = opt.pic_a_path

TransAmMan avatar Dec 25 '24 17:12 TransAmMan

HI: @luoxyhappy

Did you just replace the "url" like this:

!wget --no-check-certificate "https://drive.google.com/file/d/1goH5lO8BAhTpRhpBeXqWEcGkxiiLlgx9/view" -O antelope.zip !unzip ./antelope.zip -d ./insightface_func/models/

or did you make other changes? @neuralchen @R3PO97 @luoxyhappy @bfirsh @Maryam483

TransAmMan avatar Dec 25 '24 18:12 TransAmMan

HI: @luoxyhappy

Did you just replace the "url" like this:

!wget --no-check-certificate "https://drive.google.com/file/d/1goH5lO8BAhTpRhpBeXqWEcGkxiiLlgx9/view" -O antelope.zip !unzip ./antelope.zip -d ./insightface_func/models/

or did you make other changes? @neuralchen @R3PO97 @luoxyhappy @bfirsh @Maryam483

Yes, it should be correct.

luoxyhappy avatar Dec 26 '24 02:12 luoxyhappy