Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot do "Face_detect_crop" function #477

Open
TransAmMan opened this issue Dec 11, 2024 · 10 comments
Open

Cannot do "Face_detect_crop" function #477

TransAmMan opened this issue Dec 11, 2024 · 10 comments

Comments

@TransAmMan
Copy link

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.

@luoxyhappy
Copy link

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.

@R3PO97
Copy link

R3PO97 commented Dec 17, 2024

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

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

@Maryam483
Copy link

Maryam483 commented Dec 17, 2024

@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.

@luoxyhappy
Copy link

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

@R3PO97
Copy link

R3PO97 commented Dec 18, 2024

Can confirm link above works. Thanks!

@TransAmMan
Copy link
Author

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

@Maryam483
Copy link

Maryam483 commented Dec 24, 2024

@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

@TransAmMan
Copy link
Author

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
Copy link
Author

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

@luoxyhappy
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants