Hi,
I am trying to extract faces from a folder of images, they are 4160x6240 pixel JPGs, so rather large (around 5 megabytes a piece). I have tried reencoding them to 80% jpg, and now they are around 1.10 megabytes to 1.5 megabytes.,
I am getting this:
Code: Select all
Loading...
Setting Faceswap backend to NVIDIA
12/24/2022 07:27:52 INFO Log level set to: INFO
12/24/2022 07:27:54 INFO Loading Detect from S3Fd plugin...
12/24/2022 07:27:54 INFO Loading Align from Fan plugin...
12/24/2022 07:27:54 INFO Loading Mask from Components plugin...
12/24/2022 07:27:54 INFO Loading Mask from Extended plugin...
12/24/2022 07:27:54 INFO Loading Mask from Unet_Dfl plugin...
12/24/2022 07:27:54 INFO Loading Mask from Vgg_Obstructed plugin...
12/24/2022 07:27:54 INFO Loading Mask from Custom plugin...
12/24/2022 07:27:54 INFO Loading Mask from Bisenet_Fp plugin...
12/24/2022 07:27:54 INFO Loading Mask from Vgg_Clear plugin...
12/24/2022 07:27:54 INFO Starting, this may take a while...
12/24/2022 07:27:54 INFO Output Directory: D:\FS\training\Michelle\Session1
12/24/2022 07:27:54 INFO Initializing S3FD (Detect)...
12/24/2022 07:27:55 INFO Initialized S3FD (Detect) with batchsize of 1
12/24/2022 07:27:55 INFO Initializing FAN (Align)...
12/24/2022 07:28:03 INFO Initialized FAN (Align) with batchsize of 1
12/24/2022 07:28:03 INFO Initializing Components (Mask)...
12/24/2022 07:28:03 INFO Initialized Components (Mask) with batchsize of 1
12/24/2022 07:28:03 INFO Initializing Extended (Mask)...
12/24/2022 07:28:03 INFO Initialized Extended (Mask) with batchsize of 1
12/24/2022 07:28:03 INFO Initializing U-Net (Mask)...
12/24/2022 07:28:04 INFO Initialized U-Net (Mask) with batchsize of 1
12/24/2022 07:28:04 INFO Initializing VGG Obstructed (Mask)...
12/24/2022 07:28:06 INFO Initialized VGG Obstructed (Mask) with batchsize of 1
12/24/2022 07:28:06 INFO Initializing Custom (Mask)...
12/24/2022 07:28:06 INFO Initialized Custom (Mask) with batchsize of 1
12/24/2022 07:28:06 INFO Initializing BiSeNet - Face Parsing (Mask)...
12/24/2022 07:28:08 INFO Initialized BiSeNet - Face Parsing (Mask) with batchsize of 1
12/24/2022 07:28:08 INFO Initializing VGG Clear (Mask)...
12/24/2022 07:28:12 ERROR Got Exception on main handler:
Traceback (most recent call last):
File "C:\Users\Simon\faceswap\lib\cli\launcher.py", line 217, in execute_script
process.process()
File "C:\Users\Simon\faceswap\scripts\extract.py", line 165, in process
extract.process()
File "C:\Users\Simon\faceswap\scripts\extract.py", line 689, in process
self._run_extraction()
File "C:\Users\Simon\faceswap\scripts\extract.py", line 709, in _run_extraction
self._extractor.launch()
File "C:\Users\Simon\faceswap\plugins\extract\pipeline.py", line 272, in launch
self._launch_plugin(phase)
File "C:\Users\Simon\faceswap\plugins\extract\pipeline.py", line 701, in _launch_plugin
plugin.initialize(**kwargs)
File "C:\Users\Simon\faceswap\plugins\extract\_base.py", line 482, in initialize
self.init_model()
File "C:\Users\Simon\faceswap\plugins\extract\mask\vgg_clear.py", line 43, in init_model
self.model = VGGClear(self.model_path,
File "C:\Users\Simon\faceswap\plugins\extract\mask\vgg_clear.py", line 107, in __init__
self.load_model_weights()
File "C:\Users\Simon\faceswap\lib\model\session.py", line 235, in load_model_weights
self._model.load_weights(self._model_path)
File "C:\Users\Simon\MiniConda3\envs\faceswap\lib\site-packages\keras\utils\traceback_utils.py", line 67, in error_handler
raise e.with_traceback(filtered_tb) from None
File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "C:\Users\Simon\MiniConda3\envs\faceswap\lib\site-packages\h5py\_hl\dataset.py", line 1040, in __array__
arr = numpy.zeros(self.shape, dtype=self.dtype if dtype is None else dtype)
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 392. MiB for an array with shape (7, 7, 512, 4096) and data type float32
I am trying to avoid resizing the images to something smaller as the actual facepart of them is not that much, also trying to avoid having to manually cut the face from each image as this folder has 760 and there are more folders
I am running a RTX 4090 with 24GB of RAM. System was a fresh reboot running on 32GB of RAM with at least 26GB free at program start.
I tried setting all the batchsizes that had anything to do with extract to 1 to minimize the load.
Any help is greatly appreciated!
Merry x-mas (of cause not expecting any answers before after the holidays, but I wanted to get it posted)!
Simon