mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-30 11:11:15 +00:00
remove basicsr (#1214)
This commit is contained in:
committed by
GitHub
parent
2f0555f7dc
commit
5fa8c6d414
@@ -11,7 +11,6 @@ import torch
|
|||||||
import torch.nn as nn
|
import torch.nn as nn
|
||||||
import torch.nn.functional as F
|
import torch.nn.functional as F
|
||||||
from modules import devices
|
from modules import devices
|
||||||
from basicsr.utils import img2tensor
|
|
||||||
|
|
||||||
nets = {
|
nets = {
|
||||||
'baseline': {
|
'baseline': {
|
||||||
@@ -638,17 +637,3 @@ def pidinet():
|
|||||||
pdcs = config_model('carv4')
|
pdcs = config_model('carv4')
|
||||||
dil = 24 #if args.dil else None
|
dil = 24 #if args.dil else None
|
||||||
return PiDiNet(60, pdcs, dil=dil, sa=True)
|
return PiDiNet(60, pdcs, dil=dil, sa=True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
model = pidinet()
|
|
||||||
ckp = torch.load('table5_pidinet.pth')['state_dict']
|
|
||||||
model.load_state_dict({k.replace('module.',''):v for k, v in ckp.items()})
|
|
||||||
im = cv2.imread('examples/test_my/cat_v4.png')
|
|
||||||
im = img2tensor(im).unsqueeze(0)/255.
|
|
||||||
res = model(im)[-1]
|
|
||||||
res = res>0.5
|
|
||||||
res = res.float()
|
|
||||||
res = (res[0,0].cpu().data.numpy()*255.).astype(np.uint8)
|
|
||||||
print(res.shape)
|
|
||||||
cv2.imwrite('edge.png', res)
|
|
||||||
@@ -33,7 +33,6 @@ torchsde==0.2.6
|
|||||||
transformers==4.44.0
|
transformers==4.44.0
|
||||||
httpx==0.24.1
|
httpx==0.24.1
|
||||||
pillow-avif-plugin==1.4.3
|
pillow-avif-plugin==1.4.3
|
||||||
basicsr==1.4.2
|
|
||||||
diffusers==0.29.2
|
diffusers==0.29.2
|
||||||
gradio_rangeslider==0.0.6
|
gradio_rangeslider==0.0.6
|
||||||
tqdm==4.66.1
|
tqdm==4.66.1
|
||||||
|
|||||||
Reference in New Issue
Block a user