deepghs / waifuc

Efficient Train Data Collector for Anime Waifu
https://deepghs.github.io/waifuc/
MIT License
282 stars 23 forks source link

Why CPU will be quite a lot faster than GPU #66

Closed jxhxgt closed 1 month ago

jxhxgt commented 1 month ago

Loading from 'D:\萨卢斯': 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 52/52 [01:12<00:00, 1.40s/it] LocalSource('D:\萨卢斯'): 24it [01:12, 3.04s/it] SaveExporter('D:\萨卢斯\1'): 11it [01:12, 6.63s/it]████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 51/52 [01:12<00:00, 1.31it/s] PS Microsoft.PowerShell.Core\FileSystem::\hjx\daixunlian1\萨卢斯> pip uninstall onnxruntime WARNING: Skipping onnxruntime as it is not installed. PS Microsoft.PowerShell.Core\FileSystem::\hjx\daixunlian1\萨卢斯> pip uninstall onnxruntime-gpu Found existing installation: onnxruntime-gpu 1.19.2 Uninstalling onnxruntime-gpu-1.19.2: Would remove: c:\users\hjx\appdata\local\programs\python\python310\lib\site-packages\onnxruntime* c:\users\hjx\appdata\local\programs\python\python310\lib\site-packages\onnxruntime_gpu-1.19.2.dist-info* c:\users\hjx\appdata\local\programs\python\python310\scripts\onnxruntime_test.exe Proceed (Y/n)? y PS Microsoft.PowerShell.Core\FileSystem::\hjx\daixunlian1\萨卢斯> pip install onnxruntime Collecting onnxruntime Using cached onnxruntime-1.19.2-cp310-cp310-win_amd64.whl.metadata (4.7 kB) Requirement already satisfied: coloredlogs in c:\users\hjx\appdata\local\programs\python\python310\lib\site-packages (from onnxruntime) (15.0.1) Requirement already satisfied: flatbuffers in c:\users\hjx\appdata\local\programs\python\python310\lib\site-packages (from onnxruntime) (23.5.26) Requirement already satisfied: numpy>=1.21.6 in c:\users\hjx\appdata\local\programs\python\python310\lib\site-packages (from onnxruntime) (1.26.4) Requirement already satisfied: packaging in c:\users\hjx\appdata\local\programs\python\python310\lib\site-packages (from onnxruntime) (23.2) Requirement already satisfied: protobuf in c:\users\hjx\appdata\local\programs\python\python310\lib\site-packages (from onnxruntime) (4.25.3) Requirement already satisfied: sympy in c:\users\hjx\appdata\local\programs\python\python310\lib\site-packages (from onnxruntime) (1.12) Requirement already satisfied: humanfriendly>=9.1 in c:\users\hjx\appdata\local\programs\python\python310\lib\site-packages (from coloredlogs->onnxruntime) (10.0) Requirement already satisfied: mpmath>=0.19 in c:\users\hjx\appdata\local\programs\python\python310\lib\site-packages (from sympy->onnxruntime) (1.3.0) Requirement already satisfied: pyreadline3 in c:\users\hjx\appdata\local\programs\python\python310\lib\site-packages (from humanfriendly>=9.1->coloredlogs->onnxruntime) (3.4.1) Using cached onnxruntime-1.19.2-cp310-cp310-win_amd64.whl (11.1 MB) Installing collected packages: onnxruntime Successfully installed onnxruntime-1.19.2

[notice] A new release of pip is available: 24.0 -> 24.2 [notice] To update, run: python.exe -m pip install --upgrade pip PS Microsoft.PowerShell.Core\FileSystem::\hjx\daixunlian1\萨卢斯> & C:/Users/hjx/AppData/Local/Programs/Python/Python310/python.exe d:/waifuc/新建文本文档.txt Loading from 'D:\萨卢斯': 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 52/52 [00:11<00:00, 4.69it/s] LocalSource('D:\萨卢斯'): 24it [00:11, 2.16it/s]
SaveExporter('D:\萨卢斯\1'): 11it [00:11, 1.01s/it]████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 51/52 [00:11<00:00, 12.32it/s] PS Microsoft.PowerShell.Core\FileSystem::\hjx\daixunlian1\萨卢斯>

jxhxgt commented 1 month ago

from waifuc.action import FilterSimilarAction from waifuc.action import NoMonochromeAction from waifuc.action import RandomFilenameAction from waifuc.action import ThreeStageSplitAction from waifuc.action import ClassFilterAction from waifuc.action import AlignMinSizeAction from waifuc.action import ModeConvertAction from waifuc.action import FaceCountAction from waifuc.action import PersonSplitAction from waifuc.action import HeadCoverAction from waifuc.export import SaveExporter from waifuc.source import LocalSource if name == 'main': source = LocalSource(r'D:\萨卢斯') source = source.attach( ModeConvertAction(mode='RGB', force_background='white'),AlignMinSizeAction(768),FaceCountAction(1),FilterSimilarAction(),PersonSplitAction(),HeadCoverAction(), )

source.export(SaveExporter(r'D:\萨卢斯\1'))
narugo1992 commented 1 month ago

because all the models u are using are light-weight models, and your images are really few.

using gpu need some time to initialize, which mean extra time cost.

and your image quantity means even when u choose to use gpu it will not save too much time.

so thats why cpu runs faster than gpu.

jxhxgt commented 1 month ago

谢谢