Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
animegan2-pytorch
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
git
animegan2-pytorch
Commits
0fbe994c
Commit
0fbe994c
authored
Nov 07, 2021
by
Xing Han Lu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change repo username
parent
6310782e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
README.md
README.md
+7
-7
hubconf.py
hubconf.py
+1
-1
No files found.
README.md
View file @
0fbe994c
...
...
@@ -7,7 +7,7 @@ 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
)
```
...
...
@@ -15,7 +15,7 @@ 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
...
...
@@ -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:
...
...
@@ -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"
)
...
...
hubconf.py
View file @
0fbe994c
...
...
@@ -3,7 +3,7 @@ import torch
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
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment