This commit is contained in:
lvmin 2023-08-09 15:13:08 -07:00
parent 06a96f70ab
commit 9cdf7671e2
1 changed files with 2 additions and 2 deletions

View File

@ -151,6 +151,6 @@ with torch.no_grad():
model.first_stage_model.cpu()
import cv2
samples = einops.rearrange(samples, 'b c h w -> b h w c')[0, :, :, ::-1] * 255.0
samples = samples.cpu().numpy().clip(0, 255).astype(np.uint8)
samples = einops.rearrange(samples, 'b c h w -> b h w c')[0] * 255.0
samples = samples.cpu().numpy().clip(0, 255).astype(np.uint8)[:, :, ::-1]
cv2.imwrite('img.png', samples)