| | |
| | inp_root=r"白鹭霜华长条" |
| | opt_root=r"opt" |
| | f0_up_key=0 |
| | person=r"weights\洛天依v3.pt" |
| | |
| | device = "cuda:0" |
| | is_half=True |
| | n_cpu=0 |
| | |
| | import torch |
| | if(torch.cuda.is_available()==False): |
| | print("没有发现支持的N卡,使用CPU进行推理") |
| | device="cpu" |
| | is_half=False |
| | if(device!="cpu"): |
| | gpu_name=torch.cuda.get_device_name(int(device.split(":")[-1])) |
| | if("16"in gpu_name): |
| | print("16系显卡强制单精度") |
| | is_half=False |
| | from multiprocessing import cpu_count |
| | if(n_cpu==0):n_cpu=cpu_count() |
| | if(is_half==True): |
| | |
| | x_pad = 3 |
| | x_query = 10 |
| | x_center = 60 |
| | x_max = 65 |
| | else: |
| | |
| | x_pad = 1 |
| | |
| | |
| | |
| | |
| | x_query = 6 |
| | x_center = 38 |
| | x_max = 41 |