You can also load the `face2paint` util function. First, install dependencies:
```
pip install torchvision Pillow numpy
```
Then, import the function using `torch.hub`:
```python
face2paint=torch.hub.load(
'bryandlee/animegan2-pytorch','face2paint',
size=512,device="cpu"
)
img=Image.open(...).convert("RGB")
out=face2paint(model,img)
```
**Updates**
**Updates**
*`2021-10-17` Add weights for [face portrait v2](https://github.com/bryandlee/animegan2-pytorch#additional-models)
*`2021-10-17` Add weights for [face portrait v2](https://github.com/bryandlee/animegan2-pytorch#additional-models)
...
@@ -55,6 +8,10 @@ out = face2paint(model, img)
...
@@ -55,6 +8,10 @@ out = face2paint(model, img)
See demo: [](https://huggingface.co/spaces/akhaliq/AnimeGANv2)
See demo: [](https://huggingface.co/spaces/akhaliq/AnimeGANv2)
*`2021-11-07` Thanks to [xhlulu](https://github.com/xhlulu), the model can be loaded using torch.hub.
## Basic Usage
**Weight Conversion from the Original Repo (Requires TensorFlow 1.x)**
**Weight Conversion from the Original Repo (Requires TensorFlow 1.x)**