Cannot do "Face_detect_crop" function #477

Open
opened 2024-12-12 00:01:29 +01:00 by TransAmMan · 10 comments
TransAmMan commented 2024-12-12 00:01:29 +01:00 (Migrated from github.com)

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.

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 commented 2024-12-17 04:29:14 +01:00 (Migrated from github.com)

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.

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 commented 2024-12-17 07:02:48 +01:00 (Migrated from github.com)

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

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

@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 commented 2024-12-17 07:41:41 +01:00 (Migrated from github.com)

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

@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 commented 2024-12-17 08:30:30 +01:00 (Migrated from github.com)

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

#474 solved the problem. https://drive.google.com/file/d/1goH5lO8BAhTpRhpBeXqWEcGkxiiLlgx9/view @Maryam483 @TransAmMan @R3PO97
R3PO97 commented 2024-12-18 13:11:22 +01:00 (Migrated from github.com)

Can confirm link above works. Thanks!

Can confirm link above works. Thanks!
TransAmMan commented 2024-12-19 21:42:42 +01:00 (Migrated from github.com)

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

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 commented 2024-12-24 15:06:04 +01:00 (Migrated from github.com)

@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

@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](https://github.com/user-attachments/assets/f4d8bed6-28e1-4645-a88a-63a3d444e7c4) ![Uploading img.PNG…]() ![image](https://github.com/user-attachments/assets/9f999802-cf72-4804-af8c-811cd888ab8f)
TransAmMan commented 2024-12-25 18:52:45 +01:00 (Migrated from github.com)

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

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 commented 2024-12-25 19:12:42 +01:00 (Migrated from github.com)

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

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 commented 2024-12-26 03:50:25 +01:00 (Migrated from github.com)

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.

> 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 in to join this conversation.