Skip to content

Commit

Permalink
Change repo username
Browse files Browse the repository at this point in the history
  • Loading branch information
xhlulu committed Nov 7, 2021
1 parent 6310782 commit 0fbe994
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ You can load Animegan v2 via `torch.hub`:

```python
import torch
model = torch.hub.load('xhlulu/animegan2-pytorch', 'generator').eval()
model = torch.hub.load('bryandlee/animegan2-pytorch', 'generator').eval()
# convert your image into tensor here
out = model(img_tensor)
```

You can load with various configs (more details in [the torch docs](https://pytorch.org/docs/stable/hub.html)):
```python
model = torch.hub.load(
"xhlulu/animegan2-pytorch",
"bryandlee/animegan2-pytorch",
"generator",
pretrained=True, # or give URL to a pretrained model
device="cuda", # or "cpu" if you don't have a GPU
Expand All @@ -25,10 +25,10 @@ model = torch.hub.load(

Currently, the following `pretrained` shorthands are available:
```python
model = torch.hub.load("xhlulu/animegan2-pytorch", "generator", pretrained="celeba_distill")
model = torch.hub.load("xhlulu/animegan2-pytorch", "generator", pretrained="face_paint_512_v1")
model = torch.hub.load("xhlulu/animegan2-pytorch", "generator", pretrained="face_paint_512_v2")
model = torch.hub.load("xhlulu/animegan2-pytorch", "generator", pretrained="paprika")
model = torch.hub.load("bryandlee/animegan2-pytorch", "generator", pretrained="celeba_distill")
model = torch.hub.load("bryandlee/animegan2-pytorch", "generator", pretrained="face_paint_512_v1")
model = torch.hub.load("bryandlee/animegan2-pytorch", "generator", pretrained="face_paint_512_v2")
model = torch.hub.load("bryandlee/animegan2-pytorch", "generator", pretrained="paprika")
```

You can also load the `face2paint` util function. First, install dependencies:
Expand All @@ -40,7 +40,7 @@ pip install torchvision Pillow numpy
Then, import the function using `torch.hub`:
```python
face2paint = torch.hub.load(
'xhlulu/animegan2-pytorch', 'face2paint',
'bryandlee/animegan2-pytorch', 'face2paint',
size=512, device="cpu"
)

Expand Down
2 changes: 1 addition & 1 deletion hubconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
def generator(pretrained=True, device="cpu", progress=True, check_hash=True):
from model import Generator

release_url = "https://github.com/xhlulu/animegan2-pytorch/raw/main/weights"
release_url = "https://github.com/bryandlee/animegan2-pytorch/raw/main/weights"
known = {
name: f"{release_url}/{name}.pt"
for name in [
Expand Down

0 comments on commit 0fbe994

Please sign in to comment.