fix: 🐛 bg upscaler in gfpgan

I was just not returning from tensor2np 🦀☠️
This commit is contained in:
melMass
2023-07-05 21:09:00 +02:00
parent 2e592d5566
commit fee48adff3
2 changed files with 3 additions and 9 deletions
+2 -1
View File
@@ -6,4 +6,5 @@ ifnude==0.0.3
insightface==0.7.3
mmcv==2.0.0
mmdet==3.0.0
rembg==2.0.37
rembg==2.0.37
facexlib==0.3.0
+1 -8
View File
@@ -73,14 +73,7 @@ def np2tensor(img_np):
def tensor2np(tensor: torch.Tensor) -> np.ndarray:
np.clip(255.0 * tensor.cpu().numpy().squeeze(), 0, 255).astype(np.uint8)
return np.clip(255.0 * tensor.cpu().numpy().squeeze(), 0, 255).astype(np.uint8)
def img_tensor_to_np(img_tensor):
img_tensor = img_tensor.clone()
img_tensor = img_tensor * 255.0
return img_tensor.squeeze(0).numpy().astype(np.float32)