Skip to content

Commit

Permalink
remove cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Zhang authored and Richard Zhang committed Sep 6, 2020
1 parent 2b1ca85 commit dd18772
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ Run `pip install lpips`. The following Python code is all you need.

```python
import lpips
loss_fn_alex = lpips.LPIPS(net='alex').cuda() # best forward scores
loss_fn_vgg = lpips.LPIPS(net='vgg').cuda() # closer to "traditional" perceptual loss, when used for optimization
loss_fn_alex = lpips.LPIPS(net='alex') # best forward scores
loss_fn_vgg = lpips.LPIPS(net='vgg') # closer to "traditional" perceptual loss, when used for optimization

import torch
img0 = torch.zeros(1,3,64,64).cuda() # image should be RGB, IMPORTANT: normalized to [-1,1]
img1 = torch.zeros(1,3,64,64).cuda()
img0 = torch.zeros(1,3,64,64) # image should be RGB, IMPORTANT: normalized to [-1,1]
img1 = torch.zeros(1,3,64,64)
d = loss_fn_alex(img0, img1)
```

Expand Down

0 comments on commit dd18772

Please sign in to comment.