Xin Liu
commited on
test
Browse files- Thin-Plate-Spline-Motion-Model/LICENSE +21 -0
- Thin-Plate-Spline-Motion-Model/README.md +107 -0
- Thin-Plate-Spline-Motion-Model/assets/driving.mp4 +0 -0
- Thin-Plate-Spline-Motion-Model/assets/source.png +0 -0
- Thin-Plate-Spline-Motion-Model/augmentation.py +344 -0
- Thin-Plate-Spline-Motion-Model/cog.yaml +40 -0
- Thin-Plate-Spline-Motion-Model/config/mgif-256.yaml +75 -0
- Thin-Plate-Spline-Motion-Model/config/taichi-256.yaml +134 -0
- Thin-Plate-Spline-Motion-Model/config/ted-384.yaml +73 -0
- Thin-Plate-Spline-Motion-Model/config/vox-256.yaml +74 -0
- Thin-Plate-Spline-Motion-Model/demo.ipynb +0 -0
- Thin-Plate-Spline-Motion-Model/demo.py +179 -0
- Thin-Plate-Spline-Motion-Model/frames_dataset.py +173 -0
- Thin-Plate-Spline-Motion-Model/logger.py +212 -0
- Thin-Plate-Spline-Motion-Model/modules/avd_network.py +65 -0
- Thin-Plate-Spline-Motion-Model/modules/bg_motion_predictor.py +24 -0
- Thin-Plate-Spline-Motion-Model/modules/dense_motion.py +164 -0
- Thin-Plate-Spline-Motion-Model/modules/inpainting_network.py +127 -0
- Thin-Plate-Spline-Motion-Model/modules/keypoint_detector.py +27 -0
- Thin-Plate-Spline-Motion-Model/modules/model.py +182 -0
- Thin-Plate-Spline-Motion-Model/modules/util.py +349 -0
- Thin-Plate-Spline-Motion-Model/predict.py +125 -0
- Thin-Plate-Spline-Motion-Model/reconstruction.py +69 -0
- Thin-Plate-Spline-Motion-Model/requirements.txt +25 -0
- Thin-Plate-Spline-Motion-Model/run.py +89 -0
- Thin-Plate-Spline-Motion-Model/train.py +94 -0
- Thin-Plate-Spline-Motion-Model/train_avd.py +91 -0
- app.py +784 -0
- packages.txt +298 -0
- requirements.txt +603 -0
- style.css +362 -0
Thin-Plate-Spline-Motion-Model/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2021 yoyo-nb
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
Thin-Plate-Spline-Motion-Model/README.md
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# [CVPR2022] Thin-Plate Spline Motion Model for Image Animation
|
2 |
+
|
3 |
+
[](LICENSE)
|
4 |
+

|
5 |
+

|
6 |
+
|
7 |
+
Source code of the CVPR'2022 paper "Thin-Plate Spline Motion Model for Image Animation"
|
8 |
+
|
9 |
+
[**Paper**](https://arxiv.org/abs/2203.14367) **|** [**Supp**](https://cloud.tsinghua.edu.cn/f/f7b8573bb5b04583949f/?dl=1)
|
10 |
+
|
11 |
+
### Example animation
|
12 |
+
|
13 |
+

|
14 |
+

|
15 |
+
|
16 |
+
**PS**: The paper trains the model for 100 epochs for a fair comparison. You can use more data and train for more epochs to get better performance.
|
17 |
+
|
18 |
+
|
19 |
+
### Web demo for animation
|
20 |
+
- Integrated into [Huggingface Spaces 🤗](https://huggingface.co/spaces) using [Gradio](https://github.com/gradio-app/gradio). Try out the Web Demo: [](https://huggingface.co/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model)
|
21 |
+
- Try the web demo for animation here: [](https://replicate.com/yoyo-nb/thin-plate-spline-motion-model)
|
22 |
+
- Google Colab: [](https://colab.research.google.com/drive/1DREfdpnaBhqISg0fuQlAAIwyGVn1loH_?usp=sharing)
|
23 |
+
|
24 |
+
### Pre-trained models
|
25 |
+
- ~~[Tsinghua Cloud](https://cloud.tsinghua.edu.cn/d/30ab8765da364fefa101/)~~
|
26 |
+
- [Yandex](https://disk.yandex.com/d/bWopgbGj1ZUV1w)
|
27 |
+
- [Google Drive](https://drive.google.com/drive/folders/1pNDo1ODQIb5HVObRtCmubqJikmR7VVLT?usp=sharing)
|
28 |
+
- [Baidu Yun](https://pan.baidu.com/s/1hnXmDpIbRC6WqE3tF9c5QA?pwd=1234)
|
29 |
+
|
30 |
+
### Installation
|
31 |
+
|
32 |
+
We support ```python3```.(Recommended version is Python 3.9).
|
33 |
+
To install the dependencies run:
|
34 |
+
```bash
|
35 |
+
pip install -r requirements.txt
|
36 |
+
```
|
37 |
+
|
38 |
+
|
39 |
+
### YAML configs
|
40 |
+
|
41 |
+
There are several configuration files one for each `dataset` in the `config` folder named as ```config/dataset_name.yaml```.
|
42 |
+
|
43 |
+
See description of the parameters in the ```config/taichi-256.yaml```.
|
44 |
+
|
45 |
+
### Datasets
|
46 |
+
|
47 |
+
1) **MGif**. Follow [Monkey-Net](https://github.com/AliaksandrSiarohin/monkey-net).
|
48 |
+
|
49 |
+
2) **TaiChiHD** and **VoxCeleb**. Follow instructions from [video-preprocessing](https://github.com/AliaksandrSiarohin/video-preprocessing).
|
50 |
+
|
51 |
+
3) **TED-talks**. Follow instructions from [MRAA](https://github.com/snap-research/articulated-animation).
|
52 |
+
|
53 |
+
Here are **VoxCeleb**, **TaiChiHD** and **TED-talks** pre-processed datasets used in the paper. [Baidu Yun](https://pan.baidu.com/s/1HKJOtXBIiP_tlLiFbzn3oA?pwd=x7xv)
|
54 |
+
Download all files under the folder, then merge the files and decompress, for example:
|
55 |
+
```bash
|
56 |
+
cat vox.tar.* > vox.tar
|
57 |
+
tar xvf vox.tar
|
58 |
+
```
|
59 |
+
|
60 |
+
|
61 |
+
### Training
|
62 |
+
To train a model on specific dataset run:
|
63 |
+
```
|
64 |
+
CUDA_VISIBLE_DEVICES=0,1 python run.py --config config/dataset_name.yaml --device_ids 0,1
|
65 |
+
```
|
66 |
+
A log folder named after the timestamp will be created. Checkpoints, loss values, reconstruction results will be saved to this folder.
|
67 |
+
|
68 |
+
|
69 |
+
#### Training AVD network
|
70 |
+
To train a model on specific dataset run:
|
71 |
+
```
|
72 |
+
CUDA_VISIBLE_DEVICES=0 python run.py --mode train_avd --checkpoint '{checkpoint_folder}/checkpoint.pth.tar' --config config/dataset_name.yaml
|
73 |
+
```
|
74 |
+
Checkpoints, loss values, reconstruction results will be saved to `{checkpoint_folder}`.
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
### Evaluation on video reconstruction
|
79 |
+
|
80 |
+
To evaluate the reconstruction performance run:
|
81 |
+
```
|
82 |
+
CUDA_VISIBLE_DEVICES=0 python run.py --mode reconstruction --config config/dataset_name.yaml --checkpoint '{checkpoint_folder}/checkpoint.pth.tar'
|
83 |
+
```
|
84 |
+
The `reconstruction` subfolder will be created in `{checkpoint_folder}`.
|
85 |
+
The generated video will be stored to this folder, also generated videos will be stored in ```png``` subfolder in loss-less '.png' format for evaluation.
|
86 |
+
To compute metrics, follow instructions from [pose-evaluation](https://github.com/AliaksandrSiarohin/pose-evaluation).
|
87 |
+
|
88 |
+
|
89 |
+
### Image animation demo
|
90 |
+
- notebook: `demo.ipynb`, edit the config cell and run for image animation.
|
91 |
+
- python:
|
92 |
+
```bash
|
93 |
+
CUDA_VISIBLE_DEVICES=0 python demo.py --config config/vox-256.yaml --checkpoint checkpoints/vox.pth.tar --source_image ./source.jpg --driving_video ./driving.mp4
|
94 |
+
```
|
95 |
+
|
96 |
+
# Acknowledgments
|
97 |
+
The main code is based upon [FOMM](https://github.com/AliaksandrSiarohin/first-order-model) and [MRAA](https://github.com/snap-research/articulated-animation)
|
98 |
+
|
99 |
+
Thanks for the excellent works!
|
100 |
+
|
101 |
+
And Thanks to:
|
102 |
+
|
103 |
+
- [@chenxwh](https://github.com/chenxwh): Add Web Demo & Docker environment [](https://replicate.com/yoyo-nb/thin-plate-spline-motion-model)
|
104 |
+
|
105 |
+
- [@TalkUHulk](https://github.com/TalkUHulk): The C++/Python demo is provided in [Image-Animation-Turbo-Boost](https://github.com/TalkUHulk/Image-Animation-Turbo-Boost)
|
106 |
+
|
107 |
+
- [@AK391](https://github.com/AK391): Add huggingface web demo [](https://huggingface.co/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model)
|
Thin-Plate-Spline-Motion-Model/assets/driving.mp4
ADDED
Binary file (556 kB). View file
|
|
Thin-Plate-Spline-Motion-Model/assets/source.png
ADDED
![]() |
Thin-Plate-Spline-Motion-Model/augmentation.py
ADDED
@@ -0,0 +1,344 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
Code from https://github.com/hassony2/torch_videovision
|
3 |
+
"""
|
4 |
+
|
5 |
+
import numbers
|
6 |
+
|
7 |
+
import random
|
8 |
+
import numpy as np
|
9 |
+
import PIL
|
10 |
+
|
11 |
+
from skimage.transform import resize, rotate
|
12 |
+
import torchvision
|
13 |
+
|
14 |
+
import warnings
|
15 |
+
|
16 |
+
from skimage import img_as_ubyte, img_as_float
|
17 |
+
|
18 |
+
|
19 |
+
def crop_clip(clip, min_h, min_w, h, w):
|
20 |
+
if isinstance(clip[0], np.ndarray):
|
21 |
+
cropped = [img[min_h:min_h + h, min_w:min_w + w, :] for img in clip]
|
22 |
+
|
23 |
+
elif isinstance(clip[0], PIL.Image.Image):
|
24 |
+
cropped = [
|
25 |
+
img.crop((min_w, min_h, min_w + w, min_h + h)) for img in clip
|
26 |
+
]
|
27 |
+
else:
|
28 |
+
raise TypeError('Expected numpy.ndarray or PIL.Image' +
|
29 |
+
'but got list of {0}'.format(type(clip[0])))
|
30 |
+
return cropped
|
31 |
+
|
32 |
+
|
33 |
+
def pad_clip(clip, h, w):
|
34 |
+
im_h, im_w = clip[0].shape[:2]
|
35 |
+
pad_h = (0, 0) if h < im_h else ((h - im_h) // 2, (h - im_h + 1) // 2)
|
36 |
+
pad_w = (0, 0) if w < im_w else ((w - im_w) // 2, (w - im_w + 1) // 2)
|
37 |
+
|
38 |
+
return np.pad(clip, ((0, 0), pad_h, pad_w, (0, 0)), mode='edge')
|
39 |
+
|
40 |
+
|
41 |
+
def resize_clip(clip, size, interpolation='bilinear'):
|
42 |
+
if isinstance(clip[0], np.ndarray):
|
43 |
+
if isinstance(size, numbers.Number):
|
44 |
+
im_h, im_w, im_c = clip[0].shape
|
45 |
+
# Min spatial dim already matches minimal size
|
46 |
+
if (im_w <= im_h and im_w == size) or (im_h <= im_w
|
47 |
+
and im_h == size):
|
48 |
+
return clip
|
49 |
+
new_h, new_w = get_resize_sizes(im_h, im_w, size)
|
50 |
+
size = (new_w, new_h)
|
51 |
+
else:
|
52 |
+
size = size[1], size[0]
|
53 |
+
|
54 |
+
scaled = [
|
55 |
+
resize(img, size, order=1 if interpolation == 'bilinear' else 0, preserve_range=True,
|
56 |
+
mode='constant', anti_aliasing=True) for img in clip
|
57 |
+
]
|
58 |
+
elif isinstance(clip[0], PIL.Image.Image):
|
59 |
+
if isinstance(size, numbers.Number):
|
60 |
+
im_w, im_h = clip[0].size
|
61 |
+
# Min spatial dim already matches minimal size
|
62 |
+
if (im_w <= im_h and im_w == size) or (im_h <= im_w
|
63 |
+
and im_h == size):
|
64 |
+
return clip
|
65 |
+
new_h, new_w = get_resize_sizes(im_h, im_w, size)
|
66 |
+
size = (new_w, new_h)
|
67 |
+
else:
|
68 |
+
size = size[1], size[0]
|
69 |
+
if interpolation == 'bilinear':
|
70 |
+
pil_inter = PIL.Image.NEAREST
|
71 |
+
else:
|
72 |
+
pil_inter = PIL.Image.BILINEAR
|
73 |
+
scaled = [img.resize(size, pil_inter) for img in clip]
|
74 |
+
else:
|
75 |
+
raise TypeError('Expected numpy.ndarray or PIL.Image' +
|
76 |
+
'but got list of {0}'.format(type(clip[0])))
|
77 |
+
return scaled
|
78 |
+
|
79 |
+
|
80 |
+
def get_resize_sizes(im_h, im_w, size):
|
81 |
+
if im_w < im_h:
|
82 |
+
ow = size
|
83 |
+
oh = int(size * im_h / im_w)
|
84 |
+
else:
|
85 |
+
oh = size
|
86 |
+
ow = int(size * im_w / im_h)
|
87 |
+
return oh, ow
|
88 |
+
|
89 |
+
|
90 |
+
class RandomFlip(object):
|
91 |
+
def __init__(self, time_flip=False, horizontal_flip=False):
|
92 |
+
self.time_flip = time_flip
|
93 |
+
self.horizontal_flip = horizontal_flip
|
94 |
+
|
95 |
+
def __call__(self, clip):
|
96 |
+
if random.random() < 0.5 and self.time_flip:
|
97 |
+
return clip[::-1]
|
98 |
+
if random.random() < 0.5 and self.horizontal_flip:
|
99 |
+
return [np.fliplr(img) for img in clip]
|
100 |
+
|
101 |
+
return clip
|
102 |
+
|
103 |
+
|
104 |
+
class RandomResize(object):
|
105 |
+
"""Resizes a list of (H x W x C) numpy.ndarray to the final size
|
106 |
+
The larger the original image is, the more times it takes to
|
107 |
+
interpolate
|
108 |
+
Args:
|
109 |
+
interpolation (str): Can be one of 'nearest', 'bilinear'
|
110 |
+
defaults to nearest
|
111 |
+
size (tuple): (widht, height)
|
112 |
+
"""
|
113 |
+
|
114 |
+
def __init__(self, ratio=(3. / 4., 4. / 3.), interpolation='nearest'):
|
115 |
+
self.ratio = ratio
|
116 |
+
self.interpolation = interpolation
|
117 |
+
|
118 |
+
def __call__(self, clip):
|
119 |
+
scaling_factor = random.uniform(self.ratio[0], self.ratio[1])
|
120 |
+
|
121 |
+
if isinstance(clip[0], np.ndarray):
|
122 |
+
im_h, im_w, im_c = clip[0].shape
|
123 |
+
elif isinstance(clip[0], PIL.Image.Image):
|
124 |
+
im_w, im_h = clip[0].size
|
125 |
+
|
126 |
+
new_w = int(im_w * scaling_factor)
|
127 |
+
new_h = int(im_h * scaling_factor)
|
128 |
+
new_size = (new_w, new_h)
|
129 |
+
resized = resize_clip(
|
130 |
+
clip, new_size, interpolation=self.interpolation)
|
131 |
+
|
132 |
+
return resized
|
133 |
+
|
134 |
+
|
135 |
+
class RandomCrop(object):
|
136 |
+
"""Extract random crop at the same location for a list of videos
|
137 |
+
Args:
|
138 |
+
size (sequence or int): Desired output size for the
|
139 |
+
crop in format (h, w)
|
140 |
+
"""
|
141 |
+
|
142 |
+
def __init__(self, size):
|
143 |
+
if isinstance(size, numbers.Number):
|
144 |
+
size = (size, size)
|
145 |
+
|
146 |
+
self.size = size
|
147 |
+
|
148 |
+
def __call__(self, clip):
|
149 |
+
"""
|
150 |
+
Args:
|
151 |
+
img (PIL.Image or numpy.ndarray): List of videos to be cropped
|
152 |
+
in format (h, w, c) in numpy.ndarray
|
153 |
+
Returns:
|
154 |
+
PIL.Image or numpy.ndarray: Cropped list of videos
|
155 |
+
"""
|
156 |
+
h, w = self.size
|
157 |
+
if isinstance(clip[0], np.ndarray):
|
158 |
+
im_h, im_w, im_c = clip[0].shape
|
159 |
+
elif isinstance(clip[0], PIL.Image.Image):
|
160 |
+
im_w, im_h = clip[0].size
|
161 |
+
else:
|
162 |
+
raise TypeError('Expected numpy.ndarray or PIL.Image' +
|
163 |
+
'but got list of {0}'.format(type(clip[0])))
|
164 |
+
|
165 |
+
clip = pad_clip(clip, h, w)
|
166 |
+
im_h, im_w = clip.shape[1:3]
|
167 |
+
x1 = 0 if h == im_h else random.randint(0, im_w - w)
|
168 |
+
y1 = 0 if w == im_w else random.randint(0, im_h - h)
|
169 |
+
cropped = crop_clip(clip, y1, x1, h, w)
|
170 |
+
|
171 |
+
return cropped
|
172 |
+
|
173 |
+
|
174 |
+
class RandomRotation(object):
|
175 |
+
"""Rotate entire clip randomly by a random angle within
|
176 |
+
given bounds
|
177 |
+
Args:
|
178 |
+
degrees (sequence or int): Range of degrees to select from
|
179 |
+
If degrees is a number instead of sequence like (min, max),
|
180 |
+
the range of degrees, will be (-degrees, +degrees).
|
181 |
+
"""
|
182 |
+
|
183 |
+
def __init__(self, degrees):
|
184 |
+
if isinstance(degrees, numbers.Number):
|
185 |
+
if degrees < 0:
|
186 |
+
raise ValueError('If degrees is a single number,'
|
187 |
+
'must be positive')
|
188 |
+
degrees = (-degrees, degrees)
|
189 |
+
else:
|
190 |
+
if len(degrees) != 2:
|
191 |
+
raise ValueError('If degrees is a sequence,'
|
192 |
+
'it must be of len 2.')
|
193 |
+
|
194 |
+
self.degrees = degrees
|
195 |
+
|
196 |
+
def __call__(self, clip):
|
197 |
+
"""
|
198 |
+
Args:
|
199 |
+
img (PIL.Image or numpy.ndarray): List of videos to be cropped
|
200 |
+
in format (h, w, c) in numpy.ndarray
|
201 |
+
Returns:
|
202 |
+
PIL.Image or numpy.ndarray: Cropped list of videos
|
203 |
+
"""
|
204 |
+
angle = random.uniform(self.degrees[0], self.degrees[1])
|
205 |
+
if isinstance(clip[0], np.ndarray):
|
206 |
+
rotated = [rotate(image=img, angle=angle, preserve_range=True) for img in clip]
|
207 |
+
elif isinstance(clip[0], PIL.Image.Image):
|
208 |
+
rotated = [img.rotate(angle) for img in clip]
|
209 |
+
else:
|
210 |
+
raise TypeError('Expected numpy.ndarray or PIL.Image' +
|
211 |
+
'but got list of {0}'.format(type(clip[0])))
|
212 |
+
|
213 |
+
return rotated
|
214 |
+
|
215 |
+
|
216 |
+
class ColorJitter(object):
|
217 |
+
"""Randomly change the brightness, contrast and saturation and hue of the clip
|
218 |
+
Args:
|
219 |
+
brightness (float): How much to jitter brightness. brightness_factor
|
220 |
+
is chosen uniformly from [max(0, 1 - brightness), 1 + brightness].
|
221 |
+
contrast (float): How much to jitter contrast. contrast_factor
|
222 |
+
is chosen uniformly from [max(0, 1 - contrast), 1 + contrast].
|
223 |
+
saturation (float): How much to jitter saturation. saturation_factor
|
224 |
+
is chosen uniformly from [max(0, 1 - saturation), 1 + saturation].
|
225 |
+
hue(float): How much to jitter hue. hue_factor is chosen uniformly from
|
226 |
+
[-hue, hue]. Should be >=0 and <= 0.5.
|
227 |
+
"""
|
228 |
+
|
229 |
+
def __init__(self, brightness=0, contrast=0, saturation=0, hue=0):
|
230 |
+
self.brightness = brightness
|
231 |
+
self.contrast = contrast
|
232 |
+
self.saturation = saturation
|
233 |
+
self.hue = hue
|
234 |
+
|
235 |
+
def get_params(self, brightness, contrast, saturation, hue):
|
236 |
+
if brightness > 0:
|
237 |
+
brightness_factor = random.uniform(
|
238 |
+
max(0, 1 - brightness), 1 + brightness)
|
239 |
+
else:
|
240 |
+
brightness_factor = None
|
241 |
+
|
242 |
+
if contrast > 0:
|
243 |
+
contrast_factor = random.uniform(
|
244 |
+
max(0, 1 - contrast), 1 + contrast)
|
245 |
+
else:
|
246 |
+
contrast_factor = None
|
247 |
+
|
248 |
+
if saturation > 0:
|
249 |
+
saturation_factor = random.uniform(
|
250 |
+
max(0, 1 - saturation), 1 + saturation)
|
251 |
+
else:
|
252 |
+
saturation_factor = None
|
253 |
+
|
254 |
+
if hue > 0:
|
255 |
+
hue_factor = random.uniform(-hue, hue)
|
256 |
+
else:
|
257 |
+
hue_factor = None
|
258 |
+
return brightness_factor, contrast_factor, saturation_factor, hue_factor
|
259 |
+
|
260 |
+
def __call__(self, clip):
|
261 |
+
"""
|
262 |
+
Args:
|
263 |
+
clip (list): list of PIL.Image
|
264 |
+
Returns:
|
265 |
+
list PIL.Image : list of transformed PIL.Image
|
266 |
+
"""
|
267 |
+
if isinstance(clip[0], np.ndarray):
|
268 |
+
brightness, contrast, saturation, hue = self.get_params(
|
269 |
+
self.brightness, self.contrast, self.saturation, self.hue)
|
270 |
+
|
271 |
+
# Create img transform function sequence
|
272 |
+
img_transforms = []
|
273 |
+
if brightness is not None:
|
274 |
+
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_brightness(img, brightness))
|
275 |
+
if saturation is not None:
|
276 |
+
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_saturation(img, saturation))
|
277 |
+
if hue is not None:
|
278 |
+
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_hue(img, hue))
|
279 |
+
if contrast is not None:
|
280 |
+
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_contrast(img, contrast))
|
281 |
+
random.shuffle(img_transforms)
|
282 |
+
img_transforms = [img_as_ubyte, torchvision.transforms.ToPILImage()] + img_transforms + [np.array,
|
283 |
+
img_as_float]
|
284 |
+
|
285 |
+
with warnings.catch_warnings():
|
286 |
+
warnings.simplefilter("ignore")
|
287 |
+
jittered_clip = []
|
288 |
+
for img in clip:
|
289 |
+
jittered_img = img
|
290 |
+
for func in img_transforms:
|
291 |
+
jittered_img = func(jittered_img)
|
292 |
+
jittered_clip.append(jittered_img.astype('float32'))
|
293 |
+
elif isinstance(clip[0], PIL.Image.Image):
|
294 |
+
brightness, contrast, saturation, hue = self.get_params(
|
295 |
+
self.brightness, self.contrast, self.saturation, self.hue)
|
296 |
+
|
297 |
+
# Create img transform function sequence
|
298 |
+
img_transforms = []
|
299 |
+
if brightness is not None:
|
300 |
+
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_brightness(img, brightness))
|
301 |
+
if saturation is not None:
|
302 |
+
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_saturation(img, saturation))
|
303 |
+
if hue is not None:
|
304 |
+
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_hue(img, hue))
|
305 |
+
if contrast is not None:
|
306 |
+
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_contrast(img, contrast))
|
307 |
+
random.shuffle(img_transforms)
|
308 |
+
|
309 |
+
# Apply to all videos
|
310 |
+
jittered_clip = []
|
311 |
+
for img in clip:
|
312 |
+
for func in img_transforms:
|
313 |
+
jittered_img = func(img)
|
314 |
+
jittered_clip.append(jittered_img)
|
315 |
+
|
316 |
+
else:
|
317 |
+
raise TypeError('Expected numpy.ndarray or PIL.Image' +
|
318 |
+
'but got list of {0}'.format(type(clip[0])))
|
319 |
+
return jittered_clip
|
320 |
+
|
321 |
+
|
322 |
+
class AllAugmentationTransform:
|
323 |
+
def __init__(self, resize_param=None, rotation_param=None, flip_param=None, crop_param=None, jitter_param=None):
|
324 |
+
self.transforms = []
|
325 |
+
|
326 |
+
if flip_param is not None:
|
327 |
+
self.transforms.append(RandomFlip(**flip_param))
|
328 |
+
|
329 |
+
if rotation_param is not None:
|
330 |
+
self.transforms.append(RandomRotation(**rotation_param))
|
331 |
+
|
332 |
+
if resize_param is not None:
|
333 |
+
self.transforms.append(RandomResize(**resize_param))
|
334 |
+
|
335 |
+
if crop_param is not None:
|
336 |
+
self.transforms.append(RandomCrop(**crop_param))
|
337 |
+
|
338 |
+
if jitter_param is not None:
|
339 |
+
self.transforms.append(ColorJitter(**jitter_param))
|
340 |
+
|
341 |
+
def __call__(self, clip):
|
342 |
+
for t in self.transforms:
|
343 |
+
clip = t(clip)
|
344 |
+
return clip
|
Thin-Plate-Spline-Motion-Model/cog.yaml
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
build:
|
2 |
+
cuda: "11.0"
|
3 |
+
gpu: true
|
4 |
+
python_version: "3.8"
|
5 |
+
system_packages:
|
6 |
+
- "libgl1-mesa-glx"
|
7 |
+
- "libglib2.0-0"
|
8 |
+
- "ninja-build"
|
9 |
+
python_packages:
|
10 |
+
- "ipython==7.21.0"
|
11 |
+
- "torch==1.10.1"
|
12 |
+
- "torchvision==0.11.2"
|
13 |
+
- "cffi==1.14.6"
|
14 |
+
- "cycler==0.10.0"
|
15 |
+
- "decorator==5.1.0"
|
16 |
+
- "face-alignment==1.3.5"
|
17 |
+
- "imageio==2.9.0"
|
18 |
+
- "imageio-ffmpeg==0.4.5"
|
19 |
+
- "kiwisolver==1.3.2"
|
20 |
+
- "matplotlib==3.4.3"
|
21 |
+
- "networkx==2.6.3"
|
22 |
+
- "numpy==1.20.3"
|
23 |
+
- "pandas==1.3.3"
|
24 |
+
- "Pillow==8.3.2"
|
25 |
+
- "pycparser==2.20"
|
26 |
+
- "pyparsing==2.4.7"
|
27 |
+
- "python-dateutil==2.8.2"
|
28 |
+
- "pytz==2021.1"
|
29 |
+
- "PyWavelets==1.1.1"
|
30 |
+
- "PyYAML==5.4.1"
|
31 |
+
- "scikit-image==0.18.3"
|
32 |
+
- "scikit-learn==1.0"
|
33 |
+
- "scipy==1.7.1"
|
34 |
+
- "six==1.16.0"
|
35 |
+
- "tqdm==4.62.3"
|
36 |
+
- "cmake==3.21.3"
|
37 |
+
run:
|
38 |
+
- pip install dlib
|
39 |
+
|
40 |
+
predict: "predict.py:Predictor"
|
Thin-Plate-Spline-Motion-Model/config/mgif-256.yaml
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
dataset_params:
|
2 |
+
root_dir: ../moving-gif
|
3 |
+
frame_shape: null
|
4 |
+
id_sampling: False
|
5 |
+
augmentation_params:
|
6 |
+
flip_param:
|
7 |
+
horizontal_flip: True
|
8 |
+
time_flip: True
|
9 |
+
crop_param:
|
10 |
+
size: [256, 256]
|
11 |
+
resize_param:
|
12 |
+
ratio: [0.9, 1.1]
|
13 |
+
jitter_param:
|
14 |
+
hue: 0.5
|
15 |
+
|
16 |
+
model_params:
|
17 |
+
common_params:
|
18 |
+
num_tps: 10
|
19 |
+
num_channels: 3
|
20 |
+
bg: False
|
21 |
+
multi_mask: True
|
22 |
+
generator_params:
|
23 |
+
block_expansion: 64
|
24 |
+
max_features: 512
|
25 |
+
num_down_blocks: 3
|
26 |
+
dense_motion_params:
|
27 |
+
block_expansion: 64
|
28 |
+
max_features: 1024
|
29 |
+
num_blocks: 5
|
30 |
+
scale_factor: 0.25
|
31 |
+
avd_network_params:
|
32 |
+
id_bottle_size: 128
|
33 |
+
pose_bottle_size: 128
|
34 |
+
|
35 |
+
|
36 |
+
train_params:
|
37 |
+
num_epochs: 100
|
38 |
+
num_repeats: 50
|
39 |
+
epoch_milestones: [70, 90]
|
40 |
+
lr_generator: 2.0e-4
|
41 |
+
batch_size: 28
|
42 |
+
scales: [1, 0.5, 0.25, 0.125]
|
43 |
+
dataloader_workers: 12
|
44 |
+
checkpoint_freq: 50
|
45 |
+
dropout_epoch: 35
|
46 |
+
dropout_maxp: 0.5
|
47 |
+
dropout_startp: 0.2
|
48 |
+
dropout_inc_epoch: 10
|
49 |
+
bg_start: 0
|
50 |
+
transform_params:
|
51 |
+
sigma_affine: 0.05
|
52 |
+
sigma_tps: 0.005
|
53 |
+
points_tps: 5
|
54 |
+
loss_weights:
|
55 |
+
perceptual: [10, 10, 10, 10, 10]
|
56 |
+
equivariance_value: 10
|
57 |
+
warp_loss: 10
|
58 |
+
bg: 10
|
59 |
+
|
60 |
+
train_avd_params:
|
61 |
+
num_epochs: 100
|
62 |
+
num_repeats: 50
|
63 |
+
batch_size: 256
|
64 |
+
dataloader_workers: 24
|
65 |
+
checkpoint_freq: 10
|
66 |
+
epoch_milestones: [70, 90]
|
67 |
+
lr: 1.0e-3
|
68 |
+
lambda_shift: 1
|
69 |
+
lambda_affine: 1
|
70 |
+
random_scale: 0.25
|
71 |
+
|
72 |
+
visualizer_params:
|
73 |
+
kp_size: 5
|
74 |
+
draw_border: True
|
75 |
+
colormap: 'gist_rainbow'
|
Thin-Plate-Spline-Motion-Model/config/taichi-256.yaml
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Dataset parameters
|
2 |
+
# Each dataset should contain 2 folders train and test
|
3 |
+
# Each video can be represented as:
|
4 |
+
# - an image of concatenated frames
|
5 |
+
# - '.mp4' or '.gif'
|
6 |
+
# - folder with all frames from a specific video
|
7 |
+
# In case of Taichi. Same (youtube) video can be splitted in many parts (chunks). Each part has a following
|
8 |
+
# format (id)#other#info.mp4. For example '12335#adsbf.mp4' has an id 12335. In case of TaiChi id stands for youtube
|
9 |
+
# video id.
|
10 |
+
dataset_params:
|
11 |
+
# Path to data, data can be stored in several formats: .mp4 or .gif videos, stacked .png images or folders with frames.
|
12 |
+
root_dir: ../taichi
|
13 |
+
# Image shape, needed for staked .png format.
|
14 |
+
frame_shape: null
|
15 |
+
# In case of TaiChi single video can be splitted in many chunks, or the maybe several videos for single person.
|
16 |
+
# In this case epoch can be a pass over different videos (if id_sampling=True) or over different chunks (if id_sampling=False)
|
17 |
+
# If the name of the video '12335#adsbf.mp4' the id is assumed to be 12335
|
18 |
+
id_sampling: True
|
19 |
+
# Augmentation parameters see augmentation.py for all posible augmentations
|
20 |
+
augmentation_params:
|
21 |
+
flip_param:
|
22 |
+
horizontal_flip: True
|
23 |
+
time_flip: True
|
24 |
+
jitter_param:
|
25 |
+
brightness: 0.1
|
26 |
+
contrast: 0.1
|
27 |
+
saturation: 0.1
|
28 |
+
hue: 0.1
|
29 |
+
|
30 |
+
# Defines model architecture
|
31 |
+
model_params:
|
32 |
+
common_params:
|
33 |
+
# Number of TPS transformation
|
34 |
+
num_tps: 10
|
35 |
+
# Number of channels per image
|
36 |
+
num_channels: 3
|
37 |
+
# Whether to estimate affine background transformation
|
38 |
+
bg: True
|
39 |
+
# Whether to estimate the multi-resolution occlusion masks
|
40 |
+
multi_mask: True
|
41 |
+
generator_params:
|
42 |
+
# Number of features mutliplier
|
43 |
+
block_expansion: 64
|
44 |
+
# Maximum allowed number of features
|
45 |
+
max_features: 512
|
46 |
+
# Number of downsampling blocks and Upsampling blocks.
|
47 |
+
num_down_blocks: 3
|
48 |
+
dense_motion_params:
|
49 |
+
# Number of features mutliplier
|
50 |
+
block_expansion: 64
|
51 |
+
# Maximum allowed number of features
|
52 |
+
max_features: 1024
|
53 |
+
# Number of block in Unet.
|
54 |
+
num_blocks: 5
|
55 |
+
# Optical flow is predicted on smaller images for better performance,
|
56 |
+
# scale_factor=0.25 means that 256x256 image will be resized to 64x64
|
57 |
+
scale_factor: 0.25
|
58 |
+
avd_network_params:
|
59 |
+
# Bottleneck for identity branch
|
60 |
+
id_bottle_size: 128
|
61 |
+
# Bottleneck for pose branch
|
62 |
+
pose_bottle_size: 128
|
63 |
+
|
64 |
+
# Parameters of training
|
65 |
+
train_params:
|
66 |
+
# Number of training epochs
|
67 |
+
num_epochs: 100
|
68 |
+
# For better i/o performance when number of videos is small number of epochs can be multiplied by this number.
|
69 |
+
# Thus effectivlly with num_repeats=100 each epoch is 100 times larger.
|
70 |
+
num_repeats: 150
|
71 |
+
# Drop learning rate by 10 times after this epochs
|
72 |
+
epoch_milestones: [70, 90]
|
73 |
+
# Initial learing rate for all modules
|
74 |
+
lr_generator: 2.0e-4
|
75 |
+
batch_size: 28
|
76 |
+
# Scales for perceptual pyramide loss. If scales = [1, 0.5, 0.25, 0.125] and image resolution is 256x256,
|
77 |
+
# than the loss will be computer on resolutions 256x256, 128x128, 64x64, 32x32.
|
78 |
+
scales: [1, 0.5, 0.25, 0.125]
|
79 |
+
# Dataset preprocessing cpu workers
|
80 |
+
dataloader_workers: 12
|
81 |
+
# Save checkpoint this frequently. If checkpoint_freq=50, checkpoint will be saved every 50 epochs.
|
82 |
+
checkpoint_freq: 50
|
83 |
+
# Parameters of dropout
|
84 |
+
# The first dropout_epoch training uses dropout operation
|
85 |
+
dropout_epoch: 35
|
86 |
+
# The probability P will linearly increase from dropout_startp to dropout_maxp in dropout_inc_epoch epochs
|
87 |
+
dropout_maxp: 0.7
|
88 |
+
dropout_startp: 0.0
|
89 |
+
dropout_inc_epoch: 10
|
90 |
+
# Estimate affine background transformation from the bg_start epoch.
|
91 |
+
bg_start: 0
|
92 |
+
# Parameters of random TPS transformation for equivariance loss
|
93 |
+
transform_params:
|
94 |
+
# Sigma for affine part
|
95 |
+
sigma_affine: 0.05
|
96 |
+
# Sigma for deformation part
|
97 |
+
sigma_tps: 0.005
|
98 |
+
# Number of point in the deformation grid
|
99 |
+
points_tps: 5
|
100 |
+
loss_weights:
|
101 |
+
# Weights for perceptual loss.
|
102 |
+
perceptual: [10, 10, 10, 10, 10]
|
103 |
+
# Weights for value equivariance.
|
104 |
+
equivariance_value: 10
|
105 |
+
# Weights for warp loss.
|
106 |
+
warp_loss: 10
|
107 |
+
# Weights for bg loss.
|
108 |
+
bg: 10
|
109 |
+
|
110 |
+
# Parameters of training (animation-via-disentanglement)
|
111 |
+
train_avd_params:
|
112 |
+
# Number of training epochs, visualization is produced after each epoch.
|
113 |
+
num_epochs: 100
|
114 |
+
# For better i/o performance when number of videos is small number of epochs can be multiplied by this number.
|
115 |
+
# Thus effectively with num_repeats=100 each epoch is 100 times larger.
|
116 |
+
num_repeats: 150
|
117 |
+
# Batch size.
|
118 |
+
batch_size: 256
|
119 |
+
# Save checkpoint this frequently. If checkpoint_freq=50, checkpoint will be saved every 50 epochs.
|
120 |
+
checkpoint_freq: 10
|
121 |
+
# Dataset preprocessing cpu workers
|
122 |
+
dataloader_workers: 24
|
123 |
+
# Drop learning rate 10 times after this epochs
|
124 |
+
epoch_milestones: [70, 90]
|
125 |
+
# Initial learning rate
|
126 |
+
lr: 1.0e-3
|
127 |
+
# Weights for equivariance loss.
|
128 |
+
lambda_shift: 1
|
129 |
+
random_scale: 0.25
|
130 |
+
|
131 |
+
visualizer_params:
|
132 |
+
kp_size: 5
|
133 |
+
draw_border: True
|
134 |
+
colormap: 'gist_rainbow'
|
Thin-Plate-Spline-Motion-Model/config/ted-384.yaml
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
dataset_params:
|
2 |
+
root_dir: ../TED384-v2
|
3 |
+
frame_shape: null
|
4 |
+
id_sampling: True
|
5 |
+
augmentation_params:
|
6 |
+
flip_param:
|
7 |
+
horizontal_flip: True
|
8 |
+
time_flip: True
|
9 |
+
jitter_param:
|
10 |
+
brightness: 0.1
|
11 |
+
contrast: 0.1
|
12 |
+
saturation: 0.1
|
13 |
+
hue: 0.1
|
14 |
+
|
15 |
+
model_params:
|
16 |
+
common_params:
|
17 |
+
num_tps: 10
|
18 |
+
num_channels: 3
|
19 |
+
bg: True
|
20 |
+
multi_mask: True
|
21 |
+
generator_params:
|
22 |
+
block_expansion: 64
|
23 |
+
max_features: 512
|
24 |
+
num_down_blocks: 3
|
25 |
+
dense_motion_params:
|
26 |
+
block_expansion: 64
|
27 |
+
max_features: 1024
|
28 |
+
num_blocks: 5
|
29 |
+
scale_factor: 0.25
|
30 |
+
avd_network_params:
|
31 |
+
id_bottle_size: 128
|
32 |
+
pose_bottle_size: 128
|
33 |
+
|
34 |
+
|
35 |
+
train_params:
|
36 |
+
num_epochs: 100
|
37 |
+
num_repeats: 150
|
38 |
+
epoch_milestones: [70, 90]
|
39 |
+
lr_generator: 2.0e-4
|
40 |
+
batch_size: 12
|
41 |
+
scales: [1, 0.5, 0.25, 0.125]
|
42 |
+
dataloader_workers: 6
|
43 |
+
checkpoint_freq: 50
|
44 |
+
dropout_epoch: 35
|
45 |
+
dropout_maxp: 0.5
|
46 |
+
dropout_startp: 0.0
|
47 |
+
dropout_inc_epoch: 10
|
48 |
+
bg_start: 0
|
49 |
+
transform_params:
|
50 |
+
sigma_affine: 0.05
|
51 |
+
sigma_tps: 0.005
|
52 |
+
points_tps: 5
|
53 |
+
loss_weights:
|
54 |
+
perceptual: [10, 10, 10, 10, 10]
|
55 |
+
equivariance_value: 10
|
56 |
+
warp_loss: 10
|
57 |
+
bg: 10
|
58 |
+
|
59 |
+
train_avd_params:
|
60 |
+
num_epochs: 30
|
61 |
+
num_repeats: 500
|
62 |
+
batch_size: 256
|
63 |
+
dataloader_workers: 24
|
64 |
+
checkpoint_freq: 10
|
65 |
+
epoch_milestones: [20, 25]
|
66 |
+
lr: 1.0e-3
|
67 |
+
lambda_shift: 1
|
68 |
+
random_scale: 0.25
|
69 |
+
|
70 |
+
visualizer_params:
|
71 |
+
kp_size: 5
|
72 |
+
draw_border: True
|
73 |
+
colormap: 'gist_rainbow'
|
Thin-Plate-Spline-Motion-Model/config/vox-256.yaml
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
dataset_params:
|
2 |
+
root_dir: ../vox
|
3 |
+
frame_shape: null
|
4 |
+
id_sampling: True
|
5 |
+
augmentation_params:
|
6 |
+
flip_param:
|
7 |
+
horizontal_flip: True
|
8 |
+
time_flip: True
|
9 |
+
jitter_param:
|
10 |
+
brightness: 0.1
|
11 |
+
contrast: 0.1
|
12 |
+
saturation: 0.1
|
13 |
+
hue: 0.1
|
14 |
+
|
15 |
+
|
16 |
+
model_params:
|
17 |
+
common_params:
|
18 |
+
num_tps: 10
|
19 |
+
num_channels: 3
|
20 |
+
bg: True
|
21 |
+
multi_mask: True
|
22 |
+
generator_params:
|
23 |
+
block_expansion: 64
|
24 |
+
max_features: 512
|
25 |
+
num_down_blocks: 3
|
26 |
+
dense_motion_params:
|
27 |
+
block_expansion: 64
|
28 |
+
max_features: 1024
|
29 |
+
num_blocks: 5
|
30 |
+
scale_factor: 0.25
|
31 |
+
avd_network_params:
|
32 |
+
id_bottle_size: 128
|
33 |
+
pose_bottle_size: 128
|
34 |
+
|
35 |
+
|
36 |
+
train_params:
|
37 |
+
num_epochs: 100
|
38 |
+
num_repeats: 75
|
39 |
+
epoch_milestones: [70, 90]
|
40 |
+
lr_generator: 2.0e-4
|
41 |
+
batch_size: 28
|
42 |
+
scales: [1, 0.5, 0.25, 0.125]
|
43 |
+
dataloader_workers: 12
|
44 |
+
checkpoint_freq: 50
|
45 |
+
dropout_epoch: 35
|
46 |
+
dropout_maxp: 0.3
|
47 |
+
dropout_startp: 0.1
|
48 |
+
dropout_inc_epoch: 10
|
49 |
+
bg_start: 10
|
50 |
+
transform_params:
|
51 |
+
sigma_affine: 0.05
|
52 |
+
sigma_tps: 0.005
|
53 |
+
points_tps: 5
|
54 |
+
loss_weights:
|
55 |
+
perceptual: [10, 10, 10, 10, 10]
|
56 |
+
equivariance_value: 10
|
57 |
+
warp_loss: 10
|
58 |
+
bg: 10
|
59 |
+
|
60 |
+
train_avd_params:
|
61 |
+
num_epochs: 200
|
62 |
+
num_repeats: 300
|
63 |
+
batch_size: 256
|
64 |
+
dataloader_workers: 24
|
65 |
+
checkpoint_freq: 50
|
66 |
+
epoch_milestones: [140, 180]
|
67 |
+
lr: 1.0e-3
|
68 |
+
lambda_shift: 1
|
69 |
+
random_scale: 0.25
|
70 |
+
|
71 |
+
visualizer_params:
|
72 |
+
kp_size: 5
|
73 |
+
draw_border: True
|
74 |
+
colormap: 'gist_rainbow'
|
Thin-Plate-Spline-Motion-Model/demo.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
Thin-Plate-Spline-Motion-Model/demo.py
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import matplotlib
|
2 |
+
matplotlib.use('Agg')
|
3 |
+
import sys
|
4 |
+
import yaml
|
5 |
+
from argparse import ArgumentParser
|
6 |
+
from tqdm import tqdm
|
7 |
+
from scipy.spatial import ConvexHull
|
8 |
+
import numpy as np
|
9 |
+
import imageio
|
10 |
+
from skimage.transform import resize
|
11 |
+
from skimage import img_as_ubyte
|
12 |
+
import torch
|
13 |
+
from modules.inpainting_network import InpaintingNetwork
|
14 |
+
from modules.keypoint_detector import KPDetector
|
15 |
+
from modules.dense_motion import DenseMotionNetwork
|
16 |
+
from modules.avd_network import AVDNetwork
|
17 |
+
|
18 |
+
if sys.version_info[0] < 3:
|
19 |
+
raise Exception("You must use Python 3 or higher. Recommended version is Python 3.9")
|
20 |
+
|
21 |
+
def relative_kp(kp_source, kp_driving, kp_driving_initial):
|
22 |
+
|
23 |
+
source_area = ConvexHull(kp_source['fg_kp'][0].data.cpu().numpy()).volume
|
24 |
+
driving_area = ConvexHull(kp_driving_initial['fg_kp'][0].data.cpu().numpy()).volume
|
25 |
+
adapt_movement_scale = np.sqrt(source_area) / np.sqrt(driving_area)
|
26 |
+
|
27 |
+
kp_new = {k: v for k, v in kp_driving.items()}
|
28 |
+
|
29 |
+
kp_value_diff = (kp_driving['fg_kp'] - kp_driving_initial['fg_kp'])
|
30 |
+
kp_value_diff *= adapt_movement_scale
|
31 |
+
kp_new['fg_kp'] = kp_value_diff + kp_source['fg_kp']
|
32 |
+
|
33 |
+
return kp_new
|
34 |
+
|
35 |
+
def load_checkpoints(config_path, checkpoint_path, device):
|
36 |
+
with open(config_path) as f:
|
37 |
+
config = yaml.full_load(f)
|
38 |
+
|
39 |
+
inpainting = InpaintingNetwork(**config['model_params']['generator_params'],
|
40 |
+
**config['model_params']['common_params'])
|
41 |
+
kp_detector = KPDetector(**config['model_params']['common_params'])
|
42 |
+
dense_motion_network = DenseMotionNetwork(**config['model_params']['common_params'],
|
43 |
+
**config['model_params']['dense_motion_params'])
|
44 |
+
avd_network = AVDNetwork(num_tps=config['model_params']['common_params']['num_tps'],
|
45 |
+
**config['model_params']['avd_network_params'])
|
46 |
+
kp_detector.to(device)
|
47 |
+
dense_motion_network.to(device)
|
48 |
+
inpainting.to(device)
|
49 |
+
avd_network.to(device)
|
50 |
+
|
51 |
+
checkpoint = torch.load(checkpoint_path, map_location=device)
|
52 |
+
|
53 |
+
inpainting.load_state_dict(checkpoint['inpainting_network'])
|
54 |
+
kp_detector.load_state_dict(checkpoint['kp_detector'])
|
55 |
+
dense_motion_network.load_state_dict(checkpoint['dense_motion_network'])
|
56 |
+
if 'avd_network' in checkpoint:
|
57 |
+
avd_network.load_state_dict(checkpoint['avd_network'])
|
58 |
+
|
59 |
+
inpainting.eval()
|
60 |
+
kp_detector.eval()
|
61 |
+
dense_motion_network.eval()
|
62 |
+
avd_network.eval()
|
63 |
+
|
64 |
+
return inpainting, kp_detector, dense_motion_network, avd_network
|
65 |
+
|
66 |
+
|
67 |
+
def make_animation(source_image, driving_video, inpainting_network, kp_detector, dense_motion_network, avd_network, device, mode = 'relative'):
|
68 |
+
assert mode in ['standard', 'relative', 'avd']
|
69 |
+
with torch.no_grad():
|
70 |
+
predictions = []
|
71 |
+
source = torch.tensor(source_image[np.newaxis].astype(np.float32)).permute(0, 3, 1, 2)
|
72 |
+
source = source.to(device)
|
73 |
+
driving = torch.tensor(np.array(driving_video)[np.newaxis].astype(np.float32)).permute(0, 4, 1, 2, 3).to(device)
|
74 |
+
kp_source = kp_detector(source)
|
75 |
+
kp_driving_initial = kp_detector(driving[:, :, 0])
|
76 |
+
|
77 |
+
for frame_idx in tqdm(range(driving.shape[2])):
|
78 |
+
driving_frame = driving[:, :, frame_idx]
|
79 |
+
driving_frame = driving_frame.to(device)
|
80 |
+
kp_driving = kp_detector(driving_frame)
|
81 |
+
if mode == 'standard':
|
82 |
+
kp_norm = kp_driving
|
83 |
+
elif mode=='relative':
|
84 |
+
kp_norm = relative_kp(kp_source=kp_source, kp_driving=kp_driving,
|
85 |
+
kp_driving_initial=kp_driving_initial)
|
86 |
+
elif mode == 'avd':
|
87 |
+
kp_norm = avd_network(kp_source, kp_driving)
|
88 |
+
dense_motion = dense_motion_network(source_image=source, kp_driving=kp_norm,
|
89 |
+
kp_source=kp_source, bg_param = None,
|
90 |
+
dropout_flag = False)
|
91 |
+
out = inpainting_network(source, dense_motion)
|
92 |
+
|
93 |
+
predictions.append(np.transpose(out['prediction'].data.cpu().numpy(), [0, 2, 3, 1])[0])
|
94 |
+
return predictions
|
95 |
+
|
96 |
+
|
97 |
+
def find_best_frame(source, driving, cpu):
|
98 |
+
import face_alignment
|
99 |
+
|
100 |
+
def normalize_kp(kp):
|
101 |
+
kp = kp - kp.mean(axis=0, keepdims=True)
|
102 |
+
area = ConvexHull(kp[:, :2]).volume
|
103 |
+
area = np.sqrt(area)
|
104 |
+
kp[:, :2] = kp[:, :2] / area
|
105 |
+
return kp
|
106 |
+
|
107 |
+
fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, flip_input=True,
|
108 |
+
device= 'cpu' if cpu else 'cuda')
|
109 |
+
kp_source = fa.get_landmarks(255 * source)[0]
|
110 |
+
kp_source = normalize_kp(kp_source)
|
111 |
+
norm = float('inf')
|
112 |
+
frame_num = 0
|
113 |
+
for i, image in tqdm(enumerate(driving)):
|
114 |
+
try:
|
115 |
+
kp_driving = fa.get_landmarks(255 * image)[0]
|
116 |
+
kp_driving = normalize_kp(kp_driving)
|
117 |
+
new_norm = (np.abs(kp_source - kp_driving) ** 2).sum()
|
118 |
+
if new_norm < norm:
|
119 |
+
norm = new_norm
|
120 |
+
frame_num = i
|
121 |
+
except:
|
122 |
+
pass
|
123 |
+
return frame_num
|
124 |
+
|
125 |
+
|
126 |
+
if __name__ == "__main__":
|
127 |
+
parser = ArgumentParser()
|
128 |
+
parser.add_argument("--config", required=True, help="path to config")
|
129 |
+
parser.add_argument("--checkpoint", default='checkpoints/vox.pth.tar', help="path to checkpoint to restore")
|
130 |
+
|
131 |
+
parser.add_argument("--source_image", default='./assets/source.png', help="path to source image")
|
132 |
+
parser.add_argument("--driving_video", default='./assets/driving.mp4', help="path to driving video")
|
133 |
+
parser.add_argument("--result_video", default='./result.mp4', help="path to output")
|
134 |
+
|
135 |
+
parser.add_argument("--img_shape", default="256,256", type=lambda x: list(map(int, x.split(','))),
|
136 |
+
help='Shape of image, that the model was trained on.')
|
137 |
+
|
138 |
+
parser.add_argument("--mode", default='relative', choices=['standard', 'relative', 'avd'], help="Animate mode: ['standard', 'relative', 'avd'], when use the relative mode to animate a face, use '--find_best_frame' can get better quality result")
|
139 |
+
|
140 |
+
parser.add_argument("--find_best_frame", dest="find_best_frame", action="store_true",
|
141 |
+
help="Generate from the frame that is the most alligned with source. (Only for faces, requires face_aligment lib)")
|
142 |
+
|
143 |
+
parser.add_argument("--cpu", dest="cpu", action="store_true", help="cpu mode.")
|
144 |
+
|
145 |
+
opt = parser.parse_args()
|
146 |
+
|
147 |
+
source_image = imageio.imread(opt.source_image)
|
148 |
+
reader = imageio.get_reader(opt.driving_video)
|
149 |
+
fps = reader.get_meta_data()['fps']
|
150 |
+
driving_video = []
|
151 |
+
try:
|
152 |
+
for im in reader:
|
153 |
+
driving_video.append(im)
|
154 |
+
except RuntimeError:
|
155 |
+
pass
|
156 |
+
reader.close()
|
157 |
+
|
158 |
+
if opt.cpu:
|
159 |
+
device = torch.device('cpu')
|
160 |
+
else:
|
161 |
+
device = torch.device('cuda')
|
162 |
+
|
163 |
+
source_image = resize(source_image, opt.img_shape)[..., :3]
|
164 |
+
driving_video = [resize(frame, opt.img_shape)[..., :3] for frame in driving_video]
|
165 |
+
inpainting, kp_detector, dense_motion_network, avd_network = load_checkpoints(config_path = opt.config, checkpoint_path = opt.checkpoint, device = device)
|
166 |
+
|
167 |
+
if opt.find_best_frame:
|
168 |
+
i = find_best_frame(source_image, driving_video, opt.cpu)
|
169 |
+
print ("Best frame: " + str(i))
|
170 |
+
driving_forward = driving_video[i:]
|
171 |
+
driving_backward = driving_video[:(i+1)][::-1]
|
172 |
+
predictions_forward = make_animation(source_image, driving_forward, inpainting, kp_detector, dense_motion_network, avd_network, device = device, mode = opt.mode)
|
173 |
+
predictions_backward = make_animation(source_image, driving_backward, inpainting, kp_detector, dense_motion_network, avd_network, device = device, mode = opt.mode)
|
174 |
+
predictions = predictions_backward[::-1] + predictions_forward[1:]
|
175 |
+
else:
|
176 |
+
predictions = make_animation(source_image, driving_video, inpainting, kp_detector, dense_motion_network, avd_network, device = device, mode = opt.mode)
|
177 |
+
|
178 |
+
imageio.mimsave(opt.result_video, [img_as_ubyte(frame) for frame in predictions], fps=fps)
|
179 |
+
|
Thin-Plate-Spline-Motion-Model/frames_dataset.py
ADDED
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from skimage import io, img_as_float32
|
3 |
+
from skimage.color import gray2rgb
|
4 |
+
from sklearn.model_selection import train_test_split
|
5 |
+
from imageio import mimread
|
6 |
+
from skimage.transform import resize
|
7 |
+
import numpy as np
|
8 |
+
from torch.utils.data import Dataset
|
9 |
+
from augmentation import AllAugmentationTransform
|
10 |
+
import glob
|
11 |
+
from functools import partial
|
12 |
+
|
13 |
+
|
14 |
+
def read_video(name, frame_shape):
|
15 |
+
"""
|
16 |
+
Read video which can be:
|
17 |
+
- an image of concatenated frames
|
18 |
+
- '.mp4' and'.gif'
|
19 |
+
- folder with videos
|
20 |
+
"""
|
21 |
+
|
22 |
+
if os.path.isdir(name):
|
23 |
+
frames = sorted(os.listdir(name))
|
24 |
+
num_frames = len(frames)
|
25 |
+
video_array = np.array(
|
26 |
+
[img_as_float32(io.imread(os.path.join(name, frames[idx]))) for idx in range(num_frames)])
|
27 |
+
elif name.lower().endswith('.png') or name.lower().endswith('.jpg'):
|
28 |
+
image = io.imread(name)
|
29 |
+
|
30 |
+
if len(image.shape) == 2 or image.shape[2] == 1:
|
31 |
+
image = gray2rgb(image)
|
32 |
+
|
33 |
+
if image.shape[2] == 4:
|
34 |
+
image = image[..., :3]
|
35 |
+
|
36 |
+
image = img_as_float32(image)
|
37 |
+
|
38 |
+
video_array = np.moveaxis(image, 1, 0)
|
39 |
+
|
40 |
+
video_array = video_array.reshape((-1,) + frame_shape)
|
41 |
+
video_array = np.moveaxis(video_array, 1, 2)
|
42 |
+
elif name.lower().endswith('.gif') or name.lower().endswith('.mp4') or name.lower().endswith('.mov'):
|
43 |
+
video = mimread(name)
|
44 |
+
if len(video[0].shape) == 2:
|
45 |
+
video = [gray2rgb(frame) for frame in video]
|
46 |
+
if frame_shape is not None:
|
47 |
+
video = np.array([resize(frame, frame_shape) for frame in video])
|
48 |
+
video = np.array(video)
|
49 |
+
if video.shape[-1] == 4:
|
50 |
+
video = video[..., :3]
|
51 |
+
video_array = img_as_float32(video)
|
52 |
+
else:
|
53 |
+
raise Exception("Unknown file extensions %s" % name)
|
54 |
+
|
55 |
+
return video_array
|
56 |
+
|
57 |
+
|
58 |
+
class FramesDataset(Dataset):
|
59 |
+
"""
|
60 |
+
Dataset of videos, each video can be represented as:
|
61 |
+
- an image of concatenated frames
|
62 |
+
- '.mp4' or '.gif'
|
63 |
+
- folder with all frames
|
64 |
+
"""
|
65 |
+
|
66 |
+
def __init__(self, root_dir, frame_shape=(256, 256, 3), id_sampling=False, is_train=True,
|
67 |
+
random_seed=0, pairs_list=None, augmentation_params=None):
|
68 |
+
self.root_dir = root_dir
|
69 |
+
self.videos = os.listdir(root_dir)
|
70 |
+
self.frame_shape = frame_shape
|
71 |
+
print(self.frame_shape)
|
72 |
+
self.pairs_list = pairs_list
|
73 |
+
self.id_sampling = id_sampling
|
74 |
+
|
75 |
+
if os.path.exists(os.path.join(root_dir, 'train')):
|
76 |
+
assert os.path.exists(os.path.join(root_dir, 'test'))
|
77 |
+
print("Use predefined train-test split.")
|
78 |
+
if id_sampling:
|
79 |
+
train_videos = {os.path.basename(video).split('#')[0] for video in
|
80 |
+
os.listdir(os.path.join(root_dir, 'train'))}
|
81 |
+
train_videos = list(train_videos)
|
82 |
+
else:
|
83 |
+
train_videos = os.listdir(os.path.join(root_dir, 'train'))
|
84 |
+
test_videos = os.listdir(os.path.join(root_dir, 'test'))
|
85 |
+
self.root_dir = os.path.join(self.root_dir, 'train' if is_train else 'test')
|
86 |
+
else:
|
87 |
+
print("Use random train-test split.")
|
88 |
+
train_videos, test_videos = train_test_split(self.videos, random_state=random_seed, test_size=0.2)
|
89 |
+
|
90 |
+
if is_train:
|
91 |
+
self.videos = train_videos
|
92 |
+
else:
|
93 |
+
self.videos = test_videos
|
94 |
+
|
95 |
+
self.is_train = is_train
|
96 |
+
|
97 |
+
if self.is_train:
|
98 |
+
self.transform = AllAugmentationTransform(**augmentation_params)
|
99 |
+
else:
|
100 |
+
self.transform = None
|
101 |
+
|
102 |
+
def __len__(self):
|
103 |
+
return len(self.videos)
|
104 |
+
|
105 |
+
def __getitem__(self, idx):
|
106 |
+
|
107 |
+
if self.is_train and self.id_sampling:
|
108 |
+
name = self.videos[idx]
|
109 |
+
path = np.random.choice(glob.glob(os.path.join(self.root_dir, name + '*.mp4')))
|
110 |
+
else:
|
111 |
+
name = self.videos[idx]
|
112 |
+
path = os.path.join(self.root_dir, name)
|
113 |
+
|
114 |
+
video_name = os.path.basename(path)
|
115 |
+
if self.is_train and os.path.isdir(path):
|
116 |
+
|
117 |
+
frames = os.listdir(path)
|
118 |
+
num_frames = len(frames)
|
119 |
+
frame_idx = np.sort(np.random.choice(num_frames, replace=True, size=2))
|
120 |
+
|
121 |
+
if self.frame_shape is not None:
|
122 |
+
resize_fn = partial(resize, output_shape=self.frame_shape)
|
123 |
+
else:
|
124 |
+
resize_fn = img_as_float32
|
125 |
+
|
126 |
+
if type(frames[0]) is bytes:
|
127 |
+
video_array = [resize_fn(io.imread(os.path.join(path, frames[idx].decode('utf-8')))) for idx in
|
128 |
+
frame_idx]
|
129 |
+
else:
|
130 |
+
video_array = [resize_fn(io.imread(os.path.join(path, frames[idx]))) for idx in frame_idx]
|
131 |
+
else:
|
132 |
+
|
133 |
+
video_array = read_video(path, frame_shape=self.frame_shape)
|
134 |
+
|
135 |
+
num_frames = len(video_array)
|
136 |
+
frame_idx = np.sort(np.random.choice(num_frames, replace=True, size=2)) if self.is_train else range(
|
137 |
+
num_frames)
|
138 |
+
video_array = video_array[frame_idx]
|
139 |
+
|
140 |
+
|
141 |
+
if self.transform is not None:
|
142 |
+
video_array = self.transform(video_array)
|
143 |
+
|
144 |
+
out = {}
|
145 |
+
if self.is_train:
|
146 |
+
source = np.array(video_array[0], dtype='float32')
|
147 |
+
driving = np.array(video_array[1], dtype='float32')
|
148 |
+
|
149 |
+
out['driving'] = driving.transpose((2, 0, 1))
|
150 |
+
out['source'] = source.transpose((2, 0, 1))
|
151 |
+
else:
|
152 |
+
video = np.array(video_array, dtype='float32')
|
153 |
+
out['video'] = video.transpose((3, 0, 1, 2))
|
154 |
+
|
155 |
+
out['name'] = video_name
|
156 |
+
return out
|
157 |
+
|
158 |
+
|
159 |
+
class DatasetRepeater(Dataset):
|
160 |
+
"""
|
161 |
+
Pass several times over the same dataset for better i/o performance
|
162 |
+
"""
|
163 |
+
|
164 |
+
def __init__(self, dataset, num_repeats=100):
|
165 |
+
self.dataset = dataset
|
166 |
+
self.num_repeats = num_repeats
|
167 |
+
|
168 |
+
def __len__(self):
|
169 |
+
return self.num_repeats * self.dataset.__len__()
|
170 |
+
|
171 |
+
def __getitem__(self, idx):
|
172 |
+
return self.dataset[idx % self.dataset.__len__()]
|
173 |
+
|
Thin-Plate-Spline-Motion-Model/logger.py
ADDED
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
import torch
|
3 |
+
import torch.nn.functional as F
|
4 |
+
import imageio
|
5 |
+
|
6 |
+
import os
|
7 |
+
from skimage.draw import circle
|
8 |
+
|
9 |
+
import matplotlib.pyplot as plt
|
10 |
+
import collections
|
11 |
+
|
12 |
+
|
13 |
+
class Logger:
|
14 |
+
def __init__(self, log_dir, checkpoint_freq=50, visualizer_params=None, zfill_num=8, log_file_name='log.txt'):
|
15 |
+
|
16 |
+
self.loss_list = []
|
17 |
+
self.cpk_dir = log_dir
|
18 |
+
self.visualizations_dir = os.path.join(log_dir, 'train-vis')
|
19 |
+
if not os.path.exists(self.visualizations_dir):
|
20 |
+
os.makedirs(self.visualizations_dir)
|
21 |
+
self.log_file = open(os.path.join(log_dir, log_file_name), 'a')
|
22 |
+
self.zfill_num = zfill_num
|
23 |
+
self.visualizer = Visualizer(**visualizer_params)
|
24 |
+
self.checkpoint_freq = checkpoint_freq
|
25 |
+
self.epoch = 0
|
26 |
+
self.best_loss = float('inf')
|
27 |
+
self.names = None
|
28 |
+
|
29 |
+
def log_scores(self, loss_names):
|
30 |
+
loss_mean = np.array(self.loss_list).mean(axis=0)
|
31 |
+
|
32 |
+
loss_string = "; ".join(["%s - %.5f" % (name, value) for name, value in zip(loss_names, loss_mean)])
|
33 |
+
loss_string = str(self.epoch).zfill(self.zfill_num) + ") " + loss_string
|
34 |
+
|
35 |
+
print(loss_string, file=self.log_file)
|
36 |
+
self.loss_list = []
|
37 |
+
self.log_file.flush()
|
38 |
+
|
39 |
+
def visualize_rec(self, inp, out):
|
40 |
+
image = self.visualizer.visualize(inp['driving'], inp['source'], out)
|
41 |
+
imageio.imsave(os.path.join(self.visualizations_dir, "%s-rec.png" % str(self.epoch).zfill(self.zfill_num)), image)
|
42 |
+
|
43 |
+
def save_cpk(self, emergent=False):
|
44 |
+
cpk = {k: v.state_dict() for k, v in self.models.items()}
|
45 |
+
cpk['epoch'] = self.epoch
|
46 |
+
cpk_path = os.path.join(self.cpk_dir, '%s-checkpoint.pth.tar' % str(self.epoch).zfill(self.zfill_num))
|
47 |
+
if not (os.path.exists(cpk_path) and emergent):
|
48 |
+
torch.save(cpk, cpk_path)
|
49 |
+
|
50 |
+
@staticmethod
|
51 |
+
def load_cpk(checkpoint_path, inpainting_network=None, dense_motion_network =None, kp_detector=None,
|
52 |
+
bg_predictor=None, avd_network=None, optimizer=None, optimizer_bg_predictor=None,
|
53 |
+
optimizer_avd=None):
|
54 |
+
checkpoint = torch.load(checkpoint_path)
|
55 |
+
if inpainting_network is not None:
|
56 |
+
inpainting_network.load_state_dict(checkpoint['inpainting_network'])
|
57 |
+
if kp_detector is not None:
|
58 |
+
kp_detector.load_state_dict(checkpoint['kp_detector'])
|
59 |
+
if bg_predictor is not None and 'bg_predictor' in checkpoint:
|
60 |
+
bg_predictor.load_state_dict(checkpoint['bg_predictor'])
|
61 |
+
if dense_motion_network is not None:
|
62 |
+
dense_motion_network.load_state_dict(checkpoint['dense_motion_network'])
|
63 |
+
if avd_network is not None:
|
64 |
+
if 'avd_network' in checkpoint:
|
65 |
+
avd_network.load_state_dict(checkpoint['avd_network'])
|
66 |
+
if optimizer_bg_predictor is not None and 'optimizer_bg_predictor' in checkpoint:
|
67 |
+
optimizer_bg_predictor.load_state_dict(checkpoint['optimizer_bg_predictor'])
|
68 |
+
if optimizer is not None and 'optimizer' in checkpoint:
|
69 |
+
optimizer.load_state_dict(checkpoint['optimizer'])
|
70 |
+
if optimizer_avd is not None:
|
71 |
+
if 'optimizer_avd' in checkpoint:
|
72 |
+
optimizer_avd.load_state_dict(checkpoint['optimizer_avd'])
|
73 |
+
epoch = -1
|
74 |
+
if 'epoch' in checkpoint:
|
75 |
+
epoch = checkpoint['epoch']
|
76 |
+
return epoch
|
77 |
+
|
78 |
+
def __enter__(self):
|
79 |
+
return self
|
80 |
+
|
81 |
+
def __exit__(self, exc_type, exc_value, tb):
|
82 |
+
if 'models' in self.__dict__:
|
83 |
+
self.save_cpk()
|
84 |
+
self.log_file.close()
|
85 |
+
|
86 |
+
def log_iter(self, losses):
|
87 |
+
losses = collections.OrderedDict(losses.items())
|
88 |
+
self.names = list(losses.keys())
|
89 |
+
self.loss_list.append(list(losses.values()))
|
90 |
+
|
91 |
+
def log_epoch(self, epoch, models, inp, out):
|
92 |
+
self.epoch = epoch
|
93 |
+
self.models = models
|
94 |
+
if (self.epoch + 1) % self.checkpoint_freq == 0:
|
95 |
+
self.save_cpk()
|
96 |
+
self.log_scores(self.names)
|
97 |
+
self.visualize_rec(inp, out)
|
98 |
+
|
99 |
+
|
100 |
+
class Visualizer:
|
101 |
+
def __init__(self, kp_size=5, draw_border=False, colormap='gist_rainbow'):
|
102 |
+
self.kp_size = kp_size
|
103 |
+
self.draw_border = draw_border
|
104 |
+
self.colormap = plt.get_cmap(colormap)
|
105 |
+
|
106 |
+
def draw_image_with_kp(self, image, kp_array):
|
107 |
+
image = np.copy(image)
|
108 |
+
spatial_size = np.array(image.shape[:2][::-1])[np.newaxis]
|
109 |
+
kp_array = spatial_size * (kp_array + 1) / 2
|
110 |
+
num_kp = kp_array.shape[0]
|
111 |
+
for kp_ind, kp in enumerate(kp_array):
|
112 |
+
rr, cc = circle(kp[1], kp[0], self.kp_size, shape=image.shape[:2])
|
113 |
+
image[rr, cc] = np.array(self.colormap(kp_ind / num_kp))[:3]
|
114 |
+
return image
|
115 |
+
|
116 |
+
def create_image_column_with_kp(self, images, kp):
|
117 |
+
image_array = np.array([self.draw_image_with_kp(v, k) for v, k in zip(images, kp)])
|
118 |
+
return self.create_image_column(image_array)
|
119 |
+
|
120 |
+
def create_image_column(self, images):
|
121 |
+
if self.draw_border:
|
122 |
+
images = np.copy(images)
|
123 |
+
images[:, :, [0, -1]] = (1, 1, 1)
|
124 |
+
images[:, :, [0, -1]] = (1, 1, 1)
|
125 |
+
return np.concatenate(list(images), axis=0)
|
126 |
+
|
127 |
+
def create_image_grid(self, *args):
|
128 |
+
out = []
|
129 |
+
for arg in args:
|
130 |
+
if type(arg) == tuple:
|
131 |
+
out.append(self.create_image_column_with_kp(arg[0], arg[1]))
|
132 |
+
else:
|
133 |
+
out.append(self.create_image_column(arg))
|
134 |
+
return np.concatenate(out, axis=1)
|
135 |
+
|
136 |
+
def visualize(self, driving, source, out):
|
137 |
+
images = []
|
138 |
+
|
139 |
+
# Source image with keypoints
|
140 |
+
source = source.data.cpu()
|
141 |
+
kp_source = out['kp_source']['fg_kp'].data.cpu().numpy()
|
142 |
+
source = np.transpose(source, [0, 2, 3, 1])
|
143 |
+
images.append((source, kp_source))
|
144 |
+
|
145 |
+
# Equivariance visualization
|
146 |
+
if 'transformed_frame' in out:
|
147 |
+
transformed = out['transformed_frame'].data.cpu().numpy()
|
148 |
+
transformed = np.transpose(transformed, [0, 2, 3, 1])
|
149 |
+
transformed_kp = out['transformed_kp']['fg_kp'].data.cpu().numpy()
|
150 |
+
images.append((transformed, transformed_kp))
|
151 |
+
|
152 |
+
# Driving image with keypoints
|
153 |
+
kp_driving = out['kp_driving']['fg_kp'].data.cpu().numpy()
|
154 |
+
driving = driving.data.cpu().numpy()
|
155 |
+
driving = np.transpose(driving, [0, 2, 3, 1])
|
156 |
+
images.append((driving, kp_driving))
|
157 |
+
|
158 |
+
# Deformed image
|
159 |
+
if 'deformed' in out:
|
160 |
+
deformed = out['deformed'].data.cpu().numpy()
|
161 |
+
deformed = np.transpose(deformed, [0, 2, 3, 1])
|
162 |
+
images.append(deformed)
|
163 |
+
|
164 |
+
# Result with and without keypoints
|
165 |
+
prediction = out['prediction'].data.cpu().numpy()
|
166 |
+
prediction = np.transpose(prediction, [0, 2, 3, 1])
|
167 |
+
if 'kp_norm' in out:
|
168 |
+
kp_norm = out['kp_norm']['fg_kp'].data.cpu().numpy()
|
169 |
+
images.append((prediction, kp_norm))
|
170 |
+
images.append(prediction)
|
171 |
+
|
172 |
+
|
173 |
+
## Occlusion map
|
174 |
+
if 'occlusion_map' in out:
|
175 |
+
for i in range(len(out['occlusion_map'])):
|
176 |
+
occlusion_map = out['occlusion_map'][i].data.cpu().repeat(1, 3, 1, 1)
|
177 |
+
occlusion_map = F.interpolate(occlusion_map, size=source.shape[1:3]).numpy()
|
178 |
+
occlusion_map = np.transpose(occlusion_map, [0, 2, 3, 1])
|
179 |
+
images.append(occlusion_map)
|
180 |
+
|
181 |
+
# Deformed images according to each individual transform
|
182 |
+
if 'deformed_source' in out:
|
183 |
+
full_mask = []
|
184 |
+
for i in range(out['deformed_source'].shape[1]):
|
185 |
+
image = out['deformed_source'][:, i].data.cpu()
|
186 |
+
# import ipdb;ipdb.set_trace()
|
187 |
+
image = F.interpolate(image, size=source.shape[1:3])
|
188 |
+
mask = out['contribution_maps'][:, i:(i+1)].data.cpu().repeat(1, 3, 1, 1)
|
189 |
+
mask = F.interpolate(mask, size=source.shape[1:3])
|
190 |
+
image = np.transpose(image.numpy(), (0, 2, 3, 1))
|
191 |
+
mask = np.transpose(mask.numpy(), (0, 2, 3, 1))
|
192 |
+
|
193 |
+
if i != 0:
|
194 |
+
color = np.array(self.colormap((i - 1) / (out['deformed_source'].shape[1] - 1)))[:3]
|
195 |
+
else:
|
196 |
+
color = np.array((0, 0, 0))
|
197 |
+
|
198 |
+
color = color.reshape((1, 1, 1, 3))
|
199 |
+
|
200 |
+
images.append(image)
|
201 |
+
if i != 0:
|
202 |
+
images.append(mask * color)
|
203 |
+
else:
|
204 |
+
images.append(mask)
|
205 |
+
|
206 |
+
full_mask.append(mask * color)
|
207 |
+
|
208 |
+
images.append(sum(full_mask))
|
209 |
+
|
210 |
+
image = self.create_image_grid(*images)
|
211 |
+
image = (255 * image).astype(np.uint8)
|
212 |
+
return image
|
Thin-Plate-Spline-Motion-Model/modules/avd_network.py
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
import torch
|
3 |
+
from torch import nn
|
4 |
+
|
5 |
+
|
6 |
+
class AVDNetwork(nn.Module):
|
7 |
+
"""
|
8 |
+
Animation via Disentanglement network
|
9 |
+
"""
|
10 |
+
|
11 |
+
def __init__(self, num_tps, id_bottle_size=64, pose_bottle_size=64):
|
12 |
+
super(AVDNetwork, self).__init__()
|
13 |
+
input_size = 5*2 * num_tps
|
14 |
+
self.num_tps = num_tps
|
15 |
+
|
16 |
+
self.id_encoder = nn.Sequential(
|
17 |
+
nn.Linear(input_size, 256),
|
18 |
+
nn.BatchNorm1d(256),
|
19 |
+
nn.ReLU(inplace=True),
|
20 |
+
nn.Linear(256, 512),
|
21 |
+
nn.BatchNorm1d(512),
|
22 |
+
nn.ReLU(inplace=True),
|
23 |
+
nn.Linear(512, 1024),
|
24 |
+
nn.BatchNorm1d(1024),
|
25 |
+
nn.ReLU(inplace=True),
|
26 |
+
nn.Linear(1024, id_bottle_size)
|
27 |
+
)
|
28 |
+
|
29 |
+
self.pose_encoder = nn.Sequential(
|
30 |
+
nn.Linear(input_size, 256),
|
31 |
+
nn.BatchNorm1d(256),
|
32 |
+
nn.ReLU(inplace=True),
|
33 |
+
nn.Linear(256, 512),
|
34 |
+
nn.BatchNorm1d(512),
|
35 |
+
nn.ReLU(inplace=True),
|
36 |
+
nn.Linear(512, 1024),
|
37 |
+
nn.BatchNorm1d(1024),
|
38 |
+
nn.ReLU(inplace=True),
|
39 |
+
nn.Linear(1024, pose_bottle_size)
|
40 |
+
)
|
41 |
+
|
42 |
+
self.decoder = nn.Sequential(
|
43 |
+
nn.Linear(pose_bottle_size + id_bottle_size, 1024),
|
44 |
+
nn.BatchNorm1d(1024),
|
45 |
+
nn.ReLU(),
|
46 |
+
nn.Linear(1024, 512),
|
47 |
+
nn.BatchNorm1d(512),
|
48 |
+
nn.ReLU(),
|
49 |
+
nn.Linear(512, 256),
|
50 |
+
nn.BatchNorm1d(256),
|
51 |
+
nn.ReLU(),
|
52 |
+
nn.Linear(256, input_size)
|
53 |
+
)
|
54 |
+
|
55 |
+
def forward(self, kp_source, kp_random):
|
56 |
+
|
57 |
+
bs = kp_source['fg_kp'].shape[0]
|
58 |
+
|
59 |
+
pose_emb = self.pose_encoder(kp_random['fg_kp'].view(bs, -1))
|
60 |
+
id_emb = self.id_encoder(kp_source['fg_kp'].view(bs, -1))
|
61 |
+
|
62 |
+
rec = self.decoder(torch.cat([pose_emb, id_emb], dim=1))
|
63 |
+
|
64 |
+
rec = {'fg_kp': rec.view(bs, self.num_tps*5, -1)}
|
65 |
+
return rec
|
Thin-Plate-Spline-Motion-Model/modules/bg_motion_predictor.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from torch import nn
|
2 |
+
import torch
|
3 |
+
from torchvision import models
|
4 |
+
|
5 |
+
class BGMotionPredictor(nn.Module):
|
6 |
+
"""
|
7 |
+
Module for background estimation, return single transformation, parametrized as 3x3 matrix. The third row is [0 0 1]
|
8 |
+
"""
|
9 |
+
|
10 |
+
def __init__(self):
|
11 |
+
super(BGMotionPredictor, self).__init__()
|
12 |
+
self.bg_encoder = models.resnet18(pretrained=False)
|
13 |
+
self.bg_encoder.conv1 = nn.Conv2d(6, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)
|
14 |
+
num_features = self.bg_encoder.fc.in_features
|
15 |
+
self.bg_encoder.fc = nn.Linear(num_features, 6)
|
16 |
+
self.bg_encoder.fc.weight.data.zero_()
|
17 |
+
self.bg_encoder.fc.bias.data.copy_(torch.tensor([1, 0, 0, 0, 1, 0], dtype=torch.float))
|
18 |
+
|
19 |
+
def forward(self, source_image, driving_image):
|
20 |
+
bs = source_image.shape[0]
|
21 |
+
out = torch.eye(3).unsqueeze(0).repeat(bs, 1, 1).type(source_image.type())
|
22 |
+
prediction = self.bg_encoder(torch.cat([source_image, driving_image], dim=1))
|
23 |
+
out[:, :2, :] = prediction.view(bs, 2, 3)
|
24 |
+
return out
|
Thin-Plate-Spline-Motion-Model/modules/dense_motion.py
ADDED
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from torch import nn
|
2 |
+
import torch.nn.functional as F
|
3 |
+
import torch
|
4 |
+
from modules.util import Hourglass, AntiAliasInterpolation2d, make_coordinate_grid, kp2gaussian
|
5 |
+
from modules.util import to_homogeneous, from_homogeneous, UpBlock2d, TPS
|
6 |
+
import math
|
7 |
+
|
8 |
+
class DenseMotionNetwork(nn.Module):
|
9 |
+
"""
|
10 |
+
Module that estimating an optical flow and multi-resolution occlusion masks
|
11 |
+
from K TPS transformations and an affine transformation.
|
12 |
+
"""
|
13 |
+
|
14 |
+
def __init__(self, block_expansion, num_blocks, max_features, num_tps, num_channels,
|
15 |
+
scale_factor=0.25, bg = False, multi_mask = True, kp_variance=0.01):
|
16 |
+
super(DenseMotionNetwork, self).__init__()
|
17 |
+
|
18 |
+
if scale_factor != 1:
|
19 |
+
self.down = AntiAliasInterpolation2d(num_channels, scale_factor)
|
20 |
+
self.scale_factor = scale_factor
|
21 |
+
self.multi_mask = multi_mask
|
22 |
+
|
23 |
+
self.hourglass = Hourglass(block_expansion=block_expansion, in_features=(num_channels * (num_tps+1) + num_tps*5+1),
|
24 |
+
max_features=max_features, num_blocks=num_blocks)
|
25 |
+
|
26 |
+
hourglass_output_size = self.hourglass.out_channels
|
27 |
+
self.maps = nn.Conv2d(hourglass_output_size[-1], num_tps + 1, kernel_size=(7, 7), padding=(3, 3))
|
28 |
+
|
29 |
+
if multi_mask:
|
30 |
+
up = []
|
31 |
+
self.up_nums = int(math.log(1/scale_factor, 2))
|
32 |
+
self.occlusion_num = 4
|
33 |
+
|
34 |
+
channel = [hourglass_output_size[-1]//(2**i) for i in range(self.up_nums)]
|
35 |
+
for i in range(self.up_nums):
|
36 |
+
up.append(UpBlock2d(channel[i], channel[i]//2, kernel_size=3, padding=1))
|
37 |
+
self.up = nn.ModuleList(up)
|
38 |
+
|
39 |
+
channel = [hourglass_output_size[-i-1] for i in range(self.occlusion_num-self.up_nums)[::-1]]
|
40 |
+
for i in range(self.up_nums):
|
41 |
+
channel.append(hourglass_output_size[-1]//(2**(i+1)))
|
42 |
+
occlusion = []
|
43 |
+
|
44 |
+
for i in range(self.occlusion_num):
|
45 |
+
occlusion.append(nn.Conv2d(channel[i], 1, kernel_size=(7, 7), padding=(3, 3)))
|
46 |
+
self.occlusion = nn.ModuleList(occlusion)
|
47 |
+
else:
|
48 |
+
occlusion = [nn.Conv2d(hourglass_output_size[-1], 1, kernel_size=(7, 7), padding=(3, 3))]
|
49 |
+
self.occlusion = nn.ModuleList(occlusion)
|
50 |
+
|
51 |
+
self.num_tps = num_tps
|
52 |
+
self.bg = bg
|
53 |
+
self.kp_variance = kp_variance
|
54 |
+
|
55 |
+
|
56 |
+
def create_heatmap_representations(self, source_image, kp_driving, kp_source):
|
57 |
+
|
58 |
+
spatial_size = source_image.shape[2:]
|
59 |
+
gaussian_driving = kp2gaussian(kp_driving['fg_kp'], spatial_size=spatial_size, kp_variance=self.kp_variance)
|
60 |
+
gaussian_source = kp2gaussian(kp_source['fg_kp'], spatial_size=spatial_size, kp_variance=self.kp_variance)
|
61 |
+
heatmap = gaussian_driving - gaussian_source
|
62 |
+
|
63 |
+
zeros = torch.zeros(heatmap.shape[0], 1, spatial_size[0], spatial_size[1]).type(heatmap.type()).to(heatmap.device)
|
64 |
+
heatmap = torch.cat([zeros, heatmap], dim=1)
|
65 |
+
|
66 |
+
return heatmap
|
67 |
+
|
68 |
+
def create_transformations(self, source_image, kp_driving, kp_source, bg_param):
|
69 |
+
# K TPS transformaions
|
70 |
+
bs, _, h, w = source_image.shape
|
71 |
+
kp_1 = kp_driving['fg_kp']
|
72 |
+
kp_2 = kp_source['fg_kp']
|
73 |
+
kp_1 = kp_1.view(bs, -1, 5, 2)
|
74 |
+
kp_2 = kp_2.view(bs, -1, 5, 2)
|
75 |
+
trans = TPS(mode = 'kp', bs = bs, kp_1 = kp_1, kp_2 = kp_2)
|
76 |
+
driving_to_source = trans.transform_frame(source_image)
|
77 |
+
|
78 |
+
identity_grid = make_coordinate_grid((h, w), type=kp_1.type()).to(kp_1.device)
|
79 |
+
identity_grid = identity_grid.view(1, 1, h, w, 2)
|
80 |
+
identity_grid = identity_grid.repeat(bs, 1, 1, 1, 1)
|
81 |
+
|
82 |
+
# affine background transformation
|
83 |
+
if not (bg_param is None):
|
84 |
+
identity_grid = to_homogeneous(identity_grid)
|
85 |
+
identity_grid = torch.matmul(bg_param.view(bs, 1, 1, 1, 3, 3), identity_grid.unsqueeze(-1)).squeeze(-1)
|
86 |
+
identity_grid = from_homogeneous(identity_grid)
|
87 |
+
|
88 |
+
transformations = torch.cat([identity_grid, driving_to_source], dim=1)
|
89 |
+
return transformations
|
90 |
+
|
91 |
+
def create_deformed_source_image(self, source_image, transformations):
|
92 |
+
|
93 |
+
bs, _, h, w = source_image.shape
|
94 |
+
source_repeat = source_image.unsqueeze(1).unsqueeze(1).repeat(1, self.num_tps + 1, 1, 1, 1, 1)
|
95 |
+
source_repeat = source_repeat.view(bs * (self.num_tps + 1), -1, h, w)
|
96 |
+
transformations = transformations.view((bs * (self.num_tps + 1), h, w, -1))
|
97 |
+
deformed = F.grid_sample(source_repeat, transformations, align_corners=True)
|
98 |
+
deformed = deformed.view((bs, self.num_tps+1, -1, h, w))
|
99 |
+
return deformed
|
100 |
+
|
101 |
+
def dropout_softmax(self, X, P):
|
102 |
+
'''
|
103 |
+
Dropout for TPS transformations. Eq(7) and Eq(8) in the paper.
|
104 |
+
'''
|
105 |
+
drop = (torch.rand(X.shape[0],X.shape[1]) < (1-P)).type(X.type()).to(X.device)
|
106 |
+
drop[..., 0] = 1
|
107 |
+
drop = drop.repeat(X.shape[2],X.shape[3],1,1).permute(2,3,0,1)
|
108 |
+
|
109 |
+
maxx = X.max(1).values.unsqueeze_(1)
|
110 |
+
X = X - maxx
|
111 |
+
X_exp = X.exp()
|
112 |
+
X[:,1:,...] /= (1-P)
|
113 |
+
mask_bool =(drop == 0)
|
114 |
+
X_exp = X_exp.masked_fill(mask_bool, 0)
|
115 |
+
partition = X_exp.sum(dim=1, keepdim=True) + 1e-6
|
116 |
+
return X_exp / partition
|
117 |
+
|
118 |
+
def forward(self, source_image, kp_driving, kp_source, bg_param = None, dropout_flag=False, dropout_p = 0):
|
119 |
+
if self.scale_factor != 1:
|
120 |
+
source_image = self.down(source_image)
|
121 |
+
|
122 |
+
bs, _, h, w = source_image.shape
|
123 |
+
|
124 |
+
out_dict = dict()
|
125 |
+
heatmap_representation = self.create_heatmap_representations(source_image, kp_driving, kp_source)
|
126 |
+
transformations = self.create_transformations(source_image, kp_driving, kp_source, bg_param)
|
127 |
+
deformed_source = self.create_deformed_source_image(source_image, transformations)
|
128 |
+
out_dict['deformed_source'] = deformed_source
|
129 |
+
# out_dict['transformations'] = transformations
|
130 |
+
deformed_source = deformed_source.view(bs,-1,h,w)
|
131 |
+
input = torch.cat([heatmap_representation, deformed_source], dim=1)
|
132 |
+
input = input.view(bs, -1, h, w)
|
133 |
+
|
134 |
+
prediction = self.hourglass(input, mode = 1)
|
135 |
+
|
136 |
+
contribution_maps = self.maps(prediction[-1])
|
137 |
+
if(dropout_flag):
|
138 |
+
contribution_maps = self.dropout_softmax(contribution_maps, dropout_p)
|
139 |
+
else:
|
140 |
+
contribution_maps = F.softmax(contribution_maps, dim=1)
|
141 |
+
out_dict['contribution_maps'] = contribution_maps
|
142 |
+
|
143 |
+
# Combine the K+1 transformations
|
144 |
+
# Eq(6) in the paper
|
145 |
+
contribution_maps = contribution_maps.unsqueeze(2)
|
146 |
+
transformations = transformations.permute(0, 1, 4, 2, 3)
|
147 |
+
deformation = (transformations * contribution_maps).sum(dim=1)
|
148 |
+
deformation = deformation.permute(0, 2, 3, 1)
|
149 |
+
|
150 |
+
out_dict['deformation'] = deformation # Optical Flow
|
151 |
+
|
152 |
+
occlusion_map = []
|
153 |
+
if self.multi_mask:
|
154 |
+
for i in range(self.occlusion_num-self.up_nums):
|
155 |
+
occlusion_map.append(torch.sigmoid(self.occlusion[i](prediction[self.up_nums-self.occlusion_num+i])))
|
156 |
+
prediction = prediction[-1]
|
157 |
+
for i in range(self.up_nums):
|
158 |
+
prediction = self.up[i](prediction)
|
159 |
+
occlusion_map.append(torch.sigmoid(self.occlusion[i+self.occlusion_num-self.up_nums](prediction)))
|
160 |
+
else:
|
161 |
+
occlusion_map.append(torch.sigmoid(self.occlusion[0](prediction[-1])))
|
162 |
+
|
163 |
+
out_dict['occlusion_map'] = occlusion_map # Multi-resolution Occlusion Masks
|
164 |
+
return out_dict
|
Thin-Plate-Spline-Motion-Model/modules/inpainting_network.py
ADDED
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from torch import nn
|
3 |
+
import torch.nn.functional as F
|
4 |
+
from modules.util import ResBlock2d, SameBlock2d, UpBlock2d, DownBlock2d
|
5 |
+
from modules.dense_motion import DenseMotionNetwork
|
6 |
+
|
7 |
+
|
8 |
+
class InpaintingNetwork(nn.Module):
|
9 |
+
"""
|
10 |
+
Inpaint the missing regions and reconstruct the Driving image.
|
11 |
+
"""
|
12 |
+
def __init__(self, num_channels, block_expansion, max_features, num_down_blocks, multi_mask = True, **kwargs):
|
13 |
+
super(InpaintingNetwork, self).__init__()
|
14 |
+
|
15 |
+
self.num_down_blocks = num_down_blocks
|
16 |
+
self.multi_mask = multi_mask
|
17 |
+
self.first = SameBlock2d(num_channels, block_expansion, kernel_size=(7, 7), padding=(3, 3))
|
18 |
+
|
19 |
+
down_blocks = []
|
20 |
+
up_blocks = []
|
21 |
+
resblock = []
|
22 |
+
for i in range(num_down_blocks):
|
23 |
+
in_features = min(max_features, block_expansion * (2 ** i))
|
24 |
+
out_features = min(max_features, block_expansion * (2 ** (i + 1)))
|
25 |
+
down_blocks.append(DownBlock2d(in_features, out_features, kernel_size=(3, 3), padding=(1, 1)))
|
26 |
+
decoder_in_feature = out_features * 2
|
27 |
+
if i==num_down_blocks-1:
|
28 |
+
decoder_in_feature = out_features
|
29 |
+
up_blocks.append(UpBlock2d(decoder_in_feature, in_features, kernel_size=(3, 3), padding=(1, 1)))
|
30 |
+
resblock.append(ResBlock2d(decoder_in_feature, kernel_size=(3, 3), padding=(1, 1)))
|
31 |
+
resblock.append(ResBlock2d(decoder_in_feature, kernel_size=(3, 3), padding=(1, 1)))
|
32 |
+
self.down_blocks = nn.ModuleList(down_blocks)
|
33 |
+
self.up_blocks = nn.ModuleList(up_blocks[::-1])
|
34 |
+
self.resblock = nn.ModuleList(resblock[::-1])
|
35 |
+
|
36 |
+
self.final = nn.Conv2d(block_expansion, num_channels, kernel_size=(7, 7), padding=(3, 3))
|
37 |
+
self.num_channels = num_channels
|
38 |
+
|
39 |
+
def deform_input(self, inp, deformation):
|
40 |
+
_, h_old, w_old, _ = deformation.shape
|
41 |
+
_, _, h, w = inp.shape
|
42 |
+
if h_old != h or w_old != w:
|
43 |
+
deformation = deformation.permute(0, 3, 1, 2)
|
44 |
+
deformation = F.interpolate(deformation, size=(h, w), mode='bilinear', align_corners=True)
|
45 |
+
deformation = deformation.permute(0, 2, 3, 1)
|
46 |
+
return F.grid_sample(inp, deformation,align_corners=True)
|
47 |
+
|
48 |
+
def occlude_input(self, inp, occlusion_map):
|
49 |
+
if not self.multi_mask:
|
50 |
+
if inp.shape[2] != occlusion_map.shape[2] or inp.shape[3] != occlusion_map.shape[3]:
|
51 |
+
occlusion_map = F.interpolate(occlusion_map, size=inp.shape[2:], mode='bilinear',align_corners=True)
|
52 |
+
out = inp * occlusion_map
|
53 |
+
return out
|
54 |
+
|
55 |
+
def forward(self, source_image, dense_motion):
|
56 |
+
out = self.first(source_image)
|
57 |
+
encoder_map = [out]
|
58 |
+
for i in range(len(self.down_blocks)):
|
59 |
+
out = self.down_blocks[i](out)
|
60 |
+
encoder_map.append(out)
|
61 |
+
|
62 |
+
output_dict = {}
|
63 |
+
output_dict['contribution_maps'] = dense_motion['contribution_maps']
|
64 |
+
output_dict['deformed_source'] = dense_motion['deformed_source']
|
65 |
+
|
66 |
+
occlusion_map = dense_motion['occlusion_map']
|
67 |
+
output_dict['occlusion_map'] = occlusion_map
|
68 |
+
|
69 |
+
deformation = dense_motion['deformation']
|
70 |
+
out_ij = self.deform_input(out.detach(), deformation)
|
71 |
+
out = self.deform_input(out, deformation)
|
72 |
+
|
73 |
+
out_ij = self.occlude_input(out_ij, occlusion_map[0].detach())
|
74 |
+
out = self.occlude_input(out, occlusion_map[0])
|
75 |
+
|
76 |
+
warped_encoder_maps = []
|
77 |
+
warped_encoder_maps.append(out_ij)
|
78 |
+
|
79 |
+
for i in range(self.num_down_blocks):
|
80 |
+
|
81 |
+
out = self.resblock[2*i](out)
|
82 |
+
out = self.resblock[2*i+1](out)
|
83 |
+
out = self.up_blocks[i](out)
|
84 |
+
|
85 |
+
encode_i = encoder_map[-(i+2)]
|
86 |
+
encode_ij = self.deform_input(encode_i.detach(), deformation)
|
87 |
+
encode_i = self.deform_input(encode_i, deformation)
|
88 |
+
|
89 |
+
occlusion_ind = 0
|
90 |
+
if self.multi_mask:
|
91 |
+
occlusion_ind = i+1
|
92 |
+
encode_ij = self.occlude_input(encode_ij, occlusion_map[occlusion_ind].detach())
|
93 |
+
encode_i = self.occlude_input(encode_i, occlusion_map[occlusion_ind])
|
94 |
+
warped_encoder_maps.append(encode_ij)
|
95 |
+
|
96 |
+
if(i==self.num_down_blocks-1):
|
97 |
+
break
|
98 |
+
|
99 |
+
out = torch.cat([out, encode_i], 1)
|
100 |
+
|
101 |
+
deformed_source = self.deform_input(source_image, deformation)
|
102 |
+
output_dict["deformed"] = deformed_source
|
103 |
+
output_dict["warped_encoder_maps"] = warped_encoder_maps
|
104 |
+
|
105 |
+
occlusion_last = occlusion_map[-1]
|
106 |
+
if not self.multi_mask:
|
107 |
+
occlusion_last = F.interpolate(occlusion_last, size=out.shape[2:], mode='bilinear',align_corners=True)
|
108 |
+
|
109 |
+
out = out * (1 - occlusion_last) + encode_i
|
110 |
+
out = self.final(out)
|
111 |
+
out = torch.sigmoid(out)
|
112 |
+
out = out * (1 - occlusion_last) + deformed_source * occlusion_last
|
113 |
+
output_dict["prediction"] = out
|
114 |
+
|
115 |
+
return output_dict
|
116 |
+
|
117 |
+
def get_encode(self, driver_image, occlusion_map):
|
118 |
+
out = self.first(driver_image)
|
119 |
+
encoder_map = []
|
120 |
+
encoder_map.append(self.occlude_input(out.detach(), occlusion_map[-1].detach()))
|
121 |
+
for i in range(len(self.down_blocks)):
|
122 |
+
out = self.down_blocks[i](out.detach())
|
123 |
+
out_mask = self.occlude_input(out.detach(), occlusion_map[2-i].detach())
|
124 |
+
encoder_map.append(out_mask.detach())
|
125 |
+
|
126 |
+
return encoder_map
|
127 |
+
|
Thin-Plate-Spline-Motion-Model/modules/keypoint_detector.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from torch import nn
|
2 |
+
import torch
|
3 |
+
from torchvision import models
|
4 |
+
|
5 |
+
class KPDetector(nn.Module):
|
6 |
+
"""
|
7 |
+
Predict K*5 keypoints.
|
8 |
+
"""
|
9 |
+
|
10 |
+
def __init__(self, num_tps, **kwargs):
|
11 |
+
super(KPDetector, self).__init__()
|
12 |
+
self.num_tps = num_tps
|
13 |
+
|
14 |
+
self.fg_encoder = models.resnet18(pretrained=False)
|
15 |
+
num_features = self.fg_encoder.fc.in_features
|
16 |
+
self.fg_encoder.fc = nn.Linear(num_features, num_tps*5*2)
|
17 |
+
|
18 |
+
|
19 |
+
def forward(self, image):
|
20 |
+
|
21 |
+
fg_kp = self.fg_encoder(image)
|
22 |
+
bs, _, = fg_kp.shape
|
23 |
+
fg_kp = torch.sigmoid(fg_kp)
|
24 |
+
fg_kp = fg_kp * 2 - 1
|
25 |
+
out = {'fg_kp': fg_kp.view(bs, self.num_tps*5, -1)}
|
26 |
+
|
27 |
+
return out
|
Thin-Plate-Spline-Motion-Model/modules/model.py
ADDED
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from torch import nn
|
2 |
+
import torch
|
3 |
+
import torch.nn.functional as F
|
4 |
+
from modules.util import AntiAliasInterpolation2d, TPS
|
5 |
+
from torchvision import models
|
6 |
+
import numpy as np
|
7 |
+
|
8 |
+
|
9 |
+
class Vgg19(torch.nn.Module):
|
10 |
+
"""
|
11 |
+
Vgg19 network for perceptual loss. See Sec 3.3.
|
12 |
+
"""
|
13 |
+
def __init__(self, requires_grad=False):
|
14 |
+
super(Vgg19, self).__init__()
|
15 |
+
vgg_pretrained_features = models.vgg19(pretrained=True).features
|
16 |
+
self.slice1 = torch.nn.Sequential()
|
17 |
+
self.slice2 = torch.nn.Sequential()
|
18 |
+
self.slice3 = torch.nn.Sequential()
|
19 |
+
self.slice4 = torch.nn.Sequential()
|
20 |
+
self.slice5 = torch.nn.Sequential()
|
21 |
+
for x in range(2):
|
22 |
+
self.slice1.add_module(str(x), vgg_pretrained_features[x])
|
23 |
+
for x in range(2, 7):
|
24 |
+
self.slice2.add_module(str(x), vgg_pretrained_features[x])
|
25 |
+
for x in range(7, 12):
|
26 |
+
self.slice3.add_module(str(x), vgg_pretrained_features[x])
|
27 |
+
for x in range(12, 21):
|
28 |
+
self.slice4.add_module(str(x), vgg_pretrained_features[x])
|
29 |
+
for x in range(21, 30):
|
30 |
+
self.slice5.add_module(str(x), vgg_pretrained_features[x])
|
31 |
+
|
32 |
+
self.mean = torch.nn.Parameter(data=torch.Tensor(np.array([0.485, 0.456, 0.406]).reshape((1, 3, 1, 1))),
|
33 |
+
requires_grad=False)
|
34 |
+
self.std = torch.nn.Parameter(data=torch.Tensor(np.array([0.229, 0.224, 0.225]).reshape((1, 3, 1, 1))),
|
35 |
+
requires_grad=False)
|
36 |
+
|
37 |
+
if not requires_grad:
|
38 |
+
for param in self.parameters():
|
39 |
+
param.requires_grad = False
|
40 |
+
|
41 |
+
def forward(self, X):
|
42 |
+
X = (X - self.mean) / self.std
|
43 |
+
h_relu1 = self.slice1(X)
|
44 |
+
h_relu2 = self.slice2(h_relu1)
|
45 |
+
h_relu3 = self.slice3(h_relu2)
|
46 |
+
h_relu4 = self.slice4(h_relu3)
|
47 |
+
h_relu5 = self.slice5(h_relu4)
|
48 |
+
out = [h_relu1, h_relu2, h_relu3, h_relu4, h_relu5]
|
49 |
+
return out
|
50 |
+
|
51 |
+
|
52 |
+
class ImagePyramide(torch.nn.Module):
|
53 |
+
"""
|
54 |
+
Create image pyramide for computing pyramide perceptual loss. See Sec 3.3
|
55 |
+
"""
|
56 |
+
def __init__(self, scales, num_channels):
|
57 |
+
super(ImagePyramide, self).__init__()
|
58 |
+
downs = {}
|
59 |
+
for scale in scales:
|
60 |
+
downs[str(scale).replace('.', '-')] = AntiAliasInterpolation2d(num_channels, scale)
|
61 |
+
self.downs = nn.ModuleDict(downs)
|
62 |
+
|
63 |
+
def forward(self, x):
|
64 |
+
out_dict = {}
|
65 |
+
for scale, down_module in self.downs.items():
|
66 |
+
out_dict['prediction_' + str(scale).replace('-', '.')] = down_module(x)
|
67 |
+
return out_dict
|
68 |
+
|
69 |
+
|
70 |
+
def detach_kp(kp):
|
71 |
+
return {key: value.detach() for key, value in kp.items()}
|
72 |
+
|
73 |
+
|
74 |
+
class GeneratorFullModel(torch.nn.Module):
|
75 |
+
"""
|
76 |
+
Merge all generator related updates into single model for better multi-gpu usage
|
77 |
+
"""
|
78 |
+
|
79 |
+
def __init__(self, kp_extractor, bg_predictor, dense_motion_network, inpainting_network, train_params, *kwargs):
|
80 |
+
super(GeneratorFullModel, self).__init__()
|
81 |
+
self.kp_extractor = kp_extractor
|
82 |
+
self.inpainting_network = inpainting_network
|
83 |
+
self.dense_motion_network = dense_motion_network
|
84 |
+
|
85 |
+
self.bg_predictor = None
|
86 |
+
if bg_predictor:
|
87 |
+
self.bg_predictor = bg_predictor
|
88 |
+
self.bg_start = train_params['bg_start']
|
89 |
+
|
90 |
+
self.train_params = train_params
|
91 |
+
self.scales = train_params['scales']
|
92 |
+
|
93 |
+
self.pyramid = ImagePyramide(self.scales, inpainting_network.num_channels)
|
94 |
+
if torch.cuda.is_available():
|
95 |
+
self.pyramid = self.pyramid.cuda()
|
96 |
+
|
97 |
+
self.loss_weights = train_params['loss_weights']
|
98 |
+
self.dropout_epoch = train_params['dropout_epoch']
|
99 |
+
self.dropout_maxp = train_params['dropout_maxp']
|
100 |
+
self.dropout_inc_epoch = train_params['dropout_inc_epoch']
|
101 |
+
self.dropout_startp =train_params['dropout_startp']
|
102 |
+
|
103 |
+
if sum(self.loss_weights['perceptual']) != 0:
|
104 |
+
self.vgg = Vgg19()
|
105 |
+
if torch.cuda.is_available():
|
106 |
+
self.vgg = self.vgg.cuda()
|
107 |
+
|
108 |
+
|
109 |
+
def forward(self, x, epoch):
|
110 |
+
kp_source = self.kp_extractor(x['source'])
|
111 |
+
kp_driving = self.kp_extractor(x['driving'])
|
112 |
+
bg_param = None
|
113 |
+
if self.bg_predictor:
|
114 |
+
if(epoch>=self.bg_start):
|
115 |
+
bg_param = self.bg_predictor(x['source'], x['driving'])
|
116 |
+
|
117 |
+
if(epoch>=self.dropout_epoch):
|
118 |
+
dropout_flag = False
|
119 |
+
dropout_p = 0
|
120 |
+
else:
|
121 |
+
# dropout_p will linearly increase from dropout_startp to dropout_maxp
|
122 |
+
dropout_flag = True
|
123 |
+
dropout_p = min(epoch/self.dropout_inc_epoch * self.dropout_maxp + self.dropout_startp, self.dropout_maxp)
|
124 |
+
|
125 |
+
dense_motion = self.dense_motion_network(source_image=x['source'], kp_driving=kp_driving,
|
126 |
+
kp_source=kp_source, bg_param = bg_param,
|
127 |
+
dropout_flag = dropout_flag, dropout_p = dropout_p)
|
128 |
+
generated = self.inpainting_network(x['source'], dense_motion)
|
129 |
+
generated.update({'kp_source': kp_source, 'kp_driving': kp_driving})
|
130 |
+
|
131 |
+
loss_values = {}
|
132 |
+
|
133 |
+
pyramide_real = self.pyramid(x['driving'])
|
134 |
+
pyramide_generated = self.pyramid(generated['prediction'])
|
135 |
+
|
136 |
+
# reconstruction loss
|
137 |
+
if sum(self.loss_weights['perceptual']) != 0:
|
138 |
+
value_total = 0
|
139 |
+
for scale in self.scales:
|
140 |
+
x_vgg = self.vgg(pyramide_generated['prediction_' + str(scale)])
|
141 |
+
y_vgg = self.vgg(pyramide_real['prediction_' + str(scale)])
|
142 |
+
|
143 |
+
for i, weight in enumerate(self.loss_weights['perceptual']):
|
144 |
+
value = torch.abs(x_vgg[i] - y_vgg[i].detach()).mean()
|
145 |
+
value_total += self.loss_weights['perceptual'][i] * value
|
146 |
+
loss_values['perceptual'] = value_total
|
147 |
+
|
148 |
+
# equivariance loss
|
149 |
+
if self.loss_weights['equivariance_value'] != 0:
|
150 |
+
transform_random = TPS(mode = 'random', bs = x['driving'].shape[0], **self.train_params['transform_params'])
|
151 |
+
transform_grid = transform_random.transform_frame(x['driving'])
|
152 |
+
transformed_frame = F.grid_sample(x['driving'], transform_grid, padding_mode="reflection",align_corners=True)
|
153 |
+
transformed_kp = self.kp_extractor(transformed_frame)
|
154 |
+
|
155 |
+
generated['transformed_frame'] = transformed_frame
|
156 |
+
generated['transformed_kp'] = transformed_kp
|
157 |
+
|
158 |
+
warped = transform_random.warp_coordinates(transformed_kp['fg_kp'])
|
159 |
+
kp_d = kp_driving['fg_kp']
|
160 |
+
value = torch.abs(kp_d - warped).mean()
|
161 |
+
loss_values['equivariance_value'] = self.loss_weights['equivariance_value'] * value
|
162 |
+
|
163 |
+
# warp loss
|
164 |
+
if self.loss_weights['warp_loss'] != 0:
|
165 |
+
occlusion_map = generated['occlusion_map']
|
166 |
+
encode_map = self.inpainting_network.get_encode(x['driving'], occlusion_map)
|
167 |
+
decode_map = generated['warped_encoder_maps']
|
168 |
+
value = 0
|
169 |
+
for i in range(len(encode_map)):
|
170 |
+
value += torch.abs(encode_map[i]-decode_map[-i-1]).mean()
|
171 |
+
|
172 |
+
loss_values['warp_loss'] = self.loss_weights['warp_loss'] * value
|
173 |
+
|
174 |
+
# bg loss
|
175 |
+
if self.bg_predictor and epoch >= self.bg_start and self.loss_weights['bg'] != 0:
|
176 |
+
bg_param_reverse = self.bg_predictor(x['driving'], x['source'])
|
177 |
+
value = torch.matmul(bg_param, bg_param_reverse)
|
178 |
+
eye = torch.eye(3).view(1, 1, 3, 3).type(value.type())
|
179 |
+
value = torch.abs(eye - value).mean()
|
180 |
+
loss_values['bg'] = self.loss_weights['bg'] * value
|
181 |
+
|
182 |
+
return loss_values, generated
|
Thin-Plate-Spline-Motion-Model/modules/util.py
ADDED
@@ -0,0 +1,349 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from torch import nn
|
2 |
+
import torch.nn.functional as F
|
3 |
+
import torch
|
4 |
+
|
5 |
+
|
6 |
+
class TPS:
|
7 |
+
'''
|
8 |
+
TPS transformation, mode 'kp' for Eq(2) in the paper, mode 'random' for equivariance loss.
|
9 |
+
'''
|
10 |
+
def __init__(self, mode, bs, **kwargs):
|
11 |
+
self.bs = bs
|
12 |
+
self.mode = mode
|
13 |
+
if mode == 'random':
|
14 |
+
noise = torch.normal(mean=0, std=kwargs['sigma_affine'] * torch.ones([bs, 2, 3]))
|
15 |
+
self.theta = noise + torch.eye(2, 3).view(1, 2, 3)
|
16 |
+
self.control_points = make_coordinate_grid((kwargs['points_tps'], kwargs['points_tps']), type=noise.type())
|
17 |
+
self.control_points = self.control_points.unsqueeze(0)
|
18 |
+
self.control_params = torch.normal(mean=0,
|
19 |
+
std=kwargs['sigma_tps'] * torch.ones([bs, 1, kwargs['points_tps'] ** 2]))
|
20 |
+
elif mode == 'kp':
|
21 |
+
kp_1 = kwargs["kp_1"]
|
22 |
+
kp_2 = kwargs["kp_2"]
|
23 |
+
device = kp_1.device
|
24 |
+
kp_type = kp_1.type()
|
25 |
+
self.gs = kp_1.shape[1]
|
26 |
+
n = kp_1.shape[2]
|
27 |
+
K = torch.norm(kp_1[:,:,:, None]-kp_1[:,:, None, :], dim=4, p=2)
|
28 |
+
K = K**2
|
29 |
+
K = K * torch.log(K+1e-9)
|
30 |
+
|
31 |
+
one1 = torch.ones(self.bs, kp_1.shape[1], kp_1.shape[2], 1).to(device).type(kp_type)
|
32 |
+
kp_1p = torch.cat([kp_1,one1], 3)
|
33 |
+
|
34 |
+
zero = torch.zeros(self.bs, kp_1.shape[1], 3, 3).to(device).type(kp_type)
|
35 |
+
P = torch.cat([kp_1p, zero],2)
|
36 |
+
L = torch.cat([K,kp_1p.permute(0,1,3,2)],2)
|
37 |
+
L = torch.cat([L,P],3)
|
38 |
+
|
39 |
+
zero = torch.zeros(self.bs, kp_1.shape[1], 3, 2).to(device).type(kp_type)
|
40 |
+
Y = torch.cat([kp_2, zero], 2)
|
41 |
+
one = torch.eye(L.shape[2]).expand(L.shape).to(device).type(kp_type)*0.01
|
42 |
+
L = L + one
|
43 |
+
|
44 |
+
param = torch.matmul(torch.inverse(L),Y)
|
45 |
+
self.theta = param[:,:,n:,:].permute(0,1,3,2)
|
46 |
+
|
47 |
+
self.control_points = kp_1
|
48 |
+
self.control_params = param[:,:,:n,:]
|
49 |
+
else:
|
50 |
+
raise Exception("Error TPS mode")
|
51 |
+
|
52 |
+
def transform_frame(self, frame):
|
53 |
+
grid = make_coordinate_grid(frame.shape[2:], type=frame.type()).unsqueeze(0).to(frame.device)
|
54 |
+
grid = grid.view(1, frame.shape[2] * frame.shape[3], 2)
|
55 |
+
shape = [self.bs, frame.shape[2], frame.shape[3], 2]
|
56 |
+
if self.mode == 'kp':
|
57 |
+
shape.insert(1, self.gs)
|
58 |
+
grid = self.warp_coordinates(grid).view(*shape)
|
59 |
+
return grid
|
60 |
+
|
61 |
+
def warp_coordinates(self, coordinates):
|
62 |
+
theta = self.theta.type(coordinates.type()).to(coordinates.device)
|
63 |
+
control_points = self.control_points.type(coordinates.type()).to(coordinates.device)
|
64 |
+
control_params = self.control_params.type(coordinates.type()).to(coordinates.device)
|
65 |
+
|
66 |
+
if self.mode == 'kp':
|
67 |
+
transformed = torch.matmul(theta[:, :, :, :2], coordinates.permute(0, 2, 1)) + theta[:, :, :, 2:]
|
68 |
+
|
69 |
+
distances = coordinates.view(coordinates.shape[0], 1, 1, -1, 2) - control_points.view(self.bs, control_points.shape[1], -1, 1, 2)
|
70 |
+
|
71 |
+
distances = distances ** 2
|
72 |
+
result = distances.sum(-1)
|
73 |
+
result = result * torch.log(result + 1e-9)
|
74 |
+
result = torch.matmul(result.permute(0, 1, 3, 2), control_params)
|
75 |
+
transformed = transformed.permute(0, 1, 3, 2) + result
|
76 |
+
|
77 |
+
elif self.mode == 'random':
|
78 |
+
theta = theta.unsqueeze(1)
|
79 |
+
transformed = torch.matmul(theta[:, :, :, :2], coordinates.unsqueeze(-1)) + theta[:, :, :, 2:]
|
80 |
+
transformed = transformed.squeeze(-1)
|
81 |
+
ances = coordinates.view(coordinates.shape[0], -1, 1, 2) - control_points.view(1, 1, -1, 2)
|
82 |
+
distances = ances ** 2
|
83 |
+
|
84 |
+
result = distances.sum(-1)
|
85 |
+
result = result * torch.log(result + 1e-9)
|
86 |
+
result = result * control_params
|
87 |
+
result = result.sum(dim=2).view(self.bs, coordinates.shape[1], 1)
|
88 |
+
transformed = transformed + result
|
89 |
+
else:
|
90 |
+
raise Exception("Error TPS mode")
|
91 |
+
|
92 |
+
return transformed
|
93 |
+
|
94 |
+
|
95 |
+
def kp2gaussian(kp, spatial_size, kp_variance):
|
96 |
+
"""
|
97 |
+
Transform a keypoint into gaussian like representation
|
98 |
+
"""
|
99 |
+
|
100 |
+
coordinate_grid = make_coordinate_grid(spatial_size, kp.type()).to(kp.device)
|
101 |
+
number_of_leading_dimensions = len(kp.shape) - 1
|
102 |
+
shape = (1,) * number_of_leading_dimensions + coordinate_grid.shape
|
103 |
+
coordinate_grid = coordinate_grid.view(*shape)
|
104 |
+
repeats = kp.shape[:number_of_leading_dimensions] + (1, 1, 1)
|
105 |
+
coordinate_grid = coordinate_grid.repeat(*repeats)
|
106 |
+
|
107 |
+
# Preprocess kp shape
|
108 |
+
shape = kp.shape[:number_of_leading_dimensions] + (1, 1, 2)
|
109 |
+
kp = kp.view(*shape)
|
110 |
+
|
111 |
+
mean_sub = (coordinate_grid - kp)
|
112 |
+
|
113 |
+
out = torch.exp(-0.5 * (mean_sub ** 2).sum(-1) / kp_variance)
|
114 |
+
|
115 |
+
return out
|
116 |
+
|
117 |
+
|
118 |
+
def make_coordinate_grid(spatial_size, type):
|
119 |
+
"""
|
120 |
+
Create a meshgrid [-1,1] x [-1,1] of given spatial_size.
|
121 |
+
"""
|
122 |
+
h, w = spatial_size
|
123 |
+
x = torch.arange(w).type(type)
|
124 |
+
y = torch.arange(h).type(type)
|
125 |
+
|
126 |
+
x = (2 * (x / (w - 1)) - 1)
|
127 |
+
y = (2 * (y / (h - 1)) - 1)
|
128 |
+
|
129 |
+
yy = y.view(-1, 1).repeat(1, w)
|
130 |
+
xx = x.view(1, -1).repeat(h, 1)
|
131 |
+
|
132 |
+
meshed = torch.cat([xx.unsqueeze_(2), yy.unsqueeze_(2)], 2)
|
133 |
+
|
134 |
+
return meshed
|
135 |
+
|
136 |
+
|
137 |
+
class ResBlock2d(nn.Module):
|
138 |
+
"""
|
139 |
+
Res block, preserve spatial resolution.
|
140 |
+
"""
|
141 |
+
|
142 |
+
def __init__(self, in_features, kernel_size, padding):
|
143 |
+
super(ResBlock2d, self).__init__()
|
144 |
+
self.conv1 = nn.Conv2d(in_channels=in_features, out_channels=in_features, kernel_size=kernel_size,
|
145 |
+
padding=padding)
|
146 |
+
self.conv2 = nn.Conv2d(in_channels=in_features, out_channels=in_features, kernel_size=kernel_size,
|
147 |
+
padding=padding)
|
148 |
+
self.norm1 = nn.InstanceNorm2d(in_features, affine=True)
|
149 |
+
self.norm2 = nn.InstanceNorm2d(in_features, affine=True)
|
150 |
+
|
151 |
+
def forward(self, x):
|
152 |
+
out = self.norm1(x)
|
153 |
+
out = F.relu(out)
|
154 |
+
out = self.conv1(out)
|
155 |
+
out = self.norm2(out)
|
156 |
+
out = F.relu(out)
|
157 |
+
out = self.conv2(out)
|
158 |
+
out += x
|
159 |
+
return out
|
160 |
+
|
161 |
+
|
162 |
+
class UpBlock2d(nn.Module):
|
163 |
+
"""
|
164 |
+
Upsampling block for use in decoder.
|
165 |
+
"""
|
166 |
+
|
167 |
+
def __init__(self, in_features, out_features, kernel_size=3, padding=1, groups=1):
|
168 |
+
super(UpBlock2d, self).__init__()
|
169 |
+
|
170 |
+
self.conv = nn.Conv2d(in_channels=in_features, out_channels=out_features, kernel_size=kernel_size,
|
171 |
+
padding=padding, groups=groups)
|
172 |
+
self.norm = nn.InstanceNorm2d(out_features, affine=True)
|
173 |
+
|
174 |
+
def forward(self, x):
|
175 |
+
out = F.interpolate(x, scale_factor=2)
|
176 |
+
out = self.conv(out)
|
177 |
+
out = self.norm(out)
|
178 |
+
out = F.relu(out)
|
179 |
+
return out
|
180 |
+
|
181 |
+
|
182 |
+
class DownBlock2d(nn.Module):
|
183 |
+
"""
|
184 |
+
Downsampling block for use in encoder.
|
185 |
+
"""
|
186 |
+
|
187 |
+
def __init__(self, in_features, out_features, kernel_size=3, padding=1, groups=1):
|
188 |
+
super(DownBlock2d, self).__init__()
|
189 |
+
self.conv = nn.Conv2d(in_channels=in_features, out_channels=out_features, kernel_size=kernel_size,
|
190 |
+
padding=padding, groups=groups)
|
191 |
+
self.norm = nn.InstanceNorm2d(out_features, affine=True)
|
192 |
+
self.pool = nn.AvgPool2d(kernel_size=(2, 2))
|
193 |
+
|
194 |
+
def forward(self, x):
|
195 |
+
out = self.conv(x)
|
196 |
+
out = self.norm(out)
|
197 |
+
out = F.relu(out)
|
198 |
+
out = self.pool(out)
|
199 |
+
return out
|
200 |
+
|
201 |
+
|
202 |
+
class SameBlock2d(nn.Module):
|
203 |
+
"""
|
204 |
+
Simple block, preserve spatial resolution.
|
205 |
+
"""
|
206 |
+
|
207 |
+
def __init__(self, in_features, out_features, groups=1, kernel_size=3, padding=1):
|
208 |
+
super(SameBlock2d, self).__init__()
|
209 |
+
self.conv = nn.Conv2d(in_channels=in_features, out_channels=out_features,
|
210 |
+
kernel_size=kernel_size, padding=padding, groups=groups)
|
211 |
+
self.norm = nn.InstanceNorm2d(out_features, affine=True)
|
212 |
+
|
213 |
+
def forward(self, x):
|
214 |
+
out = self.conv(x)
|
215 |
+
out = self.norm(out)
|
216 |
+
out = F.relu(out)
|
217 |
+
return out
|
218 |
+
|
219 |
+
|
220 |
+
class Encoder(nn.Module):
|
221 |
+
"""
|
222 |
+
Hourglass Encoder
|
223 |
+
"""
|
224 |
+
|
225 |
+
def __init__(self, block_expansion, in_features, num_blocks=3, max_features=256):
|
226 |
+
super(Encoder, self).__init__()
|
227 |
+
|
228 |
+
down_blocks = []
|
229 |
+
for i in range(num_blocks):
|
230 |
+
down_blocks.append(DownBlock2d(in_features if i == 0 else min(max_features, block_expansion * (2 ** i)),
|
231 |
+
min(max_features, block_expansion * (2 ** (i + 1))),
|
232 |
+
kernel_size=3, padding=1))
|
233 |
+
self.down_blocks = nn.ModuleList(down_blocks)
|
234 |
+
|
235 |
+
def forward(self, x):
|
236 |
+
outs = [x]
|
237 |
+
#print('encoder:' ,outs[-1].shape)
|
238 |
+
for down_block in self.down_blocks:
|
239 |
+
outs.append(down_block(outs[-1]))
|
240 |
+
#print('encoder:' ,outs[-1].shape)
|
241 |
+
return outs
|
242 |
+
|
243 |
+
|
244 |
+
class Decoder(nn.Module):
|
245 |
+
"""
|
246 |
+
Hourglass Decoder
|
247 |
+
"""
|
248 |
+
|
249 |
+
def __init__(self, block_expansion, in_features, num_blocks=3, max_features=256):
|
250 |
+
super(Decoder, self).__init__()
|
251 |
+
|
252 |
+
up_blocks = []
|
253 |
+
self.out_channels = []
|
254 |
+
for i in range(num_blocks)[::-1]:
|
255 |
+
in_filters = (1 if i == num_blocks - 1 else 2) * min(max_features, block_expansion * (2 ** (i + 1)))
|
256 |
+
self.out_channels.append(in_filters)
|
257 |
+
out_filters = min(max_features, block_expansion * (2 ** i))
|
258 |
+
up_blocks.append(UpBlock2d(in_filters, out_filters, kernel_size=3, padding=1))
|
259 |
+
|
260 |
+
self.up_blocks = nn.ModuleList(up_blocks)
|
261 |
+
self.out_channels.append(block_expansion + in_features)
|
262 |
+
# self.out_filters = block_expansion + in_features
|
263 |
+
|
264 |
+
def forward(self, x, mode = 0):
|
265 |
+
out = x.pop()
|
266 |
+
outs = []
|
267 |
+
for up_block in self.up_blocks:
|
268 |
+
out = up_block(out)
|
269 |
+
skip = x.pop()
|
270 |
+
out = torch.cat([out, skip], dim=1)
|
271 |
+
outs.append(out)
|
272 |
+
if(mode == 0):
|
273 |
+
return out
|
274 |
+
else:
|
275 |
+
return outs
|
276 |
+
|
277 |
+
|
278 |
+
class Hourglass(nn.Module):
|
279 |
+
"""
|
280 |
+
Hourglass architecture.
|
281 |
+
"""
|
282 |
+
|
283 |
+
def __init__(self, block_expansion, in_features, num_blocks=3, max_features=256):
|
284 |
+
super(Hourglass, self).__init__()
|
285 |
+
self.encoder = Encoder(block_expansion, in_features, num_blocks, max_features)
|
286 |
+
self.decoder = Decoder(block_expansion, in_features, num_blocks, max_features)
|
287 |
+
self.out_channels = self.decoder.out_channels
|
288 |
+
# self.out_filters = self.decoder.out_filters
|
289 |
+
|
290 |
+
def forward(self, x, mode = 0):
|
291 |
+
return self.decoder(self.encoder(x), mode)
|
292 |
+
|
293 |
+
|
294 |
+
class AntiAliasInterpolation2d(nn.Module):
|
295 |
+
"""
|
296 |
+
Band-limited downsampling, for better preservation of the input signal.
|
297 |
+
"""
|
298 |
+
def __init__(self, channels, scale):
|
299 |
+
super(AntiAliasInterpolation2d, self).__init__()
|
300 |
+
sigma = (1 / scale - 1) / 2
|
301 |
+
kernel_size = 2 * round(sigma * 4) + 1
|
302 |
+
self.ka = kernel_size // 2
|
303 |
+
self.kb = self.ka - 1 if kernel_size % 2 == 0 else self.ka
|
304 |
+
|
305 |
+
kernel_size = [kernel_size, kernel_size]
|
306 |
+
sigma = [sigma, sigma]
|
307 |
+
# The gaussian kernel is the product of the
|
308 |
+
# gaussian function of each dimension.
|
309 |
+
kernel = 1
|
310 |
+
meshgrids = torch.meshgrid(
|
311 |
+
[
|
312 |
+
torch.arange(size, dtype=torch.float32)
|
313 |
+
for size in kernel_size
|
314 |
+
]
|
315 |
+
)
|
316 |
+
for size, std, mgrid in zip(kernel_size, sigma, meshgrids):
|
317 |
+
mean = (size - 1) / 2
|
318 |
+
kernel *= torch.exp(-(mgrid - mean) ** 2 / (2 * std ** 2))
|
319 |
+
|
320 |
+
# Make sure sum of values in gaussian kernel equals 1.
|
321 |
+
kernel = kernel / torch.sum(kernel)
|
322 |
+
# Reshape to depthwise convolutional weight
|
323 |
+
kernel = kernel.view(1, 1, *kernel.size())
|
324 |
+
kernel = kernel.repeat(channels, *[1] * (kernel.dim() - 1))
|
325 |
+
|
326 |
+
self.register_buffer('weight', kernel)
|
327 |
+
self.groups = channels
|
328 |
+
self.scale = scale
|
329 |
+
|
330 |
+
def forward(self, input):
|
331 |
+
if self.scale == 1.0:
|
332 |
+
return input
|
333 |
+
|
334 |
+
out = F.pad(input, (self.ka, self.kb, self.ka, self.kb))
|
335 |
+
out = F.conv2d(out, weight=self.weight, groups=self.groups)
|
336 |
+
out = F.interpolate(out, scale_factor=(self.scale, self.scale))
|
337 |
+
|
338 |
+
return out
|
339 |
+
|
340 |
+
|
341 |
+
def to_homogeneous(coordinates):
|
342 |
+
ones_shape = list(coordinates.shape)
|
343 |
+
ones_shape[-1] = 1
|
344 |
+
ones = torch.ones(ones_shape).type(coordinates.type())
|
345 |
+
|
346 |
+
return torch.cat([coordinates, ones], dim=-1)
|
347 |
+
|
348 |
+
def from_homogeneous(coordinates):
|
349 |
+
return coordinates[..., :2] / coordinates[..., 2:3]
|
Thin-Plate-Spline-Motion-Model/predict.py
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import sys
|
3 |
+
sys.path.insert(0, "stylegan-encoder")
|
4 |
+
import tempfile
|
5 |
+
import warnings
|
6 |
+
import imageio
|
7 |
+
import numpy as np
|
8 |
+
import matplotlib.pyplot as plt
|
9 |
+
import matplotlib.animation as animation
|
10 |
+
from skimage.transform import resize
|
11 |
+
from skimage import img_as_ubyte
|
12 |
+
import torch
|
13 |
+
import torchvision.transforms as transforms
|
14 |
+
import dlib
|
15 |
+
from cog import BasePredictor, Path, Input
|
16 |
+
|
17 |
+
from demo import load_checkpoints
|
18 |
+
from demo import make_animation
|
19 |
+
from ffhq_dataset.face_alignment import image_align
|
20 |
+
from ffhq_dataset.landmarks_detector import LandmarksDetector
|
21 |
+
|
22 |
+
|
23 |
+
warnings.filterwarnings("ignore")
|
24 |
+
|
25 |
+
|
26 |
+
PREDICTOR = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")
|
27 |
+
LANDMARKS_DETECTOR = LandmarksDetector("shape_predictor_68_face_landmarks.dat")
|
28 |
+
|
29 |
+
|
30 |
+
class Predictor(BasePredictor):
|
31 |
+
def setup(self):
|
32 |
+
|
33 |
+
self.device = torch.device("cuda:0")
|
34 |
+
datasets = ["vox", "taichi", "ted", "mgif"]
|
35 |
+
(
|
36 |
+
self.inpainting,
|
37 |
+
self.kp_detector,
|
38 |
+
self.dense_motion_network,
|
39 |
+
self.avd_network,
|
40 |
+
) = ({}, {}, {}, {})
|
41 |
+
for d in datasets:
|
42 |
+
(
|
43 |
+
self.inpainting[d],
|
44 |
+
self.kp_detector[d],
|
45 |
+
self.dense_motion_network[d],
|
46 |
+
self.avd_network[d],
|
47 |
+
) = load_checkpoints(
|
48 |
+
config_path=f"config/{d}-384.yaml"
|
49 |
+
if d == "ted"
|
50 |
+
else f"config/{d}-256.yaml",
|
51 |
+
checkpoint_path=f"checkpoints/{d}.pth.tar",
|
52 |
+
device=self.device,
|
53 |
+
)
|
54 |
+
|
55 |
+
def predict(
|
56 |
+
self,
|
57 |
+
source_image: Path = Input(
|
58 |
+
description="Input source image.",
|
59 |
+
),
|
60 |
+
driving_video: Path = Input(
|
61 |
+
description="Choose a micromotion.",
|
62 |
+
),
|
63 |
+
dataset_name: str = Input(
|
64 |
+
choices=["vox", "taichi", "ted", "mgif"],
|
65 |
+
default="vox",
|
66 |
+
description="Choose a dataset.",
|
67 |
+
),
|
68 |
+
) -> Path:
|
69 |
+
|
70 |
+
predict_mode = "relative" # ['standard', 'relative', 'avd']
|
71 |
+
# find_best_frame = False
|
72 |
+
|
73 |
+
pixel = 384 if dataset_name == "ted" else 256
|
74 |
+
|
75 |
+
if dataset_name == "vox":
|
76 |
+
# first run face alignment
|
77 |
+
align_image(str(source_image), 'aligned.png')
|
78 |
+
source_image = imageio.imread('aligned.png')
|
79 |
+
else:
|
80 |
+
source_image = imageio.imread(str(source_image))
|
81 |
+
reader = imageio.get_reader(str(driving_video))
|
82 |
+
fps = reader.get_meta_data()["fps"]
|
83 |
+
source_image = resize(source_image, (pixel, pixel))[..., :3]
|
84 |
+
|
85 |
+
driving_video = []
|
86 |
+
try:
|
87 |
+
for im in reader:
|
88 |
+
driving_video.append(im)
|
89 |
+
except RuntimeError:
|
90 |
+
pass
|
91 |
+
reader.close()
|
92 |
+
|
93 |
+
driving_video = [
|
94 |
+
resize(frame, (pixel, pixel))[..., :3] for frame in driving_video
|
95 |
+
]
|
96 |
+
|
97 |
+
inpainting, kp_detector, dense_motion_network, avd_network = (
|
98 |
+
self.inpainting[dataset_name],
|
99 |
+
self.kp_detector[dataset_name],
|
100 |
+
self.dense_motion_network[dataset_name],
|
101 |
+
self.avd_network[dataset_name],
|
102 |
+
)
|
103 |
+
|
104 |
+
predictions = make_animation(
|
105 |
+
source_image,
|
106 |
+
driving_video,
|
107 |
+
inpainting,
|
108 |
+
kp_detector,
|
109 |
+
dense_motion_network,
|
110 |
+
avd_network,
|
111 |
+
device="cuda:0",
|
112 |
+
mode=predict_mode,
|
113 |
+
)
|
114 |
+
|
115 |
+
# save resulting video
|
116 |
+
out_path = Path(tempfile.mkdtemp()) / "output.mp4"
|
117 |
+
imageio.mimsave(
|
118 |
+
str(out_path), [img_as_ubyte(frame) for frame in predictions], fps=fps
|
119 |
+
)
|
120 |
+
return out_path
|
121 |
+
|
122 |
+
|
123 |
+
def align_image(raw_img_path, aligned_face_path):
|
124 |
+
for i, face_landmarks in enumerate(LANDMARKS_DETECTOR.get_landmarks(raw_img_path), start=1):
|
125 |
+
image_align(raw_img_path, aligned_face_path, face_landmarks)
|
Thin-Plate-Spline-Motion-Model/reconstruction.py
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from tqdm import tqdm
|
3 |
+
import torch
|
4 |
+
from torch.utils.data import DataLoader
|
5 |
+
from logger import Logger, Visualizer
|
6 |
+
import numpy as np
|
7 |
+
import imageio
|
8 |
+
|
9 |
+
|
10 |
+
def reconstruction(config, inpainting_network, kp_detector, bg_predictor, dense_motion_network, checkpoint, log_dir, dataset):
|
11 |
+
png_dir = os.path.join(log_dir, 'reconstruction/png')
|
12 |
+
log_dir = os.path.join(log_dir, 'reconstruction')
|
13 |
+
|
14 |
+
if checkpoint is not None:
|
15 |
+
Logger.load_cpk(checkpoint, inpainting_network=inpainting_network, kp_detector=kp_detector,
|
16 |
+
bg_predictor=bg_predictor, dense_motion_network=dense_motion_network)
|
17 |
+
else:
|
18 |
+
raise AttributeError("Checkpoint should be specified for mode='reconstruction'.")
|
19 |
+
dataloader = DataLoader(dataset, batch_size=1, shuffle=False, num_workers=1)
|
20 |
+
|
21 |
+
if not os.path.exists(log_dir):
|
22 |
+
os.makedirs(log_dir)
|
23 |
+
|
24 |
+
if not os.path.exists(png_dir):
|
25 |
+
os.makedirs(png_dir)
|
26 |
+
|
27 |
+
loss_list = []
|
28 |
+
|
29 |
+
inpainting_network.eval()
|
30 |
+
kp_detector.eval()
|
31 |
+
dense_motion_network.eval()
|
32 |
+
if bg_predictor:
|
33 |
+
bg_predictor.eval()
|
34 |
+
|
35 |
+
for it, x in tqdm(enumerate(dataloader)):
|
36 |
+
with torch.no_grad():
|
37 |
+
predictions = []
|
38 |
+
visualizations = []
|
39 |
+
if torch.cuda.is_available():
|
40 |
+
x['video'] = x['video'].cuda()
|
41 |
+
kp_source = kp_detector(x['video'][:, :, 0])
|
42 |
+
for frame_idx in range(x['video'].shape[2]):
|
43 |
+
source = x['video'][:, :, 0]
|
44 |
+
driving = x['video'][:, :, frame_idx]
|
45 |
+
kp_driving = kp_detector(driving)
|
46 |
+
bg_params = None
|
47 |
+
if bg_predictor:
|
48 |
+
bg_params = bg_predictor(source, driving)
|
49 |
+
|
50 |
+
dense_motion = dense_motion_network(source_image=source, kp_driving=kp_driving,
|
51 |
+
kp_source=kp_source, bg_param = bg_params,
|
52 |
+
dropout_flag = False)
|
53 |
+
out = inpainting_network(source, dense_motion)
|
54 |
+
out['kp_source'] = kp_source
|
55 |
+
out['kp_driving'] = kp_driving
|
56 |
+
|
57 |
+
predictions.append(np.transpose(out['prediction'].data.cpu().numpy(), [0, 2, 3, 1])[0])
|
58 |
+
|
59 |
+
visualization = Visualizer(**config['visualizer_params']).visualize(source=source,
|
60 |
+
driving=driving, out=out)
|
61 |
+
visualizations.append(visualization)
|
62 |
+
loss = torch.abs(out['prediction'] - driving).mean().cpu().numpy()
|
63 |
+
|
64 |
+
loss_list.append(loss)
|
65 |
+
# print(np.mean(loss_list))
|
66 |
+
predictions = np.concatenate(predictions, axis=1)
|
67 |
+
imageio.imsave(os.path.join(png_dir, x['name'][0] + '.png'), (255 * predictions).astype(np.uint8))
|
68 |
+
|
69 |
+
print("Reconstruction loss: %s" % np.mean(loss_list))
|
Thin-Plate-Spline-Motion-Model/requirements.txt
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
cffi==1.14.6
|
2 |
+
cycler==0.10.0
|
3 |
+
decorator==5.1.0
|
4 |
+
face-alignment==1.3.5
|
5 |
+
imageio==2.9.0
|
6 |
+
imageio-ffmpeg==0.4.5
|
7 |
+
kiwisolver==1.3.2
|
8 |
+
matplotlib==3.4.3
|
9 |
+
networkx==2.6.3
|
10 |
+
numpy==1.20.3
|
11 |
+
pandas==1.3.3
|
12 |
+
Pillow==8.3.2
|
13 |
+
pycparser==2.20
|
14 |
+
pyparsing==2.4.7
|
15 |
+
python-dateutil==2.8.2
|
16 |
+
pytz==2021.1
|
17 |
+
PyWavelets==1.1.1
|
18 |
+
PyYAML==5.4.1
|
19 |
+
scikit-image==0.18.3
|
20 |
+
scikit-learn==1.0
|
21 |
+
scipy==1.7.1
|
22 |
+
six==1.16.0
|
23 |
+
torch==1.10.0+cu113
|
24 |
+
torchvision==0.11.0+cu113
|
25 |
+
tqdm==4.62.3
|
Thin-Plate-Spline-Motion-Model/run.py
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import matplotlib
|
2 |
+
matplotlib.use('Agg')
|
3 |
+
|
4 |
+
import os, sys
|
5 |
+
import yaml
|
6 |
+
from argparse import ArgumentParser
|
7 |
+
from time import gmtime, strftime
|
8 |
+
from shutil import copy
|
9 |
+
from frames_dataset import FramesDataset
|
10 |
+
|
11 |
+
from modules.inpainting_network import InpaintingNetwork
|
12 |
+
from modules.keypoint_detector import KPDetector
|
13 |
+
from modules.bg_motion_predictor import BGMotionPredictor
|
14 |
+
from modules.dense_motion import DenseMotionNetwork
|
15 |
+
from modules.avd_network import AVDNetwork
|
16 |
+
import torch
|
17 |
+
from train import train
|
18 |
+
from train_avd import train_avd
|
19 |
+
from reconstruction import reconstruction
|
20 |
+
import os
|
21 |
+
|
22 |
+
|
23 |
+
if __name__ == "__main__":
|
24 |
+
|
25 |
+
if sys.version_info[0] < 3:
|
26 |
+
raise Exception("You must use Python 3 or higher. Recommended version is Python 3.9")
|
27 |
+
|
28 |
+
parser = ArgumentParser()
|
29 |
+
parser.add_argument("--config", default="config/vox-256.yaml", help="path to config")
|
30 |
+
parser.add_argument("--mode", default="train", choices=["train", "reconstruction", "train_avd"])
|
31 |
+
parser.add_argument("--log_dir", default='log', help="path to log into")
|
32 |
+
parser.add_argument("--checkpoint", default=None, help="path to checkpoint to restore")
|
33 |
+
parser.add_argument("--device_ids", default="0,1", type=lambda x: list(map(int, x.split(','))),
|
34 |
+
help="Names of the devices comma separated.")
|
35 |
+
|
36 |
+
opt = parser.parse_args()
|
37 |
+
with open(opt.config) as f:
|
38 |
+
config = yaml.load(f)
|
39 |
+
|
40 |
+
if opt.checkpoint is not None:
|
41 |
+
log_dir = os.path.join(*os.path.split(opt.checkpoint)[:-1])
|
42 |
+
else:
|
43 |
+
log_dir = os.path.join(opt.log_dir, os.path.basename(opt.config).split('.')[0])
|
44 |
+
log_dir += ' ' + strftime("%d_%m_%y_%H.%M.%S", gmtime())
|
45 |
+
|
46 |
+
inpainting = InpaintingNetwork(**config['model_params']['generator_params'],
|
47 |
+
**config['model_params']['common_params'])
|
48 |
+
|
49 |
+
if torch.cuda.is_available():
|
50 |
+
cuda_device = torch.device('cuda:'+str(opt.device_ids[0]))
|
51 |
+
inpainting.to(cuda_device)
|
52 |
+
|
53 |
+
kp_detector = KPDetector(**config['model_params']['common_params'])
|
54 |
+
dense_motion_network = DenseMotionNetwork(**config['model_params']['common_params'],
|
55 |
+
**config['model_params']['dense_motion_params'])
|
56 |
+
|
57 |
+
if torch.cuda.is_available():
|
58 |
+
kp_detector.to(opt.device_ids[0])
|
59 |
+
dense_motion_network.to(opt.device_ids[0])
|
60 |
+
|
61 |
+
bg_predictor = None
|
62 |
+
if (config['model_params']['common_params']['bg']):
|
63 |
+
bg_predictor = BGMotionPredictor()
|
64 |
+
if torch.cuda.is_available():
|
65 |
+
bg_predictor.to(opt.device_ids[0])
|
66 |
+
|
67 |
+
avd_network = None
|
68 |
+
if opt.mode == "train_avd":
|
69 |
+
avd_network = AVDNetwork(num_tps=config['model_params']['common_params']['num_tps'],
|
70 |
+
**config['model_params']['avd_network_params'])
|
71 |
+
if torch.cuda.is_available():
|
72 |
+
avd_network.to(opt.device_ids[0])
|
73 |
+
|
74 |
+
dataset = FramesDataset(is_train=(opt.mode.startswith('train')), **config['dataset_params'])
|
75 |
+
|
76 |
+
if not os.path.exists(log_dir):
|
77 |
+
os.makedirs(log_dir)
|
78 |
+
if not os.path.exists(os.path.join(log_dir, os.path.basename(opt.config))):
|
79 |
+
copy(opt.config, log_dir)
|
80 |
+
|
81 |
+
if opt.mode == 'train':
|
82 |
+
print("Training...")
|
83 |
+
train(config, inpainting, kp_detector, bg_predictor, dense_motion_network, opt.checkpoint, log_dir, dataset)
|
84 |
+
elif opt.mode == 'train_avd':
|
85 |
+
print("Training Animation via Disentaglement...")
|
86 |
+
train_avd(config, inpainting, kp_detector, bg_predictor, dense_motion_network, avd_network, opt.checkpoint, log_dir, dataset)
|
87 |
+
elif opt.mode == 'reconstruction':
|
88 |
+
print("Reconstruction...")
|
89 |
+
reconstruction(config, inpainting, kp_detector, bg_predictor, dense_motion_network, opt.checkpoint, log_dir, dataset)
|
Thin-Plate-Spline-Motion-Model/train.py
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from tqdm import trange
|
2 |
+
import torch
|
3 |
+
from torch.utils.data import DataLoader
|
4 |
+
from logger import Logger
|
5 |
+
from modules.model import GeneratorFullModel
|
6 |
+
from torch.optim.lr_scheduler import MultiStepLR
|
7 |
+
from torch.nn.utils import clip_grad_norm_
|
8 |
+
from frames_dataset import DatasetRepeater
|
9 |
+
import math
|
10 |
+
|
11 |
+
def train(config, inpainting_network, kp_detector, bg_predictor, dense_motion_network, checkpoint, log_dir, dataset):
|
12 |
+
train_params = config['train_params']
|
13 |
+
optimizer = torch.optim.Adam(
|
14 |
+
[{'params': list(inpainting_network.parameters()) +
|
15 |
+
list(dense_motion_network.parameters()) +
|
16 |
+
list(kp_detector.parameters()), 'initial_lr': train_params['lr_generator']}],lr=train_params['lr_generator'], betas=(0.5, 0.999), weight_decay = 1e-4)
|
17 |
+
|
18 |
+
optimizer_bg_predictor = None
|
19 |
+
if bg_predictor:
|
20 |
+
optimizer_bg_predictor = torch.optim.Adam(
|
21 |
+
[{'params':bg_predictor.parameters(),'initial_lr': train_params['lr_generator']}],
|
22 |
+
lr=train_params['lr_generator'], betas=(0.5, 0.999), weight_decay = 1e-4)
|
23 |
+
|
24 |
+
if checkpoint is not None:
|
25 |
+
start_epoch = Logger.load_cpk(
|
26 |
+
checkpoint, inpainting_network = inpainting_network, dense_motion_network = dense_motion_network,
|
27 |
+
kp_detector = kp_detector, bg_predictor = bg_predictor,
|
28 |
+
optimizer = optimizer, optimizer_bg_predictor = optimizer_bg_predictor)
|
29 |
+
print('load success:', start_epoch)
|
30 |
+
start_epoch += 1
|
31 |
+
else:
|
32 |
+
start_epoch = 0
|
33 |
+
|
34 |
+
scheduler_optimizer = MultiStepLR(optimizer, train_params['epoch_milestones'], gamma=0.1,
|
35 |
+
last_epoch=start_epoch - 1)
|
36 |
+
if bg_predictor:
|
37 |
+
scheduler_bg_predictor = MultiStepLR(optimizer_bg_predictor, train_params['epoch_milestones'],
|
38 |
+
gamma=0.1, last_epoch=start_epoch - 1)
|
39 |
+
|
40 |
+
if 'num_repeats' in train_params or train_params['num_repeats'] != 1:
|
41 |
+
dataset = DatasetRepeater(dataset, train_params['num_repeats'])
|
42 |
+
dataloader = DataLoader(dataset, batch_size=train_params['batch_size'], shuffle=True,
|
43 |
+
num_workers=train_params['dataloader_workers'], drop_last=True)
|
44 |
+
|
45 |
+
generator_full = GeneratorFullModel(kp_detector, bg_predictor, dense_motion_network, inpainting_network, train_params)
|
46 |
+
|
47 |
+
if torch.cuda.is_available():
|
48 |
+
generator_full = torch.nn.DataParallel(generator_full).cuda()
|
49 |
+
|
50 |
+
bg_start = train_params['bg_start']
|
51 |
+
|
52 |
+
with Logger(log_dir=log_dir, visualizer_params=config['visualizer_params'],
|
53 |
+
checkpoint_freq=train_params['checkpoint_freq']) as logger:
|
54 |
+
for epoch in trange(start_epoch, train_params['num_epochs']):
|
55 |
+
for x in dataloader:
|
56 |
+
if(torch.cuda.is_available()):
|
57 |
+
x['driving'] = x['driving'].cuda()
|
58 |
+
x['source'] = x['source'].cuda()
|
59 |
+
|
60 |
+
losses_generator, generated = generator_full(x, epoch)
|
61 |
+
loss_values = [val.mean() for val in losses_generator.values()]
|
62 |
+
loss = sum(loss_values)
|
63 |
+
loss.backward()
|
64 |
+
|
65 |
+
clip_grad_norm_(kp_detector.parameters(), max_norm=10, norm_type = math.inf)
|
66 |
+
clip_grad_norm_(dense_motion_network.parameters(), max_norm=10, norm_type = math.inf)
|
67 |
+
if bg_predictor and epoch>=bg_start:
|
68 |
+
clip_grad_norm_(bg_predictor.parameters(), max_norm=10, norm_type = math.inf)
|
69 |
+
|
70 |
+
optimizer.step()
|
71 |
+
optimizer.zero_grad()
|
72 |
+
if bg_predictor and epoch>=bg_start:
|
73 |
+
optimizer_bg_predictor.step()
|
74 |
+
optimizer_bg_predictor.zero_grad()
|
75 |
+
|
76 |
+
losses = {key: value.mean().detach().data.cpu().numpy() for key, value in losses_generator.items()}
|
77 |
+
logger.log_iter(losses=losses)
|
78 |
+
|
79 |
+
scheduler_optimizer.step()
|
80 |
+
if bg_predictor:
|
81 |
+
scheduler_bg_predictor.step()
|
82 |
+
|
83 |
+
model_save = {
|
84 |
+
'inpainting_network': inpainting_network,
|
85 |
+
'dense_motion_network': dense_motion_network,
|
86 |
+
'kp_detector': kp_detector,
|
87 |
+
'optimizer': optimizer,
|
88 |
+
}
|
89 |
+
if bg_predictor and epoch>=bg_start:
|
90 |
+
model_save['bg_predictor'] = bg_predictor
|
91 |
+
model_save['optimizer_bg_predictor'] = optimizer_bg_predictor
|
92 |
+
|
93 |
+
logger.log_epoch(epoch, model_save, inp=x, out=generated)
|
94 |
+
|
Thin-Plate-Spline-Motion-Model/train_avd.py
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from tqdm import trange
|
2 |
+
import torch
|
3 |
+
from torch.utils.data import DataLoader
|
4 |
+
from logger import Logger
|
5 |
+
from torch.optim.lr_scheduler import MultiStepLR
|
6 |
+
from frames_dataset import DatasetRepeater
|
7 |
+
|
8 |
+
|
9 |
+
def random_scale(kp_params, scale):
|
10 |
+
theta = torch.rand(kp_params['fg_kp'].shape[0], 2) * (2 * scale) + (1 - scale)
|
11 |
+
theta = torch.diag_embed(theta).unsqueeze(1).type(kp_params['fg_kp'].type())
|
12 |
+
new_kp_params = {'fg_kp': torch.matmul(theta, kp_params['fg_kp'].unsqueeze(-1)).squeeze(-1)}
|
13 |
+
return new_kp_params
|
14 |
+
|
15 |
+
|
16 |
+
def train_avd(config, inpainting_network, kp_detector, bg_predictor, dense_motion_network,
|
17 |
+
avd_network, checkpoint, log_dir, dataset):
|
18 |
+
train_params = config['train_avd_params']
|
19 |
+
|
20 |
+
optimizer = torch.optim.Adam(avd_network.parameters(), lr=train_params['lr'], betas=(0.5, 0.999))
|
21 |
+
|
22 |
+
if checkpoint is not None:
|
23 |
+
Logger.load_cpk(checkpoint, inpainting_network=inpainting_network, kp_detector=kp_detector,
|
24 |
+
bg_predictor=bg_predictor, avd_network=avd_network,
|
25 |
+
dense_motion_network= dense_motion_network,optimizer_avd=optimizer)
|
26 |
+
start_epoch = 0
|
27 |
+
else:
|
28 |
+
raise AttributeError("Checkpoint should be specified for mode='train_avd'.")
|
29 |
+
|
30 |
+
scheduler = MultiStepLR(optimizer, train_params['epoch_milestones'], gamma=0.1)
|
31 |
+
|
32 |
+
if 'num_repeats' in train_params or train_params['num_repeats'] != 1:
|
33 |
+
dataset = DatasetRepeater(dataset, train_params['num_repeats'])
|
34 |
+
|
35 |
+
dataloader = DataLoader(dataset, batch_size=train_params['batch_size'], shuffle=True,
|
36 |
+
num_workers=train_params['dataloader_workers'], drop_last=True)
|
37 |
+
|
38 |
+
with Logger(log_dir=log_dir, visualizer_params=config['visualizer_params'],
|
39 |
+
checkpoint_freq=train_params['checkpoint_freq']) as logger:
|
40 |
+
for epoch in trange(start_epoch, train_params['num_epochs']):
|
41 |
+
avd_network.train()
|
42 |
+
for x in dataloader:
|
43 |
+
with torch.no_grad():
|
44 |
+
kp_source = kp_detector(x['source'].cuda())
|
45 |
+
kp_driving_gt = kp_detector(x['driving'].cuda())
|
46 |
+
kp_driving_random = random_scale(kp_driving_gt, scale=train_params['random_scale'])
|
47 |
+
rec = avd_network(kp_source, kp_driving_random)
|
48 |
+
|
49 |
+
reconstruction_kp = train_params['lambda_shift'] * \
|
50 |
+
torch.abs(kp_driving_gt['fg_kp'] - rec['fg_kp']).mean()
|
51 |
+
|
52 |
+
loss_dict = {'rec_kp': reconstruction_kp}
|
53 |
+
loss = reconstruction_kp
|
54 |
+
|
55 |
+
loss.backward()
|
56 |
+
optimizer.step()
|
57 |
+
optimizer.zero_grad()
|
58 |
+
|
59 |
+
losses = {key: value.mean().detach().data.cpu().numpy() for key, value in loss_dict.items()}
|
60 |
+
logger.log_iter(losses=losses)
|
61 |
+
|
62 |
+
# Visualization
|
63 |
+
avd_network.eval()
|
64 |
+
with torch.no_grad():
|
65 |
+
source = x['source'][:6].cuda()
|
66 |
+
driving = torch.cat([x['driving'][[0, 1]].cuda(), source[[2, 3, 2, 1]]], dim=0)
|
67 |
+
kp_source = kp_detector(source)
|
68 |
+
kp_driving = kp_detector(driving)
|
69 |
+
|
70 |
+
out = avd_network(kp_source, kp_driving)
|
71 |
+
kp_driving = out
|
72 |
+
dense_motion = dense_motion_network(source_image=source, kp_driving=kp_driving,
|
73 |
+
kp_source=kp_source)
|
74 |
+
generated = inpainting_network(source, dense_motion)
|
75 |
+
|
76 |
+
generated.update({'kp_source': kp_source, 'kp_driving': kp_driving})
|
77 |
+
|
78 |
+
scheduler.step(epoch)
|
79 |
+
model_save = {
|
80 |
+
'inpainting_network': inpainting_network,
|
81 |
+
'dense_motion_network': dense_motion_network,
|
82 |
+
'kp_detector': kp_detector,
|
83 |
+
'avd_network': avd_network,
|
84 |
+
'optimizer_avd': optimizer
|
85 |
+
}
|
86 |
+
if bg_predictor :
|
87 |
+
model_save['bg_predictor'] = bg_predictor
|
88 |
+
|
89 |
+
logger.log_epoch(epoch, model_save,
|
90 |
+
inp={'source': source, 'driving': driving},
|
91 |
+
out=generated)
|
app.py
ADDED
@@ -0,0 +1,784 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html class="">
|
3 |
+
<head>
|
4 |
+
<meta charset="utf-8" />
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
|
6 |
+
<meta name="description" content="We’re on a journey to advance and democratize artificial intelligence through open source and open science." />
|
7 |
+
<meta property="fb:app_id" content="1321688464574422" />
|
8 |
+
<meta name="twitter:card" content="summary_large_image" />
|
9 |
+
<meta name="twitter:site" content="@huggingface" />
|
10 |
+
<meta property="og:title" content="app.py · CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model at main" />
|
11 |
+
<meta property="og:type" content="website" />
|
12 |
+
<meta property="og:url" content="https://huggingface.co/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/blob/main/app.py" />
|
13 |
+
<meta property="og:image" content="https://cdn-thumbnails.huggingface.co/social-thumbnails/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model.png" />
|
14 |
+
|
15 |
+
<link rel="stylesheet" href="/front/build/kube-63b5efc/style.css" />
|
16 |
+
|
17 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
18 |
+
<link
|
19 |
+
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900&display=swap"
|
20 |
+
rel="stylesheet"
|
21 |
+
/>
|
22 |
+
<link
|
23 |
+
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&display=swap"
|
24 |
+
rel="stylesheet"
|
25 |
+
/>
|
26 |
+
|
27 |
+
<link
|
28 |
+
rel="preload"
|
29 |
+
href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.css"
|
30 |
+
as="style"
|
31 |
+
onload="this.onload=null;this.rel='stylesheet'"
|
32 |
+
/>
|
33 |
+
<noscript>
|
34 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.css" />
|
35 |
+
</noscript>
|
36 |
+
|
37 |
+
<!-- HEAD_svelte-1oal594_START --><style>.blob-line-num::before {
|
38 |
+
content: attr(data-line-num);
|
39 |
+
}
|
40 |
+
</style><!-- HEAD_svelte-1oal594_END -->
|
41 |
+
|
42 |
+
<title>app.py · CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model at main</title>
|
43 |
+
|
44 |
+
<script defer data-domain="huggingface.co" src="/js/script.js"></script>
|
45 |
+
<script type="text/javascript" src="https://de5282c3ca0c.edge.sdk.awswaf.com/de5282c3ca0c/526cf06acb0d/challenge.js" defer></script>
|
46 |
+
</head>
|
47 |
+
<body class="flex flex-col min-h-screen bg-white dark:bg-gray-950 text-black ViewerBlobPage">
|
48 |
+
<div class="flex min-h-screen flex-col">
|
49 |
+
<div class="SVELTE_HYDRATER contents" data-props="{"classNames":"","isWide":false,"isZh":false}" data-target="MainHeader"><header class="border-b border-gray-100 "><div class="w-full px-4 container flex h-16 items-center"><div class="flex flex-1 items-center"><a class="mr-5 flex flex-none items-center lg:mr-6" href="/"><img alt="Hugging Face's logo" class="w-7 md:mr-2" src="/front/assets/huggingface_logo-noborder.svg">
|
50 |
+
<span class="hidden whitespace-nowrap text-lg font-bold md:block">Hugging Face</span></a>
|
51 |
+
<div class="relative flex-1 lg:max-w-sm mr-2 sm:mr-4 lg:mr-6"><input autocomplete="off" class="w-full dark:bg-gray-950 pl-8 form-input-alt h-9 pr-3 focus:shadow-xl" name="" placeholder="Search models, datasets, users..." spellcheck="false" type="text" value="">
|
52 |
+
<svg class="absolute left-2.5 text-gray-400 top-1/2 transform -translate-y-1/2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M30 28.59L22.45 21A11 11 0 1 0 21 22.45L28.59 30zM5 14a9 9 0 1 1 9 9a9 9 0 0 1-9-9z" fill="currentColor"></path></svg>
|
53 |
+
</div>
|
54 |
+
<div class="flex flex-none items-center justify-center p-0.5 place-self-stretch lg:hidden"><button class="relative z-40 flex h-6 w-8 items-center justify-center" type="button"><svg width="1em" height="1em" viewBox="0 0 10 10" class="text-xl" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" preserveAspectRatio="xMidYMid meet" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.65039 2.9999C1.65039 2.8066 1.80709 2.6499 2.00039 2.6499H8.00039C8.19369 2.6499 8.35039 2.8066 8.35039 2.9999C8.35039 3.1932 8.19369 3.3499 8.00039 3.3499H2.00039C1.80709 3.3499 1.65039 3.1932 1.65039 2.9999ZM1.65039 4.9999C1.65039 4.8066 1.80709 4.6499 2.00039 4.6499H8.00039C8.19369 4.6499 8.35039 4.8066 8.35039 4.9999C8.35039 5.1932 8.19369 5.3499 8.00039 5.3499H2.00039C1.80709 5.3499 1.65039 5.1932 1.65039 4.9999ZM2.00039 6.6499C1.80709 6.6499 1.65039 6.8066 1.65039 6.9999C1.65039 7.1932 1.80709 7.3499 2.00039 7.3499H8.00039C8.19369 7.3499 8.35039 7.1932 8.35039 6.9999C8.35039 6.8066 8.19369 6.6499 8.00039 6.6499H2.00039Z"></path></svg>
|
55 |
+
</button>
|
56 |
+
|
57 |
+
</div></div>
|
58 |
+
<nav aria-label="Main" class="ml-auto hidden lg:block"><ul class="flex items-center space-x-2"><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-indigo-700" href="/models"><svg class="mr-1.5 text-gray-400 group-hover:text-indigo-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-quaternary" d="M20.23 7.24L12 12L3.77 7.24a1.98 1.98 0 0 1 .7-.71L11 2.76c.62-.35 1.38-.35 2 0l6.53 3.77c.29.173.531.418.7.71z" opacity=".25" fill="currentColor"></path><path class="uim-tertiary" d="M12 12v9.5a2.09 2.09 0 0 1-.91-.21L4.5 17.48a2.003 2.003 0 0 1-1-1.73v-7.5a2.06 2.06 0 0 1 .27-1.01L12 12z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M20.5 8.25v7.5a2.003 2.003 0 0 1-1 1.73l-6.62 3.82c-.275.13-.576.198-.88.2V12l8.23-4.76c.175.308.268.656.27 1.01z" fill="currentColor"></path></svg>
|
59 |
+
Models</a>
|
60 |
+
</li><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-red-700" href="/datasets"><svg class="mr-1.5 text-gray-400 group-hover:text-red-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 25 25"><ellipse cx="12.5" cy="5" fill="currentColor" fill-opacity="0.25" rx="7.5" ry="2"></ellipse><path d="M12.5 15C16.6421 15 20 14.1046 20 13V20C20 21.1046 16.6421 22 12.5 22C8.35786 22 5 21.1046 5 20V13C5 14.1046 8.35786 15 12.5 15Z" fill="currentColor" opacity="0.5"></path><path d="M12.5 7C16.6421 7 20 6.10457 20 5V11.5C20 12.6046 16.6421 13.5 12.5 13.5C8.35786 13.5 5 12.6046 5 11.5V5C5 6.10457 8.35786 7 12.5 7Z" fill="currentColor" opacity="0.5"></path><path d="M5.23628 12C5.08204 12.1598 5 12.8273 5 13C5 14.1046 8.35786 15 12.5 15C16.6421 15 20 14.1046 20 13C20 12.8273 19.918 12.1598 19.7637 12C18.9311 12.8626 15.9947 13.5 12.5 13.5C9.0053 13.5 6.06886 12.8626 5.23628 12Z" fill="currentColor"></path></svg>
|
61 |
+
Datasets</a>
|
62 |
+
</li><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-blue-700" href="/spaces"><svg class="mr-1.5 text-gray-400 group-hover:text-blue-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" viewBox="0 0 25 25"><path opacity=".5" d="M6.016 14.674v4.31h4.31v-4.31h-4.31ZM14.674 14.674v4.31h4.31v-4.31h-4.31ZM6.016 6.016v4.31h4.31v-4.31h-4.31Z" fill="currentColor"></path><path opacity=".75" fill-rule="evenodd" clip-rule="evenodd" d="M3 4.914C3 3.857 3.857 3 4.914 3h6.514c.884 0 1.628.6 1.848 1.414a5.171 5.171 0 0 1 7.31 7.31c.815.22 1.414.964 1.414 1.848v6.514A1.914 1.914 0 0 1 20.086 22H4.914A1.914 1.914 0 0 1 3 20.086V4.914Zm3.016 1.102v4.31h4.31v-4.31h-4.31Zm0 12.968v-4.31h4.31v4.31h-4.31Zm8.658 0v-4.31h4.31v4.31h-4.31Zm0-10.813a2.155 2.155 0 1 1 4.31 0 2.155 2.155 0 0 1-4.31 0Z" fill="currentColor"></path><path opacity=".25" d="M16.829 6.016a2.155 2.155 0 1 0 0 4.31 2.155 2.155 0 0 0 0-4.31Z" fill="currentColor"></path></svg>
|
63 |
+
Spaces</a>
|
64 |
+
</li><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-yellow-700" href="/docs"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="mr-1.5 text-gray-400 group-hover:text-yellow-500" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path opacity="0.5" d="M20.9022 5.10334L10.8012 10.8791L7.76318 9.11193C8.07741 8.56791 8.5256 8.11332 9.06512 7.7914L15.9336 3.73907C17.0868 3.08811 18.5002 3.26422 19.6534 3.91519L19.3859 3.73911C19.9253 4.06087 20.5879 4.56025 20.9022 5.10334Z" fill="currentColor"></path><path d="M10.7999 10.8792V28.5483C10.2136 28.5475 9.63494 28.4139 9.10745 28.1578C8.5429 27.8312 8.074 27.3621 7.74761 26.7975C7.42122 26.2327 7.24878 25.5923 7.24756 24.9402V10.9908C7.25062 10.3319 7.42358 9.68487 7.74973 9.1123L10.7999 10.8792Z" fill="currentColor" fill-opacity="0.75"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M21.3368 10.8499V6.918C21.3331 6.25959 21.16 5.61234 20.8346 5.03949L10.7971 10.8727L10.8046 10.874L21.3368 10.8499Z" fill="currentColor"></path><path opacity="0.5" d="M21.7937 10.8488L10.7825 10.8741V28.5486L21.7937 28.5234C23.3344 28.5234 24.5835 27.2743 24.5835 25.7335V13.6387C24.5835 12.0979 23.4365 11.1233 21.7937 10.8488Z" fill="currentColor"></path></svg>
|
65 |
+
Docs</a>
|
66 |
+
</li>
|
67 |
+
<li><div class="relative ">
|
68 |
+
<button class="px-2 py-0.5 group hover:text-green-700 dark:hover:text-gray-400 flex items-center " type="button">
|
69 |
+
<svg class="mr-1.5 text-gray-400 group-hover:text-green-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-tertiary" d="M19 6H5a3 3 0 0 0-3 3v2.72L8.837 14h6.326L22 11.72V9a3 3 0 0 0-3-3z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M10 6V5h4v1h2V5a2.002 2.002 0 0 0-2-2h-4a2.002 2.002 0 0 0-2 2v1h2zm-1.163 8L2 11.72V18a3.003 3.003 0 0 0 3 3h14a3.003 3.003 0 0 0 3-3v-6.28L15.163 14H8.837z" fill="currentColor"></path></svg>
|
70 |
+
Solutions
|
71 |
+
</button>
|
72 |
+
|
73 |
+
|
74 |
+
|
75 |
+
</div></li>
|
76 |
+
<li><a class="group flex items-center px-2 py-0.5 hover:text-gray-500 dark:hover:text-gray-400" href="/pricing">Pricing
|
77 |
+
</a></li>
|
78 |
+
|
79 |
+
<li><div class="relative group">
|
80 |
+
<button class="px-2 py-0.5 hover:text-gray-500 dark:hover:text-gray-600 flex items-center " type="button">
|
81 |
+
<svg class="mr-1.5 text-gray-500 w-5 group-hover:text-gray-400 dark:text-gray-300 dark:group-hover:text-gray-400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" viewBox="0 0 32 18" preserveAspectRatio="xMidYMid meet"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4504 3.30221C14.4504 2.836 14.8284 2.45807 15.2946 2.45807H28.4933C28.9595 2.45807 29.3374 2.836 29.3374 3.30221C29.3374 3.76842 28.9595 4.14635 28.4933 4.14635H15.2946C14.8284 4.14635 14.4504 3.76842 14.4504 3.30221Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4504 9.00002C14.4504 8.53382 14.8284 8.15588 15.2946 8.15588H28.4933C28.9595 8.15588 29.3374 8.53382 29.3374 9.00002C29.3374 9.46623 28.9595 9.84417 28.4933 9.84417H15.2946C14.8284 9.84417 14.4504 9.46623 14.4504 9.00002Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4504 14.6978C14.4504 14.2316 14.8284 13.8537 15.2946 13.8537H28.4933C28.9595 13.8537 29.3374 14.2316 29.3374 14.6978C29.3374 15.164 28.9595 15.542 28.4933 15.542H15.2946C14.8284 15.542 14.4504 15.164 14.4504 14.6978Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M1.94549 6.87377C2.27514 6.54411 2.80962 6.54411 3.13928 6.87377L6.23458 9.96907L9.32988 6.87377C9.65954 6.54411 10.194 6.54411 10.5237 6.87377C10.8533 7.20343 10.8533 7.73791 10.5237 8.06756L6.23458 12.3567L1.94549 8.06756C1.61583 7.73791 1.61583 7.20343 1.94549 6.87377Z" fill="currentColor"></path></svg>
|
82 |
+
|
83 |
+
</button>
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
</div></li>
|
88 |
+
<li><hr class="h-5 w-0.5 border-none bg-gray-100 dark:bg-gray-800"></li>
|
89 |
+
<li><a class="block cursor-pointer px-2 py-0.5 hover:text-gray-500 dark:hover:text-gray-400" href="/login">Log In
|
90 |
+
</a></li>
|
91 |
+
<li><a class="rounded-full border border-transparent bg-gray-900 px-3 py-1 leading-none text-white hover:border-black hover:bg-white hover:text-black" href="/join">Sign Up
|
92 |
+
</a></li></ul></nav></div></header></div>
|
93 |
+
|
94 |
+
<div class="SVELTE_HYDRATER contents" data-props="{}" data-target="GoogleAnalyticsTracker"></div>
|
95 |
+
|
96 |
+
|
97 |
+
<div class="SVELTE_HYDRATER contents" data-props="{}" data-target="SSOBanner"></div>
|
98 |
+
|
99 |
+
<main class="flex flex-1 flex-col"><div class="SVELTE_HYDRATER contents" data-props="{"activeTab":"files","author":{"avatarUrl":"https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1642793296366-61e1188afc27c0f5e3641eb3.jpeg?w=200&h=200&f=face","fullname":"CVPR Demo Track","name":"CVPR","type":"org","isHf":false},"canReadRepoSettings":false,"canDisable":false,"discussionsStats":{"closed":5,"open":6,"total":11},"query":{},"space":{"author":"CVPR","colorFrom":"indigo","colorTo":"indigo","cardData":{"title":"Image Animation Using Thin Plate Spline Motion Model","emoji":"👁","colorFrom":"indigo","colorTo":"indigo","sdk":"gradio","sdk_version":"3.48.0","app_file":"app.py","pinned":false},"emoji":"👁","discussionsDisabled":false,"duplicationDisabled":false,"id":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","isLikedByUser":false,"isWatchedByUser":false,"lastModified":"2023-10-25T19:06:23.000Z","likes":510,"pinned":false,"private":false,"gated":false,"repoType":"space","subdomain":"cvpr-image-animation-using-thin-plate-spline-mot-e234846","sdk":"gradio","sdkVersion":"3.48.0","title":"Image Animation Using Thin Plate Spline Motion Model","runtime":{"stage":"RUNNING","hardware":{"current":"cpu-basic","requested":"cpu-basic"},"storage":null,"gcTimeout":null,"replicas":{"current":1,"requested":1}},"iframe":{"host":"https://cvpr-image-animation-using-thin-plate-spline-mot-e234846.hf.space","src":"https://cvpr-image-animation-using-thin-plate-spline-mot-e234846.hf.space"},"secrets":[],"variables":[],"sse":{"url":"https://api.hf.space/v1/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","jwt":"eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJpYXQiOjE2OTk2NzcwMTEsInN1YiI6Ii9zcGFjZXMvQ1ZQUi9JbWFnZS1BbmltYXRpb24tdXNpbmctVGhpbi1QbGF0ZS1TcGxpbmUtTW90aW9uLU1vZGVsIiwiZXhwIjoxNjk5NzYzNDExLCJpc3MiOiJodHRwczovL2h1Z2dpbmdmYWNlLmNvIn0.egzsax-P6bbyoYujWJw6_plXbMOgaixiFEhPLMBdyPu71s-tryfJHWQJriOoL6fgWQSHYOjcYxVrDGrRn-tcAg"},"linkedModels":[],"linkedDatasets":[],"linkedCollections":[]}}" data-target="SpaceHeader"><header class="from-gray-50-to-white border-b border-gray-100 bg-gradient-to-t via-white dark:via-gray-950 pt-4 xl:pt-0"><div class="container relative flex flex-col xl:flex-row"><h1 class="flex flex-wrap items-center leading-tight gap-y-1 text-lg xl:flex-none"><a href="/spaces" class="group flex items-center"><svg class="mr-1 text-gray-400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M7.80914 18.7462V24.1907H13.2536V18.7462H7.80914Z" fill="#FF3270"></path><path d="M18.7458 18.7462V24.1907H24.1903V18.7462H18.7458Z" fill="#861FFF"></path><path d="M7.80914 7.80982V13.2543H13.2536V7.80982H7.80914Z" fill="#097EFF"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.41775C4 5.08246 5.08246 4 6.41775 4H14.6457C15.7626 4 16.7026 4.75724 16.9802 5.78629C18.1505 4.67902 19.7302 4 21.4685 4C25.0758 4 28.0003 6.92436 28.0003 10.5317C28.0003 12.27 27.3212 13.8497 26.2139 15.02C27.243 15.2977 28.0003 16.2376 28.0003 17.3545V25.5824C28.0003 26.9177 26.9177 28.0003 25.5824 28.0003H17.0635H14.9367H6.41775C5.08246 28.0003 4 26.9177 4 25.5824V15.1587V14.9367V6.41775ZM7.80952 7.80952V13.254H13.254V7.80952H7.80952ZM7.80952 24.1907V18.7462H13.254V24.1907H7.80952ZM18.7462 24.1907V18.7462H24.1907V24.1907H18.7462ZM18.7462 10.5317C18.7462 9.0283 19.9651 7.80952 21.4685 7.80952C22.9719 7.80952 24.1907 9.0283 24.1907 10.5317C24.1907 12.0352 22.9719 13.254 21.4685 13.254C19.9651 13.254 18.7462 12.0352 18.7462 10.5317Z" fill="black"></path><path d="M21.4681 7.80982C19.9647 7.80982 18.7458 9.02861 18.7458 10.5321C18.7458 12.0355 19.9647 13.2543 21.4681 13.2543C22.9715 13.2543 24.1903 12.0355 24.1903 10.5321C24.1903 9.02861 22.9715 7.80982 21.4681 7.80982Z" fill="#FFD702"></path></svg>
|
100 |
+
<span class="mr-2.5 font-semibold text-gray-400 group-hover:text-gray-500">Spaces:</span></a>
|
101 |
+
<div class="group flex flex-none items-center"><div class="relative mr-1.5 flex items-center">
|
102 |
+
|
103 |
+
<img alt="" class="w-3.5 h-3.5 rounded " src="https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1642793296366-61e1188afc27c0f5e3641eb3.jpeg?w=200&h=200&f=face" crossorigin="anonymous"></div>
|
104 |
+
<a href="/CVPR" class="text-gray-400 hover:text-blue-600">CVPR</a>
|
105 |
+
<div class="mx-0.5 text-gray-300">/</div></div>
|
106 |
+
|
107 |
+
<div class="max-w-full xl:flex xl:min-w-0 xl:flex-nowrap xl:items-center xl:gap-x-1"><a class="break-words font-mono font-semibold hover:text-blue-600 text-[1.07rem] xl:truncate" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model">Image-Animation-using-Thin-Plate-Spline-Motion-Model</a>
|
108 |
+
<button class="relative text-xs mr-3 inline-flex cursor-pointer items-center text-sm focus:outline-none mx-0.5 text-gray-600 " title="Copy space name to clipboard" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg>
|
109 |
+
|
110 |
+
</button></div>
|
111 |
+
<div class="inline-flex items-center overflow-hidden whitespace-nowrap rounded-md border bg-white text-sm leading-none text-gray-500 mr-2"><button class="relative flex items-center px-1.5 py-1 hover:bg-gradient-to-t focus:outline-none overflow-hidden from-red-50 to-transparent dark:from-red-900 dark:to-red-800" title="Like"><svg class="left-1.5 absolute" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" fill="currentColor"><path d="M22.45,6a5.47,5.47,0,0,1,3.91,1.64,5.7,5.7,0,0,1,0,8L16,26.13,5.64,15.64a5.7,5.7,0,0,1,0-8,5.48,5.48,0,0,1,7.82,0L16,10.24l2.53-2.58A5.44,5.44,0,0,1,22.45,6m0-2a7.47,7.47,0,0,0-5.34,2.24L16,7.36,14.89,6.24a7.49,7.49,0,0,0-10.68,0,7.72,7.72,0,0,0,0,10.82L16,29,27.79,17.06a7.72,7.72,0,0,0,0-10.82A7.49,7.49,0,0,0,22.45,4Z"></path></svg>
|
112 |
+
|
113 |
+
|
114 |
+
<span class="ml-4 pl-0.5">like</span></button>
|
115 |
+
<button class="flex items-center border-l px-1.5 py-1 text-gray-400 hover:bg-gray-50 focus:bg-gray-100 focus:outline-none dark:hover:bg-gray-900 dark:focus:bg-gray-800" title="See users who liked this repository">510</button></div>
|
116 |
+
|
117 |
+
|
118 |
+
|
119 |
+
|
120 |
+
|
121 |
+
|
122 |
+
|
123 |
+
|
124 |
+
|
125 |
+
<div class="inline-flex select-none items-center overflow-hidden font-mono text-xs flex-shrink-0 mr-2 rounded-lg border px-2 py-[0.32rem] leading-none dark:bg-gray-900
|
126 |
+
bg-green-50
|
127 |
+
border-green-100
|
128 |
+
text-green-700 dark:text-green-500">
|
129 |
+
<div class="ml-0.5 mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"></div>
|
130 |
+
Running
|
131 |
+
</div>
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
+
|
136 |
+
<div class="sm:hidden"><div class="relative ">
|
137 |
+
<button class="btn px-1 py-1 text-sm translate-y-0 " type="button">
|
138 |
+
|
139 |
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="p-px" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><circle cx="16" cy="7" r="3" fill="currentColor"></circle><circle cx="16" cy="16" r="3" fill="currentColor"></circle><circle cx="16" cy="25" r="3" fill="currentColor"></circle></svg>
|
140 |
+
|
141 |
+
|
142 |
+
</button>
|
143 |
+
|
144 |
+
|
145 |
+
|
146 |
+
</div></div></h1>
|
147 |
+
|
148 |
+
|
149 |
+
<div class="flex flex-col-reverse gap-x-2 sm:flex-row sm:items-center sm:justify-between xl:ml-auto"><div class="-mb-px flex h-12 items-center overflow-x-auto overflow-y-hidden sm:h-[3.25rem]"><a class="tab-alternate " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model"><svg class="mr-1.5 text-gray-400 flex-none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-quaternary" d="M20.23 7.24L12 12L3.77 7.24a1.98 1.98 0 0 1 .7-.71L11 2.76c.62-.35 1.38-.35 2 0l6.53 3.77c.29.173.531.418.7.71z" opacity=".25" fill="currentColor"></path><path class="uim-tertiary" d="M12 12v9.5a2.09 2.09 0 0 1-.91-.21L4.5 17.48a2.003 2.003 0 0 1-1-1.73v-7.5a2.06 2.06 0 0 1 .27-1.01L12 12z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M20.5 8.25v7.5a2.003 2.003 0 0 1-1 1.73l-6.62 3.82c-.275.13-.576.198-.88.2V12l8.23-4.76c.175.308.268.656.27 1.01z" fill="currentColor"></path></svg>
|
150 |
+
App
|
151 |
+
|
152 |
+
|
153 |
+
</a><a class="tab-alternate active" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/tree/main"><svg class="mr-1.5 text-gray-400 flex-none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-tertiary" d="M21 19h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2zm0-4h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2zm0-8h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2zm0 4h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M9 19a1 1 0 0 1-1-1V6a1 1 0 0 1 2 0v12a1 1 0 0 1-1 1zm-6-4.333a1 1 0 0 1-.64-1.769L3.438 12l-1.078-.898a1 1 0 0 1 1.28-1.538l2 1.667a1 1 0 0 1 0 1.538l-2 1.667a.999.999 0 0 1-.64.231z" fill="currentColor"></path></svg>
|
154 |
+
<span class="xl:hidden">Files</span>
|
155 |
+
<span class="hidden xl:inline">Files</span>
|
156 |
+
|
157 |
+
|
158 |
+
</a><a class="tab-alternate " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/discussions"><svg class="mr-1.5 text-gray-400 flex-none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M20.6081 3C21.7684 3 22.8053 3.49196 23.5284 4.38415C23.9756 4.93678 24.4428 5.82749 24.4808 7.16133C24.9674 7.01707 25.4353 6.93643 25.8725 6.93643C26.9833 6.93643 27.9865 7.37587 28.696 8.17411C29.6075 9.19872 30.0124 10.4579 29.8361 11.7177C29.7523 12.3177 29.5581 12.8555 29.2678 13.3534C29.8798 13.8646 30.3306 14.5763 30.5485 15.4322C30.719 16.1032 30.8939 17.5006 29.9808 18.9403C30.0389 19.0342 30.0934 19.1319 30.1442 19.2318C30.6932 20.3074 30.7283 21.5229 30.2439 22.6548C29.5093 24.3704 27.6841 25.7219 24.1397 27.1727C21.9347 28.0753 19.9174 28.6523 19.8994 28.6575C16.9842 29.4379 14.3477 29.8345 12.0653 29.8345C7.87017 29.8345 4.8668 28.508 3.13831 25.8921C0.356375 21.6797 0.754104 17.8269 4.35369 14.1131C6.34591 12.058 7.67023 9.02782 7.94613 8.36275C8.50224 6.39343 9.97271 4.20438 12.4172 4.20438H12.4179C12.6236 4.20438 12.8314 4.2214 13.0364 4.25468C14.107 4.42854 15.0428 5.06476 15.7115 6.02205C16.4331 5.09583 17.134 4.359 17.7682 3.94323C18.7242 3.31737 19.6794 3 20.6081 3ZM20.6081 5.95917C20.2427 5.95917 19.7963 6.1197 19.3039 6.44225C17.7754 7.44319 14.8258 12.6772 13.7458 14.7131C13.3839 15.3952 12.7655 15.6837 12.2086 15.6837C11.1036 15.6837 10.2408 14.5497 12.1076 13.1085C14.9146 10.9402 13.9299 7.39584 12.5898 7.1776C12.5311 7.16799 12.4731 7.16355 12.4172 7.16355C11.1989 7.16355 10.6615 9.33114 10.6615 9.33114C10.6615 9.33114 9.0863 13.4148 6.38031 16.206C3.67434 18.998 3.5346 21.2388 5.50675 24.2246C6.85185 26.2606 9.42666 26.8753 12.0653 26.8753C14.8021 26.8753 17.6077 26.2139 19.1799 25.793C19.2574 25.7723 28.8193 22.984 27.6081 20.6107C27.4046 20.212 27.0693 20.0522 26.6471 20.0522C24.9416 20.0522 21.8393 22.6726 20.5057 22.6726C20.2076 22.6726 19.9976 22.5416 19.9116 22.222C19.3433 20.1173 28.552 19.2325 27.7758 16.1839C27.639 15.6445 27.2677 15.4256 26.746 15.4263C24.4923 15.4263 19.4358 19.5181 18.3759 19.5181C18.2949 19.5181 18.2368 19.4937 18.2053 19.4419C17.6743 18.557 17.9653 17.9394 21.7082 15.6009C25.4511 13.2617 28.0783 11.8545 26.5841 10.1752C26.4121 9.98141 26.1684 9.8956 25.8725 9.8956C23.6001 9.89634 18.2311 14.9403 18.2311 14.9403C18.2311 14.9403 16.7821 16.496 15.9057 16.496C15.7043 16.496 15.533 16.4139 15.4169 16.2112C14.7956 15.1296 21.1879 10.1286 21.5484 8.06535C21.7928 6.66715 21.3771 5.95917 20.6081 5.95917Z" fill="#FF9D00"></path><path d="M5.50686 24.2246C3.53472 21.2387 3.67446 18.9979 6.38043 16.206C9.08641 13.4147 10.6615 9.33111 10.6615 9.33111C10.6615 9.33111 11.2499 6.95933 12.59 7.17757C13.93 7.39581 14.9139 10.9401 12.1069 13.1084C9.29997 15.276 12.6659 16.7489 13.7459 14.713C14.8258 12.6772 17.7747 7.44316 19.304 6.44221C20.8326 5.44128 21.9089 6.00204 21.5484 8.06532C21.188 10.1286 14.795 15.1295 15.4171 16.2118C16.0391 17.2934 18.2312 14.9402 18.2312 14.9402C18.2312 14.9402 25.0907 8.49588 26.5842 10.1752C28.0776 11.8545 25.4512 13.2616 21.7082 15.6008C17.9646 17.9393 17.6744 18.557 18.2054 19.4418C18.7372 20.3266 26.9998 13.1351 27.7759 16.1838C28.5513 19.2324 19.3434 20.1173 19.9117 22.2219C20.48 24.3274 26.3979 18.2382 27.6082 20.6107C28.8193 22.9839 19.2574 25.7722 19.18 25.7929C16.0914 26.62 8.24723 28.3726 5.50686 24.2246Z" fill="#FFD21E"></path></svg>
|
159 |
+
Community
|
160 |
+
<div class="ml-1.5 flex h-4 min-w-[1rem] items-center justify-center rounded px-1 text-xs leading-none shadow-sm bg-black text-white dark:bg-gray-800 dark:text-gray-200">11
|
161 |
+
</div>
|
162 |
+
|
163 |
+
</a>
|
164 |
+
</div>
|
165 |
+
|
166 |
+
|
167 |
+
|
168 |
+
<div class="hidden sm:block mt-2 lg:mt-0"><div class="relative ">
|
169 |
+
<button class="btn px-1 py-1 text-base translate-y-px " type="button">
|
170 |
+
|
171 |
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="p-0.5" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><circle cx="16" cy="7" r="3" fill="currentColor"></circle><circle cx="16" cy="16" r="3" fill="currentColor"></circle><circle cx="16" cy="25" r="3" fill="currentColor"></circle></svg>
|
172 |
+
|
173 |
+
|
174 |
+
</button>
|
175 |
+
|
176 |
+
|
177 |
+
|
178 |
+
</div></div>
|
179 |
+
</div></div></header>
|
180 |
+
|
181 |
+
|
182 |
+
|
183 |
+
|
184 |
+
|
185 |
+
|
186 |
+
|
187 |
+
|
188 |
+
|
189 |
+
|
190 |
+
|
191 |
+
|
192 |
+
|
193 |
+
|
194 |
+
|
195 |
+
</div>
|
196 |
+
|
197 |
+
<div class="container relative flex flex-col md:grid md:space-y-0 w-full md:grid-cols-12 space-y-4 md:gap-6 mb-16"><section class="pt-8 border-gray-100 col-span-full"><header class="flex flex-wrap items-center justify-start pb-2 md:justify-end lg:flex-nowrap"><div class="mr-4 flex min-w-0 basis-auto flex-wrap items-center md:flex-grow md:basis-full lg:basis-auto lg:flex-nowrap"><div class="SVELTE_HYDRATER contents" data-props="{"path":"app.py","repoName":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","repoType":"space","rev":"main","refs":{"branches":[{"name":"main","ref":"refs/heads/main","targetCommit":"626d7ffc7b07ba96290bd80cb09b73993f85bf40"}],"tags":[],"converts":[]},"view":"blob"}" data-target="BranchSelector"><div class="relative mr-4 mb-2">
|
198 |
+
<button class="text-sm md:text-base btn w-full cursor-pointer text-sm" type="button">
|
199 |
+
<svg class="mr-1.5 text-gray-700 dark:text-gray-400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" style="transform: rotate(360deg);"><path d="M13 14c-3.36 0-4.46 1.35-4.82 2.24C9.25 16.7 10 17.76 10 19a3 3 0 0 1-3 3a3 3 0 0 1-3-3c0-1.31.83-2.42 2-2.83V7.83A2.99 2.99 0 0 1 4 5a3 3 0 0 1 3-3a3 3 0 0 1 3 3c0 1.31-.83 2.42-2 2.83v5.29c.88-.65 2.16-1.12 4-1.12c2.67 0 3.56-1.34 3.85-2.23A3.006 3.006 0 0 1 14 7a3 3 0 0 1 3-3a3 3 0 0 1 3 3c0 1.34-.88 2.5-2.09 2.86C17.65 11.29 16.68 14 13 14m-6 4a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1M7 4a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1m10 2a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1z" fill="currentColor"></path></svg>
|
200 |
+
main
|
201 |
+
<svg class="-mr-1 text-gray-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" style="transform: rotate(360deg);"><path d="M7 10l5 5l5-5z" fill="currentColor"></path></svg></button>
|
202 |
+
|
203 |
+
|
204 |
+
|
205 |
+
</div></div>
|
206 |
+
<div class="mb-2 flex items-center overflow-hidden"><a class="truncate text-gray-800 hover:underline" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/tree/main">Image-Animation-using-Thin-Plate-Spline-Motion-Model</a>
|
207 |
+
<span class="mx-1 text-gray-300">/</span>
|
208 |
+
<span class="dark:text-gray-300">app.py</span></div></div>
|
209 |
+
|
210 |
+
|
211 |
+
</header>
|
212 |
+
<div class="SVELTE_HYDRATER contents" data-props="{"commitLast":{"date":"2023-10-25T19:06:23.000Z","subject":"Fix dependency issues and add some updates (#10)","authors":[{"_id":"605b1a536ce6cabbb3474b5a","avatar":"https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1655583590216-605b1a536ce6cabbb3474b5a.jpeg?w=200&h=200&f=face","isHf":false,"user":"animesh007"}],"commit":{"id":"626d7ffc7b07ba96290bd80cb09b73993f85bf40","parentIds":["6614b1ace6e25e6d94942514c1e9b6e9d3942f46"]},"title":"Fix dependency issues and add some updates (<a href=\"/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/discussions/10\">#10</a>)"},"repo":{"name":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","type":"space"}}" data-target="LastCommit"><div class="from-gray-100-to-white flex items-baseline rounded-t-lg border border-b-0 bg-gradient-to-t px-3 py-2 dark:border-gray-800"><img class="mr-2.5 mt-0.5 h-4 w-4 self-center rounded-full" alt="animesh007's picture" src="https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1655583590216-605b1a536ce6cabbb3474b5a.jpeg?w=200&h=200&f=face">
|
213 |
+
<div class="mr-5 flex flex-none items-center truncate"><a class="hover:underline" href="/animesh007">animesh007
|
214 |
+
</a>
|
215 |
+
|
216 |
+
</div>
|
217 |
+
<div class="mr-4 truncate font-mono text-sm text-gray-500 hover:prose-a:underline"><!-- HTML_TAG_START -->Fix dependency issues and add some updates (<a href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/discussions/10">#10</a>)<!-- HTML_TAG_END --></div>
|
218 |
+
<a class="rounded border bg-gray-50 px-1.5 text-sm hover:underline dark:border-gray-800 dark:bg-gray-900" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/commit/626d7ffc7b07ba96290bd80cb09b73993f85bf40">626d7ff</a>
|
219 |
+
|
220 |
+
<time class="ml-auto hidden flex-none truncate pl-2 text-gray-500 dark:text-gray-400 lg:block" datetime="2023-10-25T19:06:23" title="Wed, 25 Oct 2023 19:06:23 GMT">16 days ago</time></div></div>
|
221 |
+
<div class="flex flex-wrap items-center border px-3 py-1.5 text-sm text-gray-800 dark:border-gray-800 dark:bg-gray-900">
|
222 |
+
<a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/raw/main/app.py"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" style="transform: rotate(360deg);"><path d="M31 16l-7 7l-1.41-1.41L28.17 16l-5.58-5.59L24 9l7 7z" fill="currentColor"></path><path d="M1 16l7-7l1.41 1.41L3.83 16l5.58 5.59L8 23l-7-7z" fill="currentColor"></path><path d="M12.419 25.484L17.639 6l1.932.518L14.35 26z" fill="currentColor"></path></svg>
|
223 |
+
raw
|
224 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/commits/main/app.py"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" style="transform: rotate(360deg);"><path d="M16 4C9.383 4 4 9.383 4 16s5.383 12 12 12s12-5.383 12-12S22.617 4 16 4zm0 2c5.535 0 10 4.465 10 10s-4.465 10-10 10S6 21.535 6 16S10.465 6 16 6zm-1 2v9h7v-2h-5V8z" fill="currentColor"></path></svg>
|
225 |
+
history
|
226 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/blame/main/app.py"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" style="transform: rotate(360deg);"><path d="M16 2a14 14 0 1 0 14 14A14 14 0 0 0 16 2zm0 26a12 12 0 1 1 12-12a12 12 0 0 1-12 12z" fill="currentColor"></path><path d="M11.5 11a2.5 2.5 0 1 0 2.5 2.5a2.48 2.48 0 0 0-2.5-2.5z" fill="currentColor"></path><path d="M20.5 11a2.5 2.5 0 1 0 2.5 2.5a2.48 2.48 0 0 0-2.5-2.5z" fill="currentColor"></path></svg>
|
227 |
+
blame
|
228 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline text-green-600 dark:text-gray-300" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/edit/main/app.py"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M2 26h28v2H2z" fill="currentColor"></path><path d="M25.4 9c.8-.8.8-2 0-2.8l-3.6-3.6c-.8-.8-2-.8-2.8 0l-15 15V24h6.4l15-15zm-5-5L24 7.6l-3 3L17.4 7l3-3zM6 22v-3.6l10-10l3.6 3.6l-10 10H6z" fill="currentColor"></path></svg>
|
229 |
+
contribute
|
230 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/delete/main/app.py"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M12 12h2v12h-2z" fill="currentColor"></path><path d="M18 12h2v12h-2z" fill="currentColor"></path><path d="M4 6v2h2v20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h2V6zm4 22V8h16v20z" fill="currentColor"></path><path d="M12 2h8v2h-8z" fill="currentColor"></path></svg>
|
231 |
+
delete
|
232 |
+
</a>
|
233 |
+
<div class="mr-4 flex items-center text-gray-400"><svg class="text-gray-300 text-sm mr-1.5 -translate-y-px" width="1em" height="1em" viewBox="0 0 22 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M15.3634 10.3639C15.8486 10.8491 15.8486 11.6357 15.3634 12.1209L10.9292 16.5551C10.6058 16.8785 10.0814 16.8785 9.7579 16.5551L7.03051 13.8277C6.54532 13.3425 6.54532 12.5558 7.03051 12.0707C7.51569 11.5855 8.30234 11.5855 8.78752 12.0707L9.7579 13.041C10.0814 13.3645 10.6058 13.3645 10.9292 13.041L13.6064 10.3639C14.0916 9.8787 14.8782 9.8787 15.3634 10.3639Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M10.6666 27.12C4.93329 25.28 0 19.2267 0 12.7867V6.52001C0 5.40001 0.693334 4.41334 1.73333 4.01334L9.73333 1.01334C10.3333 0.786673 11 0.786673 11.6 1.02667L19.6 4.02667C20.1083 4.21658 20.5465 4.55701 20.8562 5.00252C21.1659 5.44803 21.3324 5.97742 21.3333 6.52001V12.7867C21.3333 19.24 16.4 25.28 10.6666 27.12Z" fill="currentColor" fill-opacity="0.22"></path><path d="M10.0845 1.94967L10.0867 1.94881C10.4587 1.8083 10.8666 1.81036 11.2286 1.95515L11.2387 1.95919L11.2489 1.963L19.2489 4.963L19.25 4.96342C19.5677 5.08211 19.8416 5.29488 20.0351 5.57333C20.2285 5.85151 20.3326 6.18203 20.3333 6.52082C20.3333 6.52113 20.3333 6.52144 20.3333 6.52176L20.3333 12.7867C20.3333 18.6535 15.8922 24.2319 10.6666 26.0652C5.44153 24.2316 1 18.6409 1 12.7867V6.52001C1 5.82357 1.42893 5.20343 2.08883 4.94803L10.0845 1.94967Z" stroke="currentColor" stroke-opacity="0.30" stroke-width="2"></path></svg>
|
234 |
+
|
235 |
+
No virus
|
236 |
+
</div>
|
237 |
+
|
238 |
+
<div class="dark:text-gray-300 sm:ml-auto">4.54 kB</div></div>
|
239 |
+
|
240 |
+
<div class="relative min-h-[100px] rounded-b-lg border border-t-0 leading-tight dark:border-gray-800 dark:bg-gray-925">
|
241 |
+
<div class="py-3"><div class="SVELTE_HYDRATER contents" data-props="{"lines":["<span class=\"hljs-keyword\">import</span> os","<span class=\"hljs-keyword\">import</span> pathlib","","<span class=\"hljs-keyword\">import</span> gradio <span class=\"hljs-keyword\">as</span> gr","<span class=\"hljs-keyword\">import</span> torch","<span class=\"hljs-keyword\">from</span> PIL <span class=\"hljs-keyword\">import</span> Image","","repo_dir = pathlib.Path(<span class=\"hljs-string\">&quot;Thin-Plate-Spline-Motion-Model&quot;</span>).absolute()","<span class=\"hljs-keyword\">if</span> <span class=\"hljs-keyword\">not</span> repo_dir.exists():"," os.system(<span class=\"hljs-string\">&quot;git clone https://github.com/yoyo-nb/Thin-Plate-Spline-Motion-Model&quot;</span>)","os.chdir(repo_dir.name)","<span class=\"hljs-keyword\">if</span> <span class=\"hljs-keyword\">not</span> (repo_dir / <span class=\"hljs-string\">&quot;checkpoints&quot;</span>).exists():"," os.system(<span class=\"hljs-string\">&quot;mkdir checkpoints&quot;</span>)","<span class=\"hljs-keyword\">if</span> <span class=\"hljs-keyword\">not</span> (repo_dir / <span class=\"hljs-string\">&quot;checkpoints/vox.pth.tar&quot;</span>).exists():"," os.system(<span class=\"hljs-string\">&quot;gdown 1-CKOjv_y_TzNe-dwQsjjeVxJUuyBAb5X -O checkpoints/vox.pth.tar&quot;</span>)","","","","title = <span class=\"hljs-string\">&quot;# Thin-Plate Spline Motion Model for Image Animation&quot;</span>","DESCRIPTION = <span class=\"hljs-string\">&#x27;&#x27;&#x27;### Gradio demo for &lt;b&gt;Thin-Plate Spline Motion Model for Image Animation&lt;/b&gt;, CVPR 2022. &lt;a href=&#x27;https://arxiv.org/abs/2203.14367&#x27;&gt;[Paper]&lt;/a&gt;&lt;a href=&#x27;https://github.com/yoyo-nb/Thin-Plate-Spline-Motion-Model&#x27;&gt;[Github Code]&lt;/a&gt;</span>","<span class=\"hljs-string\"></span>","<span class=\"hljs-string\">&lt;img id=&quot;overview&quot; alt=&quot;overview&quot; src=&quot;https://github.com/yoyo-nb/Thin-Plate-Spline-Motion-Model/raw/main/assets/vox.gif&quot; /&gt;</span>","<span class=\"hljs-string\">&#x27;&#x27;&#x27;</span>","FOOTER = <span class=\"hljs-string\">&#x27;&lt;img id=&quot;visitor-badge&quot; alt=&quot;visitor badge&quot; src=&quot;https://visitor-badge.glitch.me/badge?page_id=gradio-blocks.Image-Animation-using-Thin-Plate-Spline-Motion-Model&quot; /&gt;&#x27;</span>","","","<span class=\"hljs-keyword\">def</span> <span class=\"hljs-title function_\">get_style_image_path</span>(<span class=\"hljs-params\">style_name: <span class=\"hljs-built_in\">str</span></span>) -&gt; <span class=\"hljs-built_in\">str</span>:"," base_path = <span class=\"hljs-string\">&#x27;assets&#x27;</span>"," filenames = {"," <span class=\"hljs-string\">&#x27;source&#x27;</span>: <span class=\"hljs-string\">&#x27;source.png&#x27;</span>,"," <span class=\"hljs-string\">&#x27;driving&#x27;</span>: <span class=\"hljs-string\">&#x27;driving.mp4&#x27;</span>,"," }"," <span class=\"hljs-keyword\">return</span> <span class=\"hljs-string\">f&#x27;<span class=\"hljs-subst\">{base_path}</span>/<span class=\"hljs-subst\">{filenames[style_name]}</span>&#x27;</span>","","","<span class=\"hljs-keyword\">def</span> <span class=\"hljs-title function_\">get_style_image_markdown_text</span>(<span class=\"hljs-params\">style_name: <span class=\"hljs-built_in\">str</span></span>) -&gt; <span class=\"hljs-built_in\">str</span>:"," url = get_style_image_path(style_name)"," <span class=\"hljs-keyword\">return</span> <span class=\"hljs-string\">f&#x27;&lt;img id=&quot;style-image&quot; src=&quot;<span class=\"hljs-subst\">{url}</span>&quot; alt=&quot;style image&quot;&gt;&#x27;</span>","","","<span class=\"hljs-keyword\">def</span> <span class=\"hljs-title function_\">update_style_image</span>(<span class=\"hljs-params\">style_name: <span class=\"hljs-built_in\">str</span></span>) -&gt; <span class=\"hljs-built_in\">dict</span>:"," text = get_style_image_markdown_text(style_name)"," <span class=\"hljs-keyword\">return</span> gr.Markdown.update(value=text)","","","<span class=\"hljs-keyword\">def</span> <span class=\"hljs-title function_\">inference</span>(<span class=\"hljs-params\">img, vid</span>):"," <span class=\"hljs-keyword\">if</span> <span class=\"hljs-keyword\">not</span> os.path.exists(<span class=\"hljs-string\">&#x27;temp&#x27;</span>):"," os.system(<span class=\"hljs-string\">&#x27;mkdir temp&#x27;</span>)",""," img.save(<span class=\"hljs-string\">&quot;temp/image.jpg&quot;</span>, <span class=\"hljs-string\">&quot;JPEG&quot;</span>)"," <span class=\"hljs-keyword\">if</span> torch.cuda.is_available():"," os.system(<span class=\"hljs-string\">f&quot;python demo.py --config config/vox-256.yaml --checkpoint ./checkpoints/vox.pth.tar --source_image &#x27;temp/image.jpg&#x27; --driving_video <span class=\"hljs-subst\">{vid}</span> --result_video &#x27;./temp/result.mp4&#x27;&quot;</span>)"," <span class=\"hljs-keyword\">else</span>:"," os.system(<span class=\"hljs-string\">f&quot;python demo.py --config config/vox-256.yaml --checkpoint ./checkpoints/vox.pth.tar --source_image &#x27;temp/image.jpg&#x27; --driving_video <span class=\"hljs-subst\">{vid}</span> --result_video &#x27;./temp/result.mp4&#x27; --cpu&quot;</span>)"," <span class=\"hljs-keyword\">return</span> <span class=\"hljs-string\">&#x27;./temp/result.mp4&#x27;</span>","","","","<span class=\"hljs-keyword\">def</span> <span class=\"hljs-title function_\">main</span>():"," <span class=\"hljs-keyword\">with</span> gr.Blocks(css=<span class=\"hljs-string\">&#x27;style.css&#x27;</span>) <span class=\"hljs-keyword\">as</span> demo:"," gr.Markdown(title)"," gr.Markdown(DESCRIPTION)",""," <span class=\"hljs-keyword\">with</span> gr.Box():"," gr.Markdown(<span class=\"hljs-string\">&#x27;&#x27;&#x27;## Step 1 (Provide Input Face Image)</span>","<span class=\"hljs-string\">- Drop an image containing a face to the **Input Image**.</span>","<span class=\"hljs-string\"> - If there are multiple faces in the image, use Edit button in the upper right corner and crop the input image beforehand.</span>","<span class=\"hljs-string\">&#x27;&#x27;&#x27;</span>)"," <span class=\"hljs-keyword\">with</span> gr.Row():"," <span class=\"hljs-keyword\">with</span> gr.Column():"," <span class=\"hljs-keyword\">with</span> gr.Row():"," input_image = gr.Image(label=<span class=\"hljs-string\">&#x27;Input Image&#x27;</span>,"," <span class=\"hljs-built_in\">type</span>=<span class=\"hljs-string\">&quot;pil&quot;</span>)",""," <span class=\"hljs-keyword\">with</span> gr.Row():"," paths = <span class=\"hljs-built_in\">sorted</span>(pathlib.Path(<span class=\"hljs-string\">&#x27;assets&#x27;</span>).glob(<span class=\"hljs-string\">&#x27;*.png&#x27;</span>))"," gr.Examples(inputs=[input_image],"," examples=[[path.as_posix()] <span class=\"hljs-keyword\">for</span> path <span class=\"hljs-keyword\">in</span> paths])",""," <span class=\"hljs-keyword\">with</span> gr.Box():"," gr.Markdown(<span class=\"hljs-string\">&#x27;&#x27;&#x27;## Step 2 (Select Driving Video)</span>","<span class=\"hljs-string\">- Select **Style Driving Video for the face image animation**.</span>","<span class=\"hljs-string\">&#x27;&#x27;&#x27;</span>)"," <span class=\"hljs-keyword\">with</span> gr.Row():"," <span class=\"hljs-keyword\">with</span> gr.Column():"," <span class=\"hljs-keyword\">with</span> gr.Row():"," driving_video = gr.Video(label=<span class=\"hljs-string\">&#x27;Driving Video&#x27;</span>,"," <span class=\"hljs-built_in\">format</span>=<span class=\"hljs-string\">&quot;mp4&quot;</span>)",""," <span class=\"hljs-keyword\">with</span> gr.Row():"," paths = <span class=\"hljs-built_in\">sorted</span>(pathlib.Path(<span class=\"hljs-string\">&#x27;assets&#x27;</span>).glob(<span class=\"hljs-string\">&#x27;*.mp4&#x27;</span>))"," gr.Examples(inputs=[driving_video],"," examples=[[path.as_posix()] <span class=\"hljs-keyword\">for</span> path <span class=\"hljs-keyword\">in</span> paths])",""," <span class=\"hljs-keyword\">with</span> gr.Box():"," gr.Markdown(<span class=\"hljs-string\">&#x27;&#x27;&#x27;## Step 3 (Generate Animated Image based on the Video)</span>","<span class=\"hljs-string\">- Hit the **Generate** button. (Note: On cpu-basic, it takes ~ 10 minutes to generate final results.)</span>","<span class=\"hljs-string\">&#x27;&#x27;&#x27;</span>)"," <span class=\"hljs-keyword\">with</span> gr.Row():"," <span class=\"hljs-keyword\">with</span> gr.Column():"," <span class=\"hljs-keyword\">with</span> gr.Row():"," generate_button = gr.Button(<span class=\"hljs-string\">&#x27;Generate&#x27;</span>)",""," <span class=\"hljs-keyword\">with</span> gr.Column():"," result = gr.Video(label=<span class=\"hljs-string\">&quot;Output&quot;</span>)"," gr.Markdown(FOOTER)"," generate_button.click(fn=inference,"," inputs=["," input_image,"," driving_video"," ],"," outputs=result)",""," demo.queue(max_size=<span class=\"hljs-number\">10</span>).launch()","","<span class=\"hljs-keyword\">if</span> __name__ == <span class=\"hljs-string\">&#x27;__main__&#x27;</span>:"," main()",""],"context":{"repo":{"name":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","type":"space"},"revision":"626d7ffc7b07ba96290bd80cb09b73993f85bf40","path":"app.py"}}" data-target="BlobContent">
|
242 |
+
|
243 |
+
<div class="relative text-sm"><div class="overflow-x-auto"><table class="min-w-full border-collapse font-mono"><tbody><tr class="" id="L1">
|
244 |
+
|
245 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="1"></td>
|
246 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> os<!-- HTML_TAG_END --></td>
|
247 |
+
</tr><tr class="" id="L2">
|
248 |
+
|
249 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="2"></td>
|
250 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> pathlib<!-- HTML_TAG_END --></td>
|
251 |
+
</tr><tr class="" id="L3">
|
252 |
+
|
253 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="3"></td>
|
254 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
255 |
+
<!-- HTML_TAG_END --></td>
|
256 |
+
</tr><tr class="" id="L4">
|
257 |
+
|
258 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="4"></td>
|
259 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> gradio <span class="hljs-keyword">as</span> gr<!-- HTML_TAG_END --></td>
|
260 |
+
</tr><tr class="" id="L5">
|
261 |
+
|
262 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="5"></td>
|
263 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> torch<!-- HTML_TAG_END --></td>
|
264 |
+
</tr><tr class="" id="L6">
|
265 |
+
|
266 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="6"></td>
|
267 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image<!-- HTML_TAG_END --></td>
|
268 |
+
</tr><tr class="" id="L7">
|
269 |
+
|
270 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="7"></td>
|
271 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
272 |
+
<!-- HTML_TAG_END --></td>
|
273 |
+
</tr><tr class="" id="L8">
|
274 |
+
|
275 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="8"></td>
|
276 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->repo_dir = pathlib.Path(<span class="hljs-string">"Thin-Plate-Spline-Motion-Model"</span>).absolute()<!-- HTML_TAG_END --></td>
|
277 |
+
</tr><tr class="" id="L9">
|
278 |
+
|
279 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="9"></td>
|
280 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> repo_dir.exists():<!-- HTML_TAG_END --></td>
|
281 |
+
</tr><tr class="" id="L10">
|
282 |
+
|
283 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="10"></td>
|
284 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> os.system(<span class="hljs-string">"git clone https://github.com/yoyo-nb/Thin-Plate-Spline-Motion-Model"</span>)<!-- HTML_TAG_END --></td>
|
285 |
+
</tr><tr class="" id="L11">
|
286 |
+
|
287 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="11"></td>
|
288 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->os.chdir(repo_dir.name)<!-- HTML_TAG_END --></td>
|
289 |
+
</tr><tr class="" id="L12">
|
290 |
+
|
291 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="12"></td>
|
292 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> (repo_dir / <span class="hljs-string">"checkpoints"</span>).exists():<!-- HTML_TAG_END --></td>
|
293 |
+
</tr><tr class="" id="L13">
|
294 |
+
|
295 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="13"></td>
|
296 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> os.system(<span class="hljs-string">"mkdir checkpoints"</span>)<!-- HTML_TAG_END --></td>
|
297 |
+
</tr><tr class="" id="L14">
|
298 |
+
|
299 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="14"></td>
|
300 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> (repo_dir / <span class="hljs-string">"checkpoints/vox.pth.tar"</span>).exists():<!-- HTML_TAG_END --></td>
|
301 |
+
</tr><tr class="" id="L15">
|
302 |
+
|
303 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="15"></td>
|
304 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> os.system(<span class="hljs-string">"gdown 1-CKOjv_y_TzNe-dwQsjjeVxJUuyBAb5X -O checkpoints/vox.pth.tar"</span>)<!-- HTML_TAG_END --></td>
|
305 |
+
</tr><tr class="" id="L16">
|
306 |
+
|
307 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="16"></td>
|
308 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
309 |
+
<!-- HTML_TAG_END --></td>
|
310 |
+
</tr><tr class="" id="L17">
|
311 |
+
|
312 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="17"></td>
|
313 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
314 |
+
<!-- HTML_TAG_END --></td>
|
315 |
+
</tr><tr class="" id="L18">
|
316 |
+
|
317 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="18"></td>
|
318 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
319 |
+
<!-- HTML_TAG_END --></td>
|
320 |
+
</tr><tr class="" id="L19">
|
321 |
+
|
322 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="19"></td>
|
323 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->title = <span class="hljs-string">"# Thin-Plate Spline Motion Model for Image Animation"</span><!-- HTML_TAG_END --></td>
|
324 |
+
</tr><tr class="" id="L20">
|
325 |
+
|
326 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="20"></td>
|
327 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->DESCRIPTION = <span class="hljs-string">'''### Gradio demo for <b>Thin-Plate Spline Motion Model for Image Animation</b>, CVPR 2022. <a href='https://arxiv.org/abs/2203.14367'>[Paper]</a><a href='https://github.com/yoyo-nb/Thin-Plate-Spline-Motion-Model'>[Github Code]</a></span><!-- HTML_TAG_END --></td>
|
328 |
+
</tr><tr class="" id="L21">
|
329 |
+
|
330 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="21"></td>
|
331 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-string"></span><!-- HTML_TAG_END --></td>
|
332 |
+
</tr><tr class="" id="L22">
|
333 |
+
|
334 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="22"></td>
|
335 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-string"><img id="overview" alt="overview" src="https://github.com/yoyo-nb/Thin-Plate-Spline-Motion-Model/raw/main/assets/vox.gif" /></span><!-- HTML_TAG_END --></td>
|
336 |
+
</tr><tr class="" id="L23">
|
337 |
+
|
338 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="23"></td>
|
339 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-string">'''</span><!-- HTML_TAG_END --></td>
|
340 |
+
</tr><tr class="" id="L24">
|
341 |
+
|
342 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="24"></td>
|
343 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->FOOTER = <span class="hljs-string">'<img id="visitor-badge" alt="visitor badge" src="https://visitor-badge.glitch.me/badge?page_id=gradio-blocks.Image-Animation-using-Thin-Plate-Spline-Motion-Model" />'</span><!-- HTML_TAG_END --></td>
|
344 |
+
</tr><tr class="" id="L25">
|
345 |
+
|
346 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="25"></td>
|
347 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
348 |
+
<!-- HTML_TAG_END --></td>
|
349 |
+
</tr><tr class="" id="L26">
|
350 |
+
|
351 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="26"></td>
|
352 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
353 |
+
<!-- HTML_TAG_END --></td>
|
354 |
+
</tr><tr class="" id="L27">
|
355 |
+
|
356 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="27"></td>
|
357 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-keyword">def</span> <span class="hljs-title function_">get_style_image_path</span>(<span class="hljs-params">style_name: <span class="hljs-built_in">str</span></span>) -> <span class="hljs-built_in">str</span>:<!-- HTML_TAG_END --></td>
|
358 |
+
</tr><tr class="" id="L28">
|
359 |
+
|
360 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="28"></td>
|
361 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> base_path = <span class="hljs-string">'assets'</span><!-- HTML_TAG_END --></td>
|
362 |
+
</tr><tr class="" id="L29">
|
363 |
+
|
364 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="29"></td>
|
365 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> filenames = {<!-- HTML_TAG_END --></td>
|
366 |
+
</tr><tr class="" id="L30">
|
367 |
+
|
368 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="30"></td>
|
369 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-string">'source'</span>: <span class="hljs-string">'source.png'</span>,<!-- HTML_TAG_END --></td>
|
370 |
+
</tr><tr class="" id="L31">
|
371 |
+
|
372 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="31"></td>
|
373 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-string">'driving'</span>: <span class="hljs-string">'driving.mp4'</span>,<!-- HTML_TAG_END --></td>
|
374 |
+
</tr><tr class="" id="L32">
|
375 |
+
|
376 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="32"></td>
|
377 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> }<!-- HTML_TAG_END --></td>
|
378 |
+
</tr><tr class="" id="L33">
|
379 |
+
|
380 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="33"></td>
|
381 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">return</span> <span class="hljs-string">f'<span class="hljs-subst">{base_path}</span>/<span class="hljs-subst">{filenames[style_name]}</span>'</span><!-- HTML_TAG_END --></td>
|
382 |
+
</tr><tr class="" id="L34">
|
383 |
+
|
384 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="34"></td>
|
385 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
386 |
+
<!-- HTML_TAG_END --></td>
|
387 |
+
</tr><tr class="" id="L35">
|
388 |
+
|
389 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="35"></td>
|
390 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
391 |
+
<!-- HTML_TAG_END --></td>
|
392 |
+
</tr><tr class="" id="L36">
|
393 |
+
|
394 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="36"></td>
|
395 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-keyword">def</span> <span class="hljs-title function_">get_style_image_markdown_text</span>(<span class="hljs-params">style_name: <span class="hljs-built_in">str</span></span>) -> <span class="hljs-built_in">str</span>:<!-- HTML_TAG_END --></td>
|
396 |
+
</tr><tr class="" id="L37">
|
397 |
+
|
398 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="37"></td>
|
399 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> url = get_style_image_path(style_name)<!-- HTML_TAG_END --></td>
|
400 |
+
</tr><tr class="" id="L38">
|
401 |
+
|
402 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="38"></td>
|
403 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">return</span> <span class="hljs-string">f'<img id="style-image" src="<span class="hljs-subst">{url}</span>" alt="style image">'</span><!-- HTML_TAG_END --></td>
|
404 |
+
</tr><tr class="" id="L39">
|
405 |
+
|
406 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="39"></td>
|
407 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
408 |
+
<!-- HTML_TAG_END --></td>
|
409 |
+
</tr><tr class="" id="L40">
|
410 |
+
|
411 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="40"></td>
|
412 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
413 |
+
<!-- HTML_TAG_END --></td>
|
414 |
+
</tr><tr class="" id="L41">
|
415 |
+
|
416 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="41"></td>
|
417 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-keyword">def</span> <span class="hljs-title function_">update_style_image</span>(<span class="hljs-params">style_name: <span class="hljs-built_in">str</span></span>) -> <span class="hljs-built_in">dict</span>:<!-- HTML_TAG_END --></td>
|
418 |
+
</tr><tr class="" id="L42">
|
419 |
+
|
420 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="42"></td>
|
421 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> text = get_style_image_markdown_text(style_name)<!-- HTML_TAG_END --></td>
|
422 |
+
</tr><tr class="" id="L43">
|
423 |
+
|
424 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="43"></td>
|
425 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">return</span> gr.Markdown.update(value=text)<!-- HTML_TAG_END --></td>
|
426 |
+
</tr><tr class="" id="L44">
|
427 |
+
|
428 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="44"></td>
|
429 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
430 |
+
<!-- HTML_TAG_END --></td>
|
431 |
+
</tr><tr class="" id="L45">
|
432 |
+
|
433 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="45"></td>
|
434 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
435 |
+
<!-- HTML_TAG_END --></td>
|
436 |
+
</tr><tr class="" id="L46">
|
437 |
+
|
438 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="46"></td>
|
439 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-keyword">def</span> <span class="hljs-title function_">inference</span>(<span class="hljs-params">img, vid</span>):<!-- HTML_TAG_END --></td>
|
440 |
+
</tr><tr class="" id="L47">
|
441 |
+
|
442 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="47"></td>
|
443 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> os.path.exists(<span class="hljs-string">'temp'</span>):<!-- HTML_TAG_END --></td>
|
444 |
+
</tr><tr class="" id="L48">
|
445 |
+
|
446 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="48"></td>
|
447 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> os.system(<span class="hljs-string">'mkdir temp'</span>)<!-- HTML_TAG_END --></td>
|
448 |
+
</tr><tr class="" id="L49">
|
449 |
+
|
450 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="49"></td>
|
451 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
452 |
+
<!-- HTML_TAG_END --></td>
|
453 |
+
</tr><tr class="" id="L50">
|
454 |
+
|
455 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="50"></td>
|
456 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> img.save(<span class="hljs-string">"temp/image.jpg"</span>, <span class="hljs-string">"JPEG"</span>)<!-- HTML_TAG_END --></td>
|
457 |
+
</tr><tr class="" id="L51">
|
458 |
+
|
459 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="51"></td>
|
460 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">if</span> torch.cuda.is_available():<!-- HTML_TAG_END --></td>
|
461 |
+
</tr><tr class="" id="L52">
|
462 |
+
|
463 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="52"></td>
|
464 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> os.system(<span class="hljs-string">f"python demo.py --config config/vox-256.yaml --checkpoint ./checkpoints/vox.pth.tar --source_image 'temp/image.jpg' --driving_video <span class="hljs-subst">{vid}</span> --result_video './temp/result.mp4'"</span>)<!-- HTML_TAG_END --></td>
|
465 |
+
</tr><tr class="" id="L53">
|
466 |
+
|
467 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="53"></td>
|
468 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">else</span>:<!-- HTML_TAG_END --></td>
|
469 |
+
</tr><tr class="" id="L54">
|
470 |
+
|
471 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="54"></td>
|
472 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> os.system(<span class="hljs-string">f"python demo.py --config config/vox-256.yaml --checkpoint ./checkpoints/vox.pth.tar --source_image 'temp/image.jpg' --driving_video <span class="hljs-subst">{vid}</span> --result_video './temp/result.mp4' --cpu"</span>)<!-- HTML_TAG_END --></td>
|
473 |
+
</tr><tr class="" id="L55">
|
474 |
+
|
475 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="55"></td>
|
476 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">return</span> <span class="hljs-string">'./temp/result.mp4'</span><!-- HTML_TAG_END --></td>
|
477 |
+
</tr><tr class="" id="L56">
|
478 |
+
|
479 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="56"></td>
|
480 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
481 |
+
<!-- HTML_TAG_END --></td>
|
482 |
+
</tr><tr class="" id="L57">
|
483 |
+
|
484 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="57"></td>
|
485 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
486 |
+
<!-- HTML_TAG_END --></td>
|
487 |
+
</tr><tr class="" id="L58">
|
488 |
+
|
489 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="58"></td>
|
490 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
491 |
+
<!-- HTML_TAG_END --></td>
|
492 |
+
</tr><tr class="" id="L59">
|
493 |
+
|
494 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="59"></td>
|
495 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-keyword">def</span> <span class="hljs-title function_">main</span>():<!-- HTML_TAG_END --></td>
|
496 |
+
</tr><tr class="" id="L60">
|
497 |
+
|
498 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="60"></td>
|
499 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Blocks(css=<span class="hljs-string">'style.css'</span>) <span class="hljs-keyword">as</span> demo:<!-- HTML_TAG_END --></td>
|
500 |
+
</tr><tr class="" id="L61">
|
501 |
+
|
502 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="61"></td>
|
503 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> gr.Markdown(title)<!-- HTML_TAG_END --></td>
|
504 |
+
</tr><tr class="" id="L62">
|
505 |
+
|
506 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="62"></td>
|
507 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> gr.Markdown(DESCRIPTION)<!-- HTML_TAG_END --></td>
|
508 |
+
</tr><tr class="" id="L63">
|
509 |
+
|
510 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="63"></td>
|
511 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
512 |
+
<!-- HTML_TAG_END --></td>
|
513 |
+
</tr><tr class="" id="L64">
|
514 |
+
|
515 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="64"></td>
|
516 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Box():<!-- HTML_TAG_END --></td>
|
517 |
+
</tr><tr class="" id="L65">
|
518 |
+
|
519 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="65"></td>
|
520 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> gr.Markdown(<span class="hljs-string">'''## Step 1 (Provide Input Face Image)</span><!-- HTML_TAG_END --></td>
|
521 |
+
</tr><tr class="" id="L66">
|
522 |
+
|
523 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="66"></td>
|
524 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-string">- Drop an image containing a face to the **Input Image**.</span><!-- HTML_TAG_END --></td>
|
525 |
+
</tr><tr class="" id="L67">
|
526 |
+
|
527 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="67"></td>
|
528 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-string"> - If there are multiple faces in the image, use Edit button in the upper right corner and crop the input image beforehand.</span><!-- HTML_TAG_END --></td>
|
529 |
+
</tr><tr class="" id="L68">
|
530 |
+
|
531 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="68"></td>
|
532 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-string">'''</span>)<!-- HTML_TAG_END --></td>
|
533 |
+
</tr><tr class="" id="L69">
|
534 |
+
|
535 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="69"></td>
|
536 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Row():<!-- HTML_TAG_END --></td>
|
537 |
+
</tr><tr class="" id="L70">
|
538 |
+
|
539 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="70"></td>
|
540 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Column():<!-- HTML_TAG_END --></td>
|
541 |
+
</tr><tr class="" id="L71">
|
542 |
+
|
543 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="71"></td>
|
544 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Row():<!-- HTML_TAG_END --></td>
|
545 |
+
</tr><tr class="" id="L72">
|
546 |
+
|
547 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="72"></td>
|
548 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> input_image = gr.Image(label=<span class="hljs-string">'Input Image'</span>,<!-- HTML_TAG_END --></td>
|
549 |
+
</tr><tr class="" id="L73">
|
550 |
+
|
551 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="73"></td>
|
552 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-built_in">type</span>=<span class="hljs-string">"pil"</span>)<!-- HTML_TAG_END --></td>
|
553 |
+
</tr><tr class="" id="L74">
|
554 |
+
|
555 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="74"></td>
|
556 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
557 |
+
<!-- HTML_TAG_END --></td>
|
558 |
+
</tr><tr class="" id="L75">
|
559 |
+
|
560 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="75"></td>
|
561 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Row():<!-- HTML_TAG_END --></td>
|
562 |
+
</tr><tr class="" id="L76">
|
563 |
+
|
564 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="76"></td>
|
565 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> paths = <span class="hljs-built_in">sorted</span>(pathlib.Path(<span class="hljs-string">'assets'</span>).glob(<span class="hljs-string">'*.png'</span>))<!-- HTML_TAG_END --></td>
|
566 |
+
</tr><tr class="" id="L77">
|
567 |
+
|
568 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="77"></td>
|
569 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> gr.Examples(inputs=[input_image],<!-- HTML_TAG_END --></td>
|
570 |
+
</tr><tr class="" id="L78">
|
571 |
+
|
572 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="78"></td>
|
573 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> examples=[[path.as_posix()] <span class="hljs-keyword">for</span> path <span class="hljs-keyword">in</span> paths])<!-- HTML_TAG_END --></td>
|
574 |
+
</tr><tr class="" id="L79">
|
575 |
+
|
576 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="79"></td>
|
577 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
578 |
+
<!-- HTML_TAG_END --></td>
|
579 |
+
</tr><tr class="" id="L80">
|
580 |
+
|
581 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="80"></td>
|
582 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Box():<!-- HTML_TAG_END --></td>
|
583 |
+
</tr><tr class="" id="L81">
|
584 |
+
|
585 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="81"></td>
|
586 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> gr.Markdown(<span class="hljs-string">'''## Step 2 (Select Driving Video)</span><!-- HTML_TAG_END --></td>
|
587 |
+
</tr><tr class="" id="L82">
|
588 |
+
|
589 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="82"></td>
|
590 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-string">- Select **Style Driving Video for the face image animation**.</span><!-- HTML_TAG_END --></td>
|
591 |
+
</tr><tr class="" id="L83">
|
592 |
+
|
593 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="83"></td>
|
594 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-string">'''</span>)<!-- HTML_TAG_END --></td>
|
595 |
+
</tr><tr class="" id="L84">
|
596 |
+
|
597 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="84"></td>
|
598 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Row():<!-- HTML_TAG_END --></td>
|
599 |
+
</tr><tr class="" id="L85">
|
600 |
+
|
601 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="85"></td>
|
602 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Column():<!-- HTML_TAG_END --></td>
|
603 |
+
</tr><tr class="" id="L86">
|
604 |
+
|
605 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="86"></td>
|
606 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Row():<!-- HTML_TAG_END --></td>
|
607 |
+
</tr><tr class="" id="L87">
|
608 |
+
|
609 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="87"></td>
|
610 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> driving_video = gr.Video(label=<span class="hljs-string">'Driving Video'</span>,<!-- HTML_TAG_END --></td>
|
611 |
+
</tr><tr class="" id="L88">
|
612 |
+
|
613 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="88"></td>
|
614 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-built_in">format</span>=<span class="hljs-string">"mp4"</span>)<!-- HTML_TAG_END --></td>
|
615 |
+
</tr><tr class="" id="L89">
|
616 |
+
|
617 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="89"></td>
|
618 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
619 |
+
<!-- HTML_TAG_END --></td>
|
620 |
+
</tr><tr class="" id="L90">
|
621 |
+
|
622 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="90"></td>
|
623 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Row():<!-- HTML_TAG_END --></td>
|
624 |
+
</tr><tr class="" id="L91">
|
625 |
+
|
626 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="91"></td>
|
627 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> paths = <span class="hljs-built_in">sorted</span>(pathlib.Path(<span class="hljs-string">'assets'</span>).glob(<span class="hljs-string">'*.mp4'</span>))<!-- HTML_TAG_END --></td>
|
628 |
+
</tr><tr class="" id="L92">
|
629 |
+
|
630 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="92"></td>
|
631 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> gr.Examples(inputs=[driving_video],<!-- HTML_TAG_END --></td>
|
632 |
+
</tr><tr class="" id="L93">
|
633 |
+
|
634 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="93"></td>
|
635 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> examples=[[path.as_posix()] <span class="hljs-keyword">for</span> path <span class="hljs-keyword">in</span> paths])<!-- HTML_TAG_END --></td>
|
636 |
+
</tr><tr class="" id="L94">
|
637 |
+
|
638 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="94"></td>
|
639 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
640 |
+
<!-- HTML_TAG_END --></td>
|
641 |
+
</tr><tr class="" id="L95">
|
642 |
+
|
643 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="95"></td>
|
644 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Box():<!-- HTML_TAG_END --></td>
|
645 |
+
</tr><tr class="" id="L96">
|
646 |
+
|
647 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="96"></td>
|
648 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> gr.Markdown(<span class="hljs-string">'''## Step 3 (Generate Animated Image based on the Video)</span><!-- HTML_TAG_END --></td>
|
649 |
+
</tr><tr class="" id="L97">
|
650 |
+
|
651 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="97"></td>
|
652 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-string">- Hit the **Generate** button. (Note: On cpu-basic, it takes ~ 10 minutes to generate final results.)</span><!-- HTML_TAG_END --></td>
|
653 |
+
</tr><tr class="" id="L98">
|
654 |
+
|
655 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="98"></td>
|
656 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-string">'''</span>)<!-- HTML_TAG_END --></td>
|
657 |
+
</tr><tr class="" id="L99">
|
658 |
+
|
659 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="99"></td>
|
660 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Row():<!-- HTML_TAG_END --></td>
|
661 |
+
</tr><tr class="" id="L100">
|
662 |
+
|
663 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="100"></td>
|
664 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Column():<!-- HTML_TAG_END --></td>
|
665 |
+
</tr><tr class="" id="L101">
|
666 |
+
|
667 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="101"></td>
|
668 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Row():<!-- HTML_TAG_END --></td>
|
669 |
+
</tr><tr class="" id="L102">
|
670 |
+
|
671 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="102"></td>
|
672 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> generate_button = gr.Button(<span class="hljs-string">'Generate'</span>)<!-- HTML_TAG_END --></td>
|
673 |
+
</tr><tr class="" id="L103">
|
674 |
+
|
675 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="103"></td>
|
676 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
677 |
+
<!-- HTML_TAG_END --></td>
|
678 |
+
</tr><tr class="" id="L104">
|
679 |
+
|
680 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="104"></td>
|
681 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-keyword">with</span> gr.Column():<!-- HTML_TAG_END --></td>
|
682 |
+
</tr><tr class="" id="L105">
|
683 |
+
|
684 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="105"></td>
|
685 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> result = gr.Video(label=<span class="hljs-string">"Output"</span>)<!-- HTML_TAG_END --></td>
|
686 |
+
</tr><tr class="" id="L106">
|
687 |
+
|
688 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="106"></td>
|
689 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> gr.Markdown(FOOTER)<!-- HTML_TAG_END --></td>
|
690 |
+
</tr><tr class="" id="L107">
|
691 |
+
|
692 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="107"></td>
|
693 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> generate_button.click(fn=inference,<!-- HTML_TAG_END --></td>
|
694 |
+
</tr><tr class="" id="L108">
|
695 |
+
|
696 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="108"></td>
|
697 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> inputs=[<!-- HTML_TAG_END --></td>
|
698 |
+
</tr><tr class="" id="L109">
|
699 |
+
|
700 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="109"></td>
|
701 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> input_image,<!-- HTML_TAG_END --></td>
|
702 |
+
</tr><tr class="" id="L110">
|
703 |
+
|
704 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="110"></td>
|
705 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> driving_video<!-- HTML_TAG_END --></td>
|
706 |
+
</tr><tr class="" id="L111">
|
707 |
+
|
708 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="111"></td>
|
709 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> ],<!-- HTML_TAG_END --></td>
|
710 |
+
</tr><tr class="" id="L112">
|
711 |
+
|
712 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="112"></td>
|
713 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> outputs=result)<!-- HTML_TAG_END --></td>
|
714 |
+
</tr><tr class="" id="L113">
|
715 |
+
|
716 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="113"></td>
|
717 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
718 |
+
<!-- HTML_TAG_END --></td>
|
719 |
+
</tr><tr class="" id="L114">
|
720 |
+
|
721 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="114"></td>
|
722 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> demo.queue(max_size=<span class="hljs-number">10</span>).launch()<!-- HTML_TAG_END --></td>
|
723 |
+
</tr><tr class="" id="L115">
|
724 |
+
|
725 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="115"></td>
|
726 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
727 |
+
<!-- HTML_TAG_END --></td>
|
728 |
+
</tr><tr class="" id="L116">
|
729 |
+
|
730 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="116"></td>
|
731 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">'__main__'</span>:<!-- HTML_TAG_END --></td>
|
732 |
+
</tr><tr class="" id="L117">
|
733 |
+
|
734 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="117"></td>
|
735 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> main()<!-- HTML_TAG_END --></td>
|
736 |
+
</tr><tr class="" id="L118">
|
737 |
+
|
738 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="118"></td>
|
739 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
740 |
+
<!-- HTML_TAG_END --></td>
|
741 |
+
</tr></tbody></table></div>
|
742 |
+
</div></div></div></div></section></div></main>
|
743 |
+
</div>
|
744 |
+
|
745 |
+
<script>
|
746 |
+
import("/front/build/kube-63b5efc/index.js");
|
747 |
+
window.moonSha = "kube-63b5efc/";
|
748 |
+
window.hubConfig = JSON.parse(`{"features":{"signupDisabled":false},"sshGitUrl":"[email protected]","moonHttpUrl":"https://huggingface.co","captchaApiKey":"bd5f2066-93dc-4bdd-a64b-a24646ca3859","captchaDisabledOnSignup":true,"datasetsServerPublicUrl":"https://datasets-server.huggingface.co","stripePublicKey":"pk_live_x2tdjFXBCvXo2FFmMybezpeM00J6gPCAAc","environment":"production","userAgent":"HuggingFace (production)"}`);
|
749 |
+
</script>
|
750 |
+
|
751 |
+
<!-- Stripe -->
|
752 |
+
<script>
|
753 |
+
if (["hf.co", "huggingface.co"].includes(window.location.hostname)) {
|
754 |
+
const script = document.createElement("script");
|
755 |
+
script.src = "https://js.stripe.com/v3/";
|
756 |
+
script.async = true;
|
757 |
+
document.head.appendChild(script);
|
758 |
+
}
|
759 |
+
</script>
|
760 |
+
|
761 |
+
<!-- Google analytics v4 -->
|
762 |
+
<script>
|
763 |
+
if (["hf.co", "huggingface.co"].includes(window.location.hostname)) {
|
764 |
+
const script = document.createElement("script");
|
765 |
+
script.src = "https://www.googletagmanager.com/gtag/js?id=G-8Q63TH4CSL";
|
766 |
+
script.async = true;
|
767 |
+
document.head.appendChild(script);
|
768 |
+
|
769 |
+
window.dataLayer = window.dataLayer || [];
|
770 |
+
function gtag() {
|
771 |
+
if (window.dataLayer !== undefined) {
|
772 |
+
window.dataLayer.push(arguments);
|
773 |
+
}
|
774 |
+
}
|
775 |
+
gtag("js", new Date());
|
776 |
+
gtag("config", "G-8Q63TH4CSL", { page_path: "/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/blob/main/app.py" });
|
777 |
+
/// ^ See https://developers.google.com/analytics/devguides/collection/gtagjs/pages
|
778 |
+
gtag("consent", "default", { ad_storage: "denied", analytics_storage: "denied" });
|
779 |
+
/// ^ See https://developers.google.com/tag-platform/gtagjs/reference#consent
|
780 |
+
/// TODO: ask the user for their consent and update this with gtag('consent', 'update')
|
781 |
+
}
|
782 |
+
</script>
|
783 |
+
</body>
|
784 |
+
</html>
|
packages.txt
ADDED
@@ -0,0 +1,298 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html class="">
|
3 |
+
<head>
|
4 |
+
<meta charset="utf-8" />
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
|
6 |
+
<meta name="description" content="We’re on a journey to advance and democratize artificial intelligence through open source and open science." />
|
7 |
+
<meta property="fb:app_id" content="1321688464574422" />
|
8 |
+
<meta name="twitter:card" content="summary_large_image" />
|
9 |
+
<meta name="twitter:site" content="@huggingface" />
|
10 |
+
<meta property="og:title" content="packages.txt · CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model at main" />
|
11 |
+
<meta property="og:type" content="website" />
|
12 |
+
<meta property="og:url" content="https://huggingface.co/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/blob/main/packages.txt" />
|
13 |
+
<meta property="og:image" content="https://cdn-thumbnails.huggingface.co/social-thumbnails/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model.png" />
|
14 |
+
|
15 |
+
<link rel="stylesheet" href="/front/build/kube-63b5efc/style.css" />
|
16 |
+
|
17 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
18 |
+
<link
|
19 |
+
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900&display=swap"
|
20 |
+
rel="stylesheet"
|
21 |
+
/>
|
22 |
+
<link
|
23 |
+
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&display=swap"
|
24 |
+
rel="stylesheet"
|
25 |
+
/>
|
26 |
+
|
27 |
+
<link
|
28 |
+
rel="preload"
|
29 |
+
href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.css"
|
30 |
+
as="style"
|
31 |
+
onload="this.onload=null;this.rel='stylesheet'"
|
32 |
+
/>
|
33 |
+
<noscript>
|
34 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.css" />
|
35 |
+
</noscript>
|
36 |
+
|
37 |
+
<!-- HEAD_svelte-1oal594_START --><style>.blob-line-num::before {
|
38 |
+
content: attr(data-line-num);
|
39 |
+
}
|
40 |
+
</style><!-- HEAD_svelte-1oal594_END -->
|
41 |
+
|
42 |
+
<title>packages.txt · CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model at main</title>
|
43 |
+
|
44 |
+
<script defer data-domain="huggingface.co" src="/js/script.js"></script>
|
45 |
+
<script type="text/javascript" src="https://de5282c3ca0c.edge.sdk.awswaf.com/de5282c3ca0c/526cf06acb0d/challenge.js" defer></script>
|
46 |
+
</head>
|
47 |
+
<body class="flex flex-col min-h-screen bg-white dark:bg-gray-950 text-black ViewerBlobPage">
|
48 |
+
<div class="flex min-h-screen flex-col">
|
49 |
+
<div class="SVELTE_HYDRATER contents" data-props="{"classNames":"","isWide":false,"isZh":false}" data-target="MainHeader"><header class="border-b border-gray-100 "><div class="w-full px-4 container flex h-16 items-center"><div class="flex flex-1 items-center"><a class="mr-5 flex flex-none items-center lg:mr-6" href="/"><img alt="Hugging Face's logo" class="w-7 md:mr-2" src="/front/assets/huggingface_logo-noborder.svg">
|
50 |
+
<span class="hidden whitespace-nowrap text-lg font-bold md:block">Hugging Face</span></a>
|
51 |
+
<div class="relative flex-1 lg:max-w-sm mr-2 sm:mr-4 lg:mr-6"><input autocomplete="off" class="w-full dark:bg-gray-950 pl-8 form-input-alt h-9 pr-3 focus:shadow-xl" name="" placeholder="Search models, datasets, users..." spellcheck="false" type="text" value="">
|
52 |
+
<svg class="absolute left-2.5 text-gray-400 top-1/2 transform -translate-y-1/2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M30 28.59L22.45 21A11 11 0 1 0 21 22.45L28.59 30zM5 14a9 9 0 1 1 9 9a9 9 0 0 1-9-9z" fill="currentColor"></path></svg>
|
53 |
+
</div>
|
54 |
+
<div class="flex flex-none items-center justify-center p-0.5 place-self-stretch lg:hidden"><button class="relative z-40 flex h-6 w-8 items-center justify-center" type="button"><svg width="1em" height="1em" viewBox="0 0 10 10" class="text-xl" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" preserveAspectRatio="xMidYMid meet" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.65039 2.9999C1.65039 2.8066 1.80709 2.6499 2.00039 2.6499H8.00039C8.19369 2.6499 8.35039 2.8066 8.35039 2.9999C8.35039 3.1932 8.19369 3.3499 8.00039 3.3499H2.00039C1.80709 3.3499 1.65039 3.1932 1.65039 2.9999ZM1.65039 4.9999C1.65039 4.8066 1.80709 4.6499 2.00039 4.6499H8.00039C8.19369 4.6499 8.35039 4.8066 8.35039 4.9999C8.35039 5.1932 8.19369 5.3499 8.00039 5.3499H2.00039C1.80709 5.3499 1.65039 5.1932 1.65039 4.9999ZM2.00039 6.6499C1.80709 6.6499 1.65039 6.8066 1.65039 6.9999C1.65039 7.1932 1.80709 7.3499 2.00039 7.3499H8.00039C8.19369 7.3499 8.35039 7.1932 8.35039 6.9999C8.35039 6.8066 8.19369 6.6499 8.00039 6.6499H2.00039Z"></path></svg>
|
55 |
+
</button>
|
56 |
+
|
57 |
+
</div></div>
|
58 |
+
<nav aria-label="Main" class="ml-auto hidden lg:block"><ul class="flex items-center space-x-2"><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-indigo-700" href="/models"><svg class="mr-1.5 text-gray-400 group-hover:text-indigo-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-quaternary" d="M20.23 7.24L12 12L3.77 7.24a1.98 1.98 0 0 1 .7-.71L11 2.76c.62-.35 1.38-.35 2 0l6.53 3.77c.29.173.531.418.7.71z" opacity=".25" fill="currentColor"></path><path class="uim-tertiary" d="M12 12v9.5a2.09 2.09 0 0 1-.91-.21L4.5 17.48a2.003 2.003 0 0 1-1-1.73v-7.5a2.06 2.06 0 0 1 .27-1.01L12 12z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M20.5 8.25v7.5a2.003 2.003 0 0 1-1 1.73l-6.62 3.82c-.275.13-.576.198-.88.2V12l8.23-4.76c.175.308.268.656.27 1.01z" fill="currentColor"></path></svg>
|
59 |
+
Models</a>
|
60 |
+
</li><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-red-700" href="/datasets"><svg class="mr-1.5 text-gray-400 group-hover:text-red-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 25 25"><ellipse cx="12.5" cy="5" fill="currentColor" fill-opacity="0.25" rx="7.5" ry="2"></ellipse><path d="M12.5 15C16.6421 15 20 14.1046 20 13V20C20 21.1046 16.6421 22 12.5 22C8.35786 22 5 21.1046 5 20V13C5 14.1046 8.35786 15 12.5 15Z" fill="currentColor" opacity="0.5"></path><path d="M12.5 7C16.6421 7 20 6.10457 20 5V11.5C20 12.6046 16.6421 13.5 12.5 13.5C8.35786 13.5 5 12.6046 5 11.5V5C5 6.10457 8.35786 7 12.5 7Z" fill="currentColor" opacity="0.5"></path><path d="M5.23628 12C5.08204 12.1598 5 12.8273 5 13C5 14.1046 8.35786 15 12.5 15C16.6421 15 20 14.1046 20 13C20 12.8273 19.918 12.1598 19.7637 12C18.9311 12.8626 15.9947 13.5 12.5 13.5C9.0053 13.5 6.06886 12.8626 5.23628 12Z" fill="currentColor"></path></svg>
|
61 |
+
Datasets</a>
|
62 |
+
</li><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-blue-700" href="/spaces"><svg class="mr-1.5 text-gray-400 group-hover:text-blue-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" viewBox="0 0 25 25"><path opacity=".5" d="M6.016 14.674v4.31h4.31v-4.31h-4.31ZM14.674 14.674v4.31h4.31v-4.31h-4.31ZM6.016 6.016v4.31h4.31v-4.31h-4.31Z" fill="currentColor"></path><path opacity=".75" fill-rule="evenodd" clip-rule="evenodd" d="M3 4.914C3 3.857 3.857 3 4.914 3h6.514c.884 0 1.628.6 1.848 1.414a5.171 5.171 0 0 1 7.31 7.31c.815.22 1.414.964 1.414 1.848v6.514A1.914 1.914 0 0 1 20.086 22H4.914A1.914 1.914 0 0 1 3 20.086V4.914Zm3.016 1.102v4.31h4.31v-4.31h-4.31Zm0 12.968v-4.31h4.31v4.31h-4.31Zm8.658 0v-4.31h4.31v4.31h-4.31Zm0-10.813a2.155 2.155 0 1 1 4.31 0 2.155 2.155 0 0 1-4.31 0Z" fill="currentColor"></path><path opacity=".25" d="M16.829 6.016a2.155 2.155 0 1 0 0 4.31 2.155 2.155 0 0 0 0-4.31Z" fill="currentColor"></path></svg>
|
63 |
+
Spaces</a>
|
64 |
+
</li><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-yellow-700" href="/docs"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="mr-1.5 text-gray-400 group-hover:text-yellow-500" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path opacity="0.5" d="M20.9022 5.10334L10.8012 10.8791L7.76318 9.11193C8.07741 8.56791 8.5256 8.11332 9.06512 7.7914L15.9336 3.73907C17.0868 3.08811 18.5002 3.26422 19.6534 3.91519L19.3859 3.73911C19.9253 4.06087 20.5879 4.56025 20.9022 5.10334Z" fill="currentColor"></path><path d="M10.7999 10.8792V28.5483C10.2136 28.5475 9.63494 28.4139 9.10745 28.1578C8.5429 27.8312 8.074 27.3621 7.74761 26.7975C7.42122 26.2327 7.24878 25.5923 7.24756 24.9402V10.9908C7.25062 10.3319 7.42358 9.68487 7.74973 9.1123L10.7999 10.8792Z" fill="currentColor" fill-opacity="0.75"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M21.3368 10.8499V6.918C21.3331 6.25959 21.16 5.61234 20.8346 5.03949L10.7971 10.8727L10.8046 10.874L21.3368 10.8499Z" fill="currentColor"></path><path opacity="0.5" d="M21.7937 10.8488L10.7825 10.8741V28.5486L21.7937 28.5234C23.3344 28.5234 24.5835 27.2743 24.5835 25.7335V13.6387C24.5835 12.0979 23.4365 11.1233 21.7937 10.8488Z" fill="currentColor"></path></svg>
|
65 |
+
Docs</a>
|
66 |
+
</li>
|
67 |
+
<li><div class="relative ">
|
68 |
+
<button class="px-2 py-0.5 group hover:text-green-700 dark:hover:text-gray-400 flex items-center " type="button">
|
69 |
+
<svg class="mr-1.5 text-gray-400 group-hover:text-green-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-tertiary" d="M19 6H5a3 3 0 0 0-3 3v2.72L8.837 14h6.326L22 11.72V9a3 3 0 0 0-3-3z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M10 6V5h4v1h2V5a2.002 2.002 0 0 0-2-2h-4a2.002 2.002 0 0 0-2 2v1h2zm-1.163 8L2 11.72V18a3.003 3.003 0 0 0 3 3h14a3.003 3.003 0 0 0 3-3v-6.28L15.163 14H8.837z" fill="currentColor"></path></svg>
|
70 |
+
Solutions
|
71 |
+
</button>
|
72 |
+
|
73 |
+
|
74 |
+
|
75 |
+
</div></li>
|
76 |
+
<li><a class="group flex items-center px-2 py-0.5 hover:text-gray-500 dark:hover:text-gray-400" href="/pricing">Pricing
|
77 |
+
</a></li>
|
78 |
+
|
79 |
+
<li><div class="relative group">
|
80 |
+
<button class="px-2 py-0.5 hover:text-gray-500 dark:hover:text-gray-600 flex items-center " type="button">
|
81 |
+
<svg class="mr-1.5 text-gray-500 w-5 group-hover:text-gray-400 dark:text-gray-300 dark:group-hover:text-gray-400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" viewBox="0 0 32 18" preserveAspectRatio="xMidYMid meet"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4504 3.30221C14.4504 2.836 14.8284 2.45807 15.2946 2.45807H28.4933C28.9595 2.45807 29.3374 2.836 29.3374 3.30221C29.3374 3.76842 28.9595 4.14635 28.4933 4.14635H15.2946C14.8284 4.14635 14.4504 3.76842 14.4504 3.30221Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4504 9.00002C14.4504 8.53382 14.8284 8.15588 15.2946 8.15588H28.4933C28.9595 8.15588 29.3374 8.53382 29.3374 9.00002C29.3374 9.46623 28.9595 9.84417 28.4933 9.84417H15.2946C14.8284 9.84417 14.4504 9.46623 14.4504 9.00002Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4504 14.6978C14.4504 14.2316 14.8284 13.8537 15.2946 13.8537H28.4933C28.9595 13.8537 29.3374 14.2316 29.3374 14.6978C29.3374 15.164 28.9595 15.542 28.4933 15.542H15.2946C14.8284 15.542 14.4504 15.164 14.4504 14.6978Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M1.94549 6.87377C2.27514 6.54411 2.80962 6.54411 3.13928 6.87377L6.23458 9.96907L9.32988 6.87377C9.65954 6.54411 10.194 6.54411 10.5237 6.87377C10.8533 7.20343 10.8533 7.73791 10.5237 8.06756L6.23458 12.3567L1.94549 8.06756C1.61583 7.73791 1.61583 7.20343 1.94549 6.87377Z" fill="currentColor"></path></svg>
|
82 |
+
|
83 |
+
</button>
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
</div></li>
|
88 |
+
<li><hr class="h-5 w-0.5 border-none bg-gray-100 dark:bg-gray-800"></li>
|
89 |
+
<li><a class="block cursor-pointer px-2 py-0.5 hover:text-gray-500 dark:hover:text-gray-400" href="/login">Log In
|
90 |
+
</a></li>
|
91 |
+
<li><a class="rounded-full border border-transparent bg-gray-900 px-3 py-1 leading-none text-white hover:border-black hover:bg-white hover:text-black" href="/join">Sign Up
|
92 |
+
</a></li></ul></nav></div></header></div>
|
93 |
+
|
94 |
+
<div class="SVELTE_HYDRATER contents" data-props="{}" data-target="GoogleAnalyticsTracker"></div>
|
95 |
+
|
96 |
+
|
97 |
+
<div class="SVELTE_HYDRATER contents" data-props="{}" data-target="SSOBanner"></div>
|
98 |
+
|
99 |
+
<main class="flex flex-1 flex-col"><div class="SVELTE_HYDRATER contents" data-props="{"activeTab":"files","author":{"avatarUrl":"https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1642793296366-61e1188afc27c0f5e3641eb3.jpeg?w=200&h=200&f=face","fullname":"CVPR Demo Track","name":"CVPR","type":"org","isHf":false},"canReadRepoSettings":false,"canDisable":false,"discussionsStats":{"closed":5,"open":6,"total":11},"query":{},"space":{"author":"CVPR","colorFrom":"indigo","colorTo":"indigo","cardData":{"title":"Image Animation Using Thin Plate Spline Motion Model","emoji":"👁","colorFrom":"indigo","colorTo":"indigo","sdk":"gradio","sdk_version":"3.48.0","app_file":"app.py","pinned":false},"emoji":"👁","discussionsDisabled":false,"duplicationDisabled":false,"id":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","isLikedByUser":false,"isWatchedByUser":false,"lastModified":"2023-10-25T19:06:23.000Z","likes":510,"pinned":false,"private":false,"gated":false,"repoType":"space","subdomain":"cvpr-image-animation-using-thin-plate-spline-mot-e234846","sdk":"gradio","sdkVersion":"3.48.0","title":"Image Animation Using Thin Plate Spline Motion Model","runtime":{"stage":"RUNNING","hardware":{"current":"cpu-basic","requested":"cpu-basic"},"storage":null,"gcTimeout":null,"replicas":{"current":1,"requested":1}},"iframe":{"host":"https://cvpr-image-animation-using-thin-plate-spline-mot-e234846.hf.space","src":"https://cvpr-image-animation-using-thin-plate-spline-mot-e234846.hf.space"},"secrets":[],"variables":[],"sse":{"url":"https://api.hf.space/v1/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","jwt":"eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJpYXQiOjE2OTk2NzcwMjEsInN1YiI6Ii9zcGFjZXMvQ1ZQUi9JbWFnZS1BbmltYXRpb24tdXNpbmctVGhpbi1QbGF0ZS1TcGxpbmUtTW90aW9uLU1vZGVsIiwiZXhwIjoxNjk5NzYzNDIxLCJpc3MiOiJodHRwczovL2h1Z2dpbmdmYWNlLmNvIn0.S7BoNly-Px-mHgw1zhbWPBv5Xs__GIjzoWUnxXIivZ_33LCfeY4szUl_5AwiRs6Y3TJOw_CMkTv7zWmHCRSvBA"},"linkedModels":[],"linkedDatasets":[],"linkedCollections":[]}}" data-target="SpaceHeader"><header class="from-gray-50-to-white border-b border-gray-100 bg-gradient-to-t via-white dark:via-gray-950 pt-4 xl:pt-0"><div class="container relative flex flex-col xl:flex-row"><h1 class="flex flex-wrap items-center leading-tight gap-y-1 text-lg xl:flex-none"><a href="/spaces" class="group flex items-center"><svg class="mr-1 text-gray-400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M7.80914 18.7462V24.1907H13.2536V18.7462H7.80914Z" fill="#FF3270"></path><path d="M18.7458 18.7462V24.1907H24.1903V18.7462H18.7458Z" fill="#861FFF"></path><path d="M7.80914 7.80982V13.2543H13.2536V7.80982H7.80914Z" fill="#097EFF"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.41775C4 5.08246 5.08246 4 6.41775 4H14.6457C15.7626 4 16.7026 4.75724 16.9802 5.78629C18.1505 4.67902 19.7302 4 21.4685 4C25.0758 4 28.0003 6.92436 28.0003 10.5317C28.0003 12.27 27.3212 13.8497 26.2139 15.02C27.243 15.2977 28.0003 16.2376 28.0003 17.3545V25.5824C28.0003 26.9177 26.9177 28.0003 25.5824 28.0003H17.0635H14.9367H6.41775C5.08246 28.0003 4 26.9177 4 25.5824V15.1587V14.9367V6.41775ZM7.80952 7.80952V13.254H13.254V7.80952H7.80952ZM7.80952 24.1907V18.7462H13.254V24.1907H7.80952ZM18.7462 24.1907V18.7462H24.1907V24.1907H18.7462ZM18.7462 10.5317C18.7462 9.0283 19.9651 7.80952 21.4685 7.80952C22.9719 7.80952 24.1907 9.0283 24.1907 10.5317C24.1907 12.0352 22.9719 13.254 21.4685 13.254C19.9651 13.254 18.7462 12.0352 18.7462 10.5317Z" fill="black"></path><path d="M21.4681 7.80982C19.9647 7.80982 18.7458 9.02861 18.7458 10.5321C18.7458 12.0355 19.9647 13.2543 21.4681 13.2543C22.9715 13.2543 24.1903 12.0355 24.1903 10.5321C24.1903 9.02861 22.9715 7.80982 21.4681 7.80982Z" fill="#FFD702"></path></svg>
|
100 |
+
<span class="mr-2.5 font-semibold text-gray-400 group-hover:text-gray-500">Spaces:</span></a>
|
101 |
+
<div class="group flex flex-none items-center"><div class="relative mr-1.5 flex items-center">
|
102 |
+
|
103 |
+
<img alt="" class="w-3.5 h-3.5 rounded " src="https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1642793296366-61e1188afc27c0f5e3641eb3.jpeg?w=200&h=200&f=face" crossorigin="anonymous"></div>
|
104 |
+
<a href="/CVPR" class="text-gray-400 hover:text-blue-600">CVPR</a>
|
105 |
+
<div class="mx-0.5 text-gray-300">/</div></div>
|
106 |
+
|
107 |
+
<div class="max-w-full xl:flex xl:min-w-0 xl:flex-nowrap xl:items-center xl:gap-x-1"><a class="break-words font-mono font-semibold hover:text-blue-600 text-[1.07rem] xl:truncate" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model">Image-Animation-using-Thin-Plate-Spline-Motion-Model</a>
|
108 |
+
<button class="relative text-xs mr-3 inline-flex cursor-pointer items-center text-sm focus:outline-none mx-0.5 text-gray-600 " title="Copy space name to clipboard" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg>
|
109 |
+
|
110 |
+
</button></div>
|
111 |
+
<div class="inline-flex items-center overflow-hidden whitespace-nowrap rounded-md border bg-white text-sm leading-none text-gray-500 mr-2"><button class="relative flex items-center px-1.5 py-1 hover:bg-gradient-to-t focus:outline-none overflow-hidden from-red-50 to-transparent dark:from-red-900 dark:to-red-800" title="Like"><svg class="left-1.5 absolute" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" fill="currentColor"><path d="M22.45,6a5.47,5.47,0,0,1,3.91,1.64,5.7,5.7,0,0,1,0,8L16,26.13,5.64,15.64a5.7,5.7,0,0,1,0-8,5.48,5.48,0,0,1,7.82,0L16,10.24l2.53-2.58A5.44,5.44,0,0,1,22.45,6m0-2a7.47,7.47,0,0,0-5.34,2.24L16,7.36,14.89,6.24a7.49,7.49,0,0,0-10.68,0,7.72,7.72,0,0,0,0,10.82L16,29,27.79,17.06a7.72,7.72,0,0,0,0-10.82A7.49,7.49,0,0,0,22.45,4Z"></path></svg>
|
112 |
+
|
113 |
+
|
114 |
+
<span class="ml-4 pl-0.5">like</span></button>
|
115 |
+
<button class="flex items-center border-l px-1.5 py-1 text-gray-400 hover:bg-gray-50 focus:bg-gray-100 focus:outline-none dark:hover:bg-gray-900 dark:focus:bg-gray-800" title="See users who liked this repository">510</button></div>
|
116 |
+
|
117 |
+
|
118 |
+
|
119 |
+
|
120 |
+
|
121 |
+
|
122 |
+
|
123 |
+
|
124 |
+
|
125 |
+
<div class="inline-flex select-none items-center overflow-hidden font-mono text-xs flex-shrink-0 mr-2 rounded-lg border px-2 py-[0.32rem] leading-none dark:bg-gray-900
|
126 |
+
bg-green-50
|
127 |
+
border-green-100
|
128 |
+
text-green-700 dark:text-green-500">
|
129 |
+
<div class="ml-0.5 mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"></div>
|
130 |
+
Running
|
131 |
+
</div>
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
+
|
136 |
+
<div class="sm:hidden"><div class="relative ">
|
137 |
+
<button class="btn px-1 py-1 text-sm translate-y-0 " type="button">
|
138 |
+
|
139 |
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="p-px" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><circle cx="16" cy="7" r="3" fill="currentColor"></circle><circle cx="16" cy="16" r="3" fill="currentColor"></circle><circle cx="16" cy="25" r="3" fill="currentColor"></circle></svg>
|
140 |
+
|
141 |
+
|
142 |
+
</button>
|
143 |
+
|
144 |
+
|
145 |
+
|
146 |
+
</div></div></h1>
|
147 |
+
|
148 |
+
|
149 |
+
<div class="flex flex-col-reverse gap-x-2 sm:flex-row sm:items-center sm:justify-between xl:ml-auto"><div class="-mb-px flex h-12 items-center overflow-x-auto overflow-y-hidden sm:h-[3.25rem]"><a class="tab-alternate " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model"><svg class="mr-1.5 text-gray-400 flex-none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-quaternary" d="M20.23 7.24L12 12L3.77 7.24a1.98 1.98 0 0 1 .7-.71L11 2.76c.62-.35 1.38-.35 2 0l6.53 3.77c.29.173.531.418.7.71z" opacity=".25" fill="currentColor"></path><path class="uim-tertiary" d="M12 12v9.5a2.09 2.09 0 0 1-.91-.21L4.5 17.48a2.003 2.003 0 0 1-1-1.73v-7.5a2.06 2.06 0 0 1 .27-1.01L12 12z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M20.5 8.25v7.5a2.003 2.003 0 0 1-1 1.73l-6.62 3.82c-.275.13-.576.198-.88.2V12l8.23-4.76c.175.308.268.656.27 1.01z" fill="currentColor"></path></svg>
|
150 |
+
App
|
151 |
+
|
152 |
+
|
153 |
+
</a><a class="tab-alternate active" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/tree/main"><svg class="mr-1.5 text-gray-400 flex-none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-tertiary" d="M21 19h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2zm0-4h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2zm0-8h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2zm0 4h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M9 19a1 1 0 0 1-1-1V6a1 1 0 0 1 2 0v12a1 1 0 0 1-1 1zm-6-4.333a1 1 0 0 1-.64-1.769L3.438 12l-1.078-.898a1 1 0 0 1 1.28-1.538l2 1.667a1 1 0 0 1 0 1.538l-2 1.667a.999.999 0 0 1-.64.231z" fill="currentColor"></path></svg>
|
154 |
+
<span class="xl:hidden">Files</span>
|
155 |
+
<span class="hidden xl:inline">Files</span>
|
156 |
+
|
157 |
+
|
158 |
+
</a><a class="tab-alternate " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/discussions"><svg class="mr-1.5 text-gray-400 flex-none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M20.6081 3C21.7684 3 22.8053 3.49196 23.5284 4.38415C23.9756 4.93678 24.4428 5.82749 24.4808 7.16133C24.9674 7.01707 25.4353 6.93643 25.8725 6.93643C26.9833 6.93643 27.9865 7.37587 28.696 8.17411C29.6075 9.19872 30.0124 10.4579 29.8361 11.7177C29.7523 12.3177 29.5581 12.8555 29.2678 13.3534C29.8798 13.8646 30.3306 14.5763 30.5485 15.4322C30.719 16.1032 30.8939 17.5006 29.9808 18.9403C30.0389 19.0342 30.0934 19.1319 30.1442 19.2318C30.6932 20.3074 30.7283 21.5229 30.2439 22.6548C29.5093 24.3704 27.6841 25.7219 24.1397 27.1727C21.9347 28.0753 19.9174 28.6523 19.8994 28.6575C16.9842 29.4379 14.3477 29.8345 12.0653 29.8345C7.87017 29.8345 4.8668 28.508 3.13831 25.8921C0.356375 21.6797 0.754104 17.8269 4.35369 14.1131C6.34591 12.058 7.67023 9.02782 7.94613 8.36275C8.50224 6.39343 9.97271 4.20438 12.4172 4.20438H12.4179C12.6236 4.20438 12.8314 4.2214 13.0364 4.25468C14.107 4.42854 15.0428 5.06476 15.7115 6.02205C16.4331 5.09583 17.134 4.359 17.7682 3.94323C18.7242 3.31737 19.6794 3 20.6081 3ZM20.6081 5.95917C20.2427 5.95917 19.7963 6.1197 19.3039 6.44225C17.7754 7.44319 14.8258 12.6772 13.7458 14.7131C13.3839 15.3952 12.7655 15.6837 12.2086 15.6837C11.1036 15.6837 10.2408 14.5497 12.1076 13.1085C14.9146 10.9402 13.9299 7.39584 12.5898 7.1776C12.5311 7.16799 12.4731 7.16355 12.4172 7.16355C11.1989 7.16355 10.6615 9.33114 10.6615 9.33114C10.6615 9.33114 9.0863 13.4148 6.38031 16.206C3.67434 18.998 3.5346 21.2388 5.50675 24.2246C6.85185 26.2606 9.42666 26.8753 12.0653 26.8753C14.8021 26.8753 17.6077 26.2139 19.1799 25.793C19.2574 25.7723 28.8193 22.984 27.6081 20.6107C27.4046 20.212 27.0693 20.0522 26.6471 20.0522C24.9416 20.0522 21.8393 22.6726 20.5057 22.6726C20.2076 22.6726 19.9976 22.5416 19.9116 22.222C19.3433 20.1173 28.552 19.2325 27.7758 16.1839C27.639 15.6445 27.2677 15.4256 26.746 15.4263C24.4923 15.4263 19.4358 19.5181 18.3759 19.5181C18.2949 19.5181 18.2368 19.4937 18.2053 19.4419C17.6743 18.557 17.9653 17.9394 21.7082 15.6009C25.4511 13.2617 28.0783 11.8545 26.5841 10.1752C26.4121 9.98141 26.1684 9.8956 25.8725 9.8956C23.6001 9.89634 18.2311 14.9403 18.2311 14.9403C18.2311 14.9403 16.7821 16.496 15.9057 16.496C15.7043 16.496 15.533 16.4139 15.4169 16.2112C14.7956 15.1296 21.1879 10.1286 21.5484 8.06535C21.7928 6.66715 21.3771 5.95917 20.6081 5.95917Z" fill="#FF9D00"></path><path d="M5.50686 24.2246C3.53472 21.2387 3.67446 18.9979 6.38043 16.206C9.08641 13.4147 10.6615 9.33111 10.6615 9.33111C10.6615 9.33111 11.2499 6.95933 12.59 7.17757C13.93 7.39581 14.9139 10.9401 12.1069 13.1084C9.29997 15.276 12.6659 16.7489 13.7459 14.713C14.8258 12.6772 17.7747 7.44316 19.304 6.44221C20.8326 5.44128 21.9089 6.00204 21.5484 8.06532C21.188 10.1286 14.795 15.1295 15.4171 16.2118C16.0391 17.2934 18.2312 14.9402 18.2312 14.9402C18.2312 14.9402 25.0907 8.49588 26.5842 10.1752C28.0776 11.8545 25.4512 13.2616 21.7082 15.6008C17.9646 17.9393 17.6744 18.557 18.2054 19.4418C18.7372 20.3266 26.9998 13.1351 27.7759 16.1838C28.5513 19.2324 19.3434 20.1173 19.9117 22.2219C20.48 24.3274 26.3979 18.2382 27.6082 20.6107C28.8193 22.9839 19.2574 25.7722 19.18 25.7929C16.0914 26.62 8.24723 28.3726 5.50686 24.2246Z" fill="#FFD21E"></path></svg>
|
159 |
+
Community
|
160 |
+
<div class="ml-1.5 flex h-4 min-w-[1rem] items-center justify-center rounded px-1 text-xs leading-none shadow-sm bg-black text-white dark:bg-gray-800 dark:text-gray-200">11
|
161 |
+
</div>
|
162 |
+
|
163 |
+
</a>
|
164 |
+
</div>
|
165 |
+
|
166 |
+
|
167 |
+
|
168 |
+
<div class="hidden sm:block mt-2 lg:mt-0"><div class="relative ">
|
169 |
+
<button class="btn px-1 py-1 text-base translate-y-px " type="button">
|
170 |
+
|
171 |
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="p-0.5" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><circle cx="16" cy="7" r="3" fill="currentColor"></circle><circle cx="16" cy="16" r="3" fill="currentColor"></circle><circle cx="16" cy="25" r="3" fill="currentColor"></circle></svg>
|
172 |
+
|
173 |
+
|
174 |
+
</button>
|
175 |
+
|
176 |
+
|
177 |
+
|
178 |
+
</div></div>
|
179 |
+
</div></div></header>
|
180 |
+
|
181 |
+
|
182 |
+
|
183 |
+
|
184 |
+
|
185 |
+
|
186 |
+
|
187 |
+
|
188 |
+
|
189 |
+
|
190 |
+
|
191 |
+
|
192 |
+
|
193 |
+
|
194 |
+
|
195 |
+
</div>
|
196 |
+
|
197 |
+
<div class="container relative flex flex-col md:grid md:space-y-0 w-full md:grid-cols-12 space-y-4 md:gap-6 mb-16"><section class="pt-8 border-gray-100 col-span-full"><header class="flex flex-wrap items-center justify-start pb-2 md:justify-end lg:flex-nowrap"><div class="mr-4 flex min-w-0 basis-auto flex-wrap items-center md:flex-grow md:basis-full lg:basis-auto lg:flex-nowrap"><div class="SVELTE_HYDRATER contents" data-props="{"path":"packages.txt","repoName":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","repoType":"space","rev":"main","refs":{"branches":[{"name":"main","ref":"refs/heads/main","targetCommit":"626d7ffc7b07ba96290bd80cb09b73993f85bf40"}],"tags":[],"converts":[]},"view":"blob"}" data-target="BranchSelector"><div class="relative mr-4 mb-2">
|
198 |
+
<button class="text-sm md:text-base btn w-full cursor-pointer text-sm" type="button">
|
199 |
+
<svg class="mr-1.5 text-gray-700 dark:text-gray-400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" style="transform: rotate(360deg);"><path d="M13 14c-3.36 0-4.46 1.35-4.82 2.24C9.25 16.7 10 17.76 10 19a3 3 0 0 1-3 3a3 3 0 0 1-3-3c0-1.31.83-2.42 2-2.83V7.83A2.99 2.99 0 0 1 4 5a3 3 0 0 1 3-3a3 3 0 0 1 3 3c0 1.31-.83 2.42-2 2.83v5.29c.88-.65 2.16-1.12 4-1.12c2.67 0 3.56-1.34 3.85-2.23A3.006 3.006 0 0 1 14 7a3 3 0 0 1 3-3a3 3 0 0 1 3 3c0 1.34-.88 2.5-2.09 2.86C17.65 11.29 16.68 14 13 14m-6 4a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1M7 4a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1m10 2a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1z" fill="currentColor"></path></svg>
|
200 |
+
main
|
201 |
+
<svg class="-mr-1 text-gray-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" style="transform: rotate(360deg);"><path d="M7 10l5 5l5-5z" fill="currentColor"></path></svg></button>
|
202 |
+
|
203 |
+
|
204 |
+
|
205 |
+
</div></div>
|
206 |
+
<div class="mb-2 flex items-center overflow-hidden"><a class="truncate text-gray-800 hover:underline" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/tree/main">Image-Animation-using-Thin-Plate-Spline-Motion-Model</a>
|
207 |
+
<span class="mx-1 text-gray-300">/</span>
|
208 |
+
<span class="dark:text-gray-300">packages.txt</span></div></div>
|
209 |
+
|
210 |
+
|
211 |
+
</header>
|
212 |
+
<div class="SVELTE_HYDRATER contents" data-props="{"commitLast":{"date":"2022-06-20T17:29:50.000Z","subject":"Create new file","authors":[{"_id":"605b1a536ce6cabbb3474b5a","avatar":"https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1655583590216-605b1a536ce6cabbb3474b5a.jpeg?w=200&h=200&f=face","isHf":false,"user":"animesh007"}],"commit":{"id":"73b9008f8d04a987e527dde27eb26fd62e2b63d0","parentIds":["452fabb89c69438a23fb71c11f008fb39f6a0e44"]},"title":"Create new file"},"repo":{"name":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","type":"space"}}" data-target="LastCommit"><div class="from-gray-100-to-white flex items-baseline rounded-t-lg border border-b-0 bg-gradient-to-t px-3 py-2 dark:border-gray-800"><img class="mr-2.5 mt-0.5 h-4 w-4 self-center rounded-full" alt="animesh007's picture" src="https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1655583590216-605b1a536ce6cabbb3474b5a.jpeg?w=200&h=200&f=face">
|
213 |
+
<div class="mr-5 flex flex-none items-center truncate"><a class="hover:underline" href="/animesh007">animesh007
|
214 |
+
</a>
|
215 |
+
|
216 |
+
</div>
|
217 |
+
<div class="mr-4 truncate font-mono text-sm text-gray-500 hover:prose-a:underline"><!-- HTML_TAG_START -->Create new file<!-- HTML_TAG_END --></div>
|
218 |
+
<a class="rounded border bg-gray-50 px-1.5 text-sm hover:underline dark:border-gray-800 dark:bg-gray-900" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/commit/73b9008f8d04a987e527dde27eb26fd62e2b63d0">73b9008</a>
|
219 |
+
|
220 |
+
<time class="ml-auto hidden flex-none truncate pl-2 text-gray-500 dark:text-gray-400 lg:block" datetime="2022-06-20T17:29:50" title="Mon, 20 Jun 2022 17:29:50 GMT">over 1 year ago</time></div></div>
|
221 |
+
<div class="flex flex-wrap items-center border px-3 py-1.5 text-sm text-gray-800 dark:border-gray-800 dark:bg-gray-900">
|
222 |
+
<a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/raw/main/packages.txt"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" style="transform: rotate(360deg);"><path d="M31 16l-7 7l-1.41-1.41L28.17 16l-5.58-5.59L24 9l7 7z" fill="currentColor"></path><path d="M1 16l7-7l1.41 1.41L3.83 16l5.58 5.59L8 23l-7-7z" fill="currentColor"></path><path d="M12.419 25.484L17.639 6l1.932.518L14.35 26z" fill="currentColor"></path></svg>
|
223 |
+
raw
|
224 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/commits/main/packages.txt"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" style="transform: rotate(360deg);"><path d="M16 4C9.383 4 4 9.383 4 16s5.383 12 12 12s12-5.383 12-12S22.617 4 16 4zm0 2c5.535 0 10 4.465 10 10s-4.465 10-10 10S6 21.535 6 16S10.465 6 16 6zm-1 2v9h7v-2h-5V8z" fill="currentColor"></path></svg>
|
225 |
+
history
|
226 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/blame/main/packages.txt"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" style="transform: rotate(360deg);"><path d="M16 2a14 14 0 1 0 14 14A14 14 0 0 0 16 2zm0 26a12 12 0 1 1 12-12a12 12 0 0 1-12 12z" fill="currentColor"></path><path d="M11.5 11a2.5 2.5 0 1 0 2.5 2.5a2.48 2.48 0 0 0-2.5-2.5z" fill="currentColor"></path><path d="M20.5 11a2.5 2.5 0 1 0 2.5 2.5a2.48 2.48 0 0 0-2.5-2.5z" fill="currentColor"></path></svg>
|
227 |
+
blame
|
228 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline text-green-600 dark:text-gray-300" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/edit/main/packages.txt"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M2 26h28v2H2z" fill="currentColor"></path><path d="M25.4 9c.8-.8.8-2 0-2.8l-3.6-3.6c-.8-.8-2-.8-2.8 0l-15 15V24h6.4l15-15zm-5-5L24 7.6l-3 3L17.4 7l3-3zM6 22v-3.6l10-10l3.6 3.6l-10 10H6z" fill="currentColor"></path></svg>
|
229 |
+
contribute
|
230 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/delete/main/packages.txt"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M12 12h2v12h-2z" fill="currentColor"></path><path d="M18 12h2v12h-2z" fill="currentColor"></path><path d="M4 6v2h2v20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h2V6zm4 22V8h16v20z" fill="currentColor"></path><path d="M12 2h8v2h-8z" fill="currentColor"></path></svg>
|
231 |
+
delete
|
232 |
+
</a>
|
233 |
+
<div class="mr-4 flex items-center text-gray-400"><svg class="text-gray-300 text-sm mr-1.5 -translate-y-px" width="1em" height="1em" viewBox="0 0 22 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M15.3634 10.3639C15.8486 10.8491 15.8486 11.6357 15.3634 12.1209L10.9292 16.5551C10.6058 16.8785 10.0814 16.8785 9.7579 16.5551L7.03051 13.8277C6.54532 13.3425 6.54532 12.5558 7.03051 12.0707C7.51569 11.5855 8.30234 11.5855 8.78752 12.0707L9.7579 13.041C10.0814 13.3645 10.6058 13.3645 10.9292 13.041L13.6064 10.3639C14.0916 9.8787 14.8782 9.8787 15.3634 10.3639Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M10.6666 27.12C4.93329 25.28 0 19.2267 0 12.7867V6.52001C0 5.40001 0.693334 4.41334 1.73333 4.01334L9.73333 1.01334C10.3333 0.786673 11 0.786673 11.6 1.02667L19.6 4.02667C20.1083 4.21658 20.5465 4.55701 20.8562 5.00252C21.1659 5.44803 21.3324 5.97742 21.3333 6.52001V12.7867C21.3333 19.24 16.4 25.28 10.6666 27.12Z" fill="currentColor" fill-opacity="0.22"></path><path d="M10.0845 1.94967L10.0867 1.94881C10.4587 1.8083 10.8666 1.81036 11.2286 1.95515L11.2387 1.95919L11.2489 1.963L19.2489 4.963L19.25 4.96342C19.5677 5.08211 19.8416 5.29488 20.0351 5.57333C20.2285 5.85151 20.3326 6.18203 20.3333 6.52082C20.3333 6.52113 20.3333 6.52144 20.3333 6.52176L20.3333 12.7867C20.3333 18.6535 15.8922 24.2319 10.6666 26.0652C5.44153 24.2316 1 18.6409 1 12.7867V6.52001C1 5.82357 1.42893 5.20343 2.08883 4.94803L10.0845 1.94967Z" stroke="currentColor" stroke-opacity="0.30" stroke-width="2"></path></svg>
|
234 |
+
|
235 |
+
No virus
|
236 |
+
</div>
|
237 |
+
|
238 |
+
<div class="dark:text-gray-300 sm:ml-auto">23 Bytes</div></div>
|
239 |
+
|
240 |
+
<div class="relative min-h-[100px] rounded-b-lg border border-t-0 leading-tight dark:border-gray-800 dark:bg-gray-925">
|
241 |
+
<div class="py-3"><div class="SVELTE_HYDRATER contents" data-props="{"lines":["bzip2","cmake","ninja-build"],"context":{"repo":{"name":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","type":"space"},"revision":"626d7ffc7b07ba96290bd80cb09b73993f85bf40","path":"packages.txt"}}" data-target="BlobContent">
|
242 |
+
|
243 |
+
<div class="relative text-sm"><div class="overflow-x-auto"><table class="min-w-full border-collapse font-mono"><tbody><tr class="" id="L1">
|
244 |
+
|
245 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="1"></td>
|
246 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->bzip2<!-- HTML_TAG_END --></td>
|
247 |
+
</tr><tr class="" id="L2">
|
248 |
+
|
249 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="2"></td>
|
250 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->cmake<!-- HTML_TAG_END --></td>
|
251 |
+
</tr><tr class="" id="L3">
|
252 |
+
|
253 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="3"></td>
|
254 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->ninja-build<!-- HTML_TAG_END --></td>
|
255 |
+
</tr></tbody></table></div>
|
256 |
+
</div></div></div></div></section></div></main>
|
257 |
+
</div>
|
258 |
+
|
259 |
+
<script>
|
260 |
+
import("/front/build/kube-63b5efc/index.js");
|
261 |
+
window.moonSha = "kube-63b5efc/";
|
262 |
+
window.hubConfig = JSON.parse(`{"features":{"signupDisabled":false},"sshGitUrl":"[email protected]","moonHttpUrl":"https://huggingface.co","captchaApiKey":"bd5f2066-93dc-4bdd-a64b-a24646ca3859","captchaDisabledOnSignup":true,"datasetsServerPublicUrl":"https://datasets-server.huggingface.co","stripePublicKey":"pk_live_x2tdjFXBCvXo2FFmMybezpeM00J6gPCAAc","environment":"production","userAgent":"HuggingFace (production)"}`);
|
263 |
+
</script>
|
264 |
+
|
265 |
+
<!-- Stripe -->
|
266 |
+
<script>
|
267 |
+
if (["hf.co", "huggingface.co"].includes(window.location.hostname)) {
|
268 |
+
const script = document.createElement("script");
|
269 |
+
script.src = "https://js.stripe.com/v3/";
|
270 |
+
script.async = true;
|
271 |
+
document.head.appendChild(script);
|
272 |
+
}
|
273 |
+
</script>
|
274 |
+
|
275 |
+
<!-- Google analytics v4 -->
|
276 |
+
<script>
|
277 |
+
if (["hf.co", "huggingface.co"].includes(window.location.hostname)) {
|
278 |
+
const script = document.createElement("script");
|
279 |
+
script.src = "https://www.googletagmanager.com/gtag/js?id=G-8Q63TH4CSL";
|
280 |
+
script.async = true;
|
281 |
+
document.head.appendChild(script);
|
282 |
+
|
283 |
+
window.dataLayer = window.dataLayer || [];
|
284 |
+
function gtag() {
|
285 |
+
if (window.dataLayer !== undefined) {
|
286 |
+
window.dataLayer.push(arguments);
|
287 |
+
}
|
288 |
+
}
|
289 |
+
gtag("js", new Date());
|
290 |
+
gtag("config", "G-8Q63TH4CSL", { page_path: "/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/blob/main/packages.txt" });
|
291 |
+
/// ^ See https://developers.google.com/analytics/devguides/collection/gtagjs/pages
|
292 |
+
gtag("consent", "default", { ad_storage: "denied", analytics_storage: "denied" });
|
293 |
+
/// ^ See https://developers.google.com/tag-platform/gtagjs/reference#consent
|
294 |
+
/// TODO: ask the user for their consent and update this with gtag('consent', 'update')
|
295 |
+
}
|
296 |
+
</script>
|
297 |
+
</body>
|
298 |
+
</html>
|
requirements.txt
ADDED
@@ -0,0 +1,603 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html class="">
|
3 |
+
<head>
|
4 |
+
<meta charset="utf-8" />
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
|
6 |
+
<meta name="description" content="We’re on a journey to advance and democratize artificial intelligence through open source and open science." />
|
7 |
+
<meta property="fb:app_id" content="1321688464574422" />
|
8 |
+
<meta name="twitter:card" content="summary_large_image" />
|
9 |
+
<meta name="twitter:site" content="@huggingface" />
|
10 |
+
<meta property="og:title" content="requirements.txt · CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model at main" />
|
11 |
+
<meta property="og:type" content="website" />
|
12 |
+
<meta property="og:url" content="https://huggingface.co/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/blob/main/requirements.txt" />
|
13 |
+
<meta property="og:image" content="https://cdn-thumbnails.huggingface.co/social-thumbnails/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model.png" />
|
14 |
+
|
15 |
+
<link rel="stylesheet" href="/front/build/kube-63b5efc/style.css" />
|
16 |
+
|
17 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
18 |
+
<link
|
19 |
+
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900&display=swap"
|
20 |
+
rel="stylesheet"
|
21 |
+
/>
|
22 |
+
<link
|
23 |
+
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&display=swap"
|
24 |
+
rel="stylesheet"
|
25 |
+
/>
|
26 |
+
|
27 |
+
<link
|
28 |
+
rel="preload"
|
29 |
+
href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.css"
|
30 |
+
as="style"
|
31 |
+
onload="this.onload=null;this.rel='stylesheet'"
|
32 |
+
/>
|
33 |
+
<noscript>
|
34 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.css" />
|
35 |
+
</noscript>
|
36 |
+
|
37 |
+
<!-- HEAD_svelte-1oal594_START --><style>.blob-line-num::before {
|
38 |
+
content: attr(data-line-num);
|
39 |
+
}
|
40 |
+
</style><!-- HEAD_svelte-1oal594_END -->
|
41 |
+
|
42 |
+
<title>requirements.txt · CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model at main</title>
|
43 |
+
|
44 |
+
<script defer data-domain="huggingface.co" src="/js/script.js"></script>
|
45 |
+
<script type="text/javascript" src="https://de5282c3ca0c.edge.sdk.awswaf.com/de5282c3ca0c/526cf06acb0d/challenge.js" defer></script>
|
46 |
+
</head>
|
47 |
+
<body class="flex flex-col min-h-screen bg-white dark:bg-gray-950 text-black ViewerBlobPage">
|
48 |
+
<div class="flex min-h-screen flex-col">
|
49 |
+
<div class="SVELTE_HYDRATER contents" data-props="{"classNames":"","isWide":false,"isZh":false}" data-target="MainHeader"><header class="border-b border-gray-100 "><div class="w-full px-4 container flex h-16 items-center"><div class="flex flex-1 items-center"><a class="mr-5 flex flex-none items-center lg:mr-6" href="/"><img alt="Hugging Face's logo" class="w-7 md:mr-2" src="/front/assets/huggingface_logo-noborder.svg">
|
50 |
+
<span class="hidden whitespace-nowrap text-lg font-bold md:block">Hugging Face</span></a>
|
51 |
+
<div class="relative flex-1 lg:max-w-sm mr-2 sm:mr-4 lg:mr-6"><input autocomplete="off" class="w-full dark:bg-gray-950 pl-8 form-input-alt h-9 pr-3 focus:shadow-xl" name="" placeholder="Search models, datasets, users..." spellcheck="false" type="text" value="">
|
52 |
+
<svg class="absolute left-2.5 text-gray-400 top-1/2 transform -translate-y-1/2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M30 28.59L22.45 21A11 11 0 1 0 21 22.45L28.59 30zM5 14a9 9 0 1 1 9 9a9 9 0 0 1-9-9z" fill="currentColor"></path></svg>
|
53 |
+
</div>
|
54 |
+
<div class="flex flex-none items-center justify-center p-0.5 place-self-stretch lg:hidden"><button class="relative z-40 flex h-6 w-8 items-center justify-center" type="button"><svg width="1em" height="1em" viewBox="0 0 10 10" class="text-xl" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" preserveAspectRatio="xMidYMid meet" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.65039 2.9999C1.65039 2.8066 1.80709 2.6499 2.00039 2.6499H8.00039C8.19369 2.6499 8.35039 2.8066 8.35039 2.9999C8.35039 3.1932 8.19369 3.3499 8.00039 3.3499H2.00039C1.80709 3.3499 1.65039 3.1932 1.65039 2.9999ZM1.65039 4.9999C1.65039 4.8066 1.80709 4.6499 2.00039 4.6499H8.00039C8.19369 4.6499 8.35039 4.8066 8.35039 4.9999C8.35039 5.1932 8.19369 5.3499 8.00039 5.3499H2.00039C1.80709 5.3499 1.65039 5.1932 1.65039 4.9999ZM2.00039 6.6499C1.80709 6.6499 1.65039 6.8066 1.65039 6.9999C1.65039 7.1932 1.80709 7.3499 2.00039 7.3499H8.00039C8.19369 7.3499 8.35039 7.1932 8.35039 6.9999C8.35039 6.8066 8.19369 6.6499 8.00039 6.6499H2.00039Z"></path></svg>
|
55 |
+
</button>
|
56 |
+
|
57 |
+
</div></div>
|
58 |
+
<nav aria-label="Main" class="ml-auto hidden lg:block"><ul class="flex items-center space-x-2"><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-indigo-700" href="/models"><svg class="mr-1.5 text-gray-400 group-hover:text-indigo-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-quaternary" d="M20.23 7.24L12 12L3.77 7.24a1.98 1.98 0 0 1 .7-.71L11 2.76c.62-.35 1.38-.35 2 0l6.53 3.77c.29.173.531.418.7.71z" opacity=".25" fill="currentColor"></path><path class="uim-tertiary" d="M12 12v9.5a2.09 2.09 0 0 1-.91-.21L4.5 17.48a2.003 2.003 0 0 1-1-1.73v-7.5a2.06 2.06 0 0 1 .27-1.01L12 12z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M20.5 8.25v7.5a2.003 2.003 0 0 1-1 1.73l-6.62 3.82c-.275.13-.576.198-.88.2V12l8.23-4.76c.175.308.268.656.27 1.01z" fill="currentColor"></path></svg>
|
59 |
+
Models</a>
|
60 |
+
</li><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-red-700" href="/datasets"><svg class="mr-1.5 text-gray-400 group-hover:text-red-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 25 25"><ellipse cx="12.5" cy="5" fill="currentColor" fill-opacity="0.25" rx="7.5" ry="2"></ellipse><path d="M12.5 15C16.6421 15 20 14.1046 20 13V20C20 21.1046 16.6421 22 12.5 22C8.35786 22 5 21.1046 5 20V13C5 14.1046 8.35786 15 12.5 15Z" fill="currentColor" opacity="0.5"></path><path d="M12.5 7C16.6421 7 20 6.10457 20 5V11.5C20 12.6046 16.6421 13.5 12.5 13.5C8.35786 13.5 5 12.6046 5 11.5V5C5 6.10457 8.35786 7 12.5 7Z" fill="currentColor" opacity="0.5"></path><path d="M5.23628 12C5.08204 12.1598 5 12.8273 5 13C5 14.1046 8.35786 15 12.5 15C16.6421 15 20 14.1046 20 13C20 12.8273 19.918 12.1598 19.7637 12C18.9311 12.8626 15.9947 13.5 12.5 13.5C9.0053 13.5 6.06886 12.8626 5.23628 12Z" fill="currentColor"></path></svg>
|
61 |
+
Datasets</a>
|
62 |
+
</li><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-blue-700" href="/spaces"><svg class="mr-1.5 text-gray-400 group-hover:text-blue-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" viewBox="0 0 25 25"><path opacity=".5" d="M6.016 14.674v4.31h4.31v-4.31h-4.31ZM14.674 14.674v4.31h4.31v-4.31h-4.31ZM6.016 6.016v4.31h4.31v-4.31h-4.31Z" fill="currentColor"></path><path opacity=".75" fill-rule="evenodd" clip-rule="evenodd" d="M3 4.914C3 3.857 3.857 3 4.914 3h6.514c.884 0 1.628.6 1.848 1.414a5.171 5.171 0 0 1 7.31 7.31c.815.22 1.414.964 1.414 1.848v6.514A1.914 1.914 0 0 1 20.086 22H4.914A1.914 1.914 0 0 1 3 20.086V4.914Zm3.016 1.102v4.31h4.31v-4.31h-4.31Zm0 12.968v-4.31h4.31v4.31h-4.31Zm8.658 0v-4.31h4.31v4.31h-4.31Zm0-10.813a2.155 2.155 0 1 1 4.31 0 2.155 2.155 0 0 1-4.31 0Z" fill="currentColor"></path><path opacity=".25" d="M16.829 6.016a2.155 2.155 0 1 0 0 4.31 2.155 2.155 0 0 0 0-4.31Z" fill="currentColor"></path></svg>
|
63 |
+
Spaces</a>
|
64 |
+
</li><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-yellow-700" href="/docs"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="mr-1.5 text-gray-400 group-hover:text-yellow-500" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path opacity="0.5" d="M20.9022 5.10334L10.8012 10.8791L7.76318 9.11193C8.07741 8.56791 8.5256 8.11332 9.06512 7.7914L15.9336 3.73907C17.0868 3.08811 18.5002 3.26422 19.6534 3.91519L19.3859 3.73911C19.9253 4.06087 20.5879 4.56025 20.9022 5.10334Z" fill="currentColor"></path><path d="M10.7999 10.8792V28.5483C10.2136 28.5475 9.63494 28.4139 9.10745 28.1578C8.5429 27.8312 8.074 27.3621 7.74761 26.7975C7.42122 26.2327 7.24878 25.5923 7.24756 24.9402V10.9908C7.25062 10.3319 7.42358 9.68487 7.74973 9.1123L10.7999 10.8792Z" fill="currentColor" fill-opacity="0.75"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M21.3368 10.8499V6.918C21.3331 6.25959 21.16 5.61234 20.8346 5.03949L10.7971 10.8727L10.8046 10.874L21.3368 10.8499Z" fill="currentColor"></path><path opacity="0.5" d="M21.7937 10.8488L10.7825 10.8741V28.5486L21.7937 28.5234C23.3344 28.5234 24.5835 27.2743 24.5835 25.7335V13.6387C24.5835 12.0979 23.4365 11.1233 21.7937 10.8488Z" fill="currentColor"></path></svg>
|
65 |
+
Docs</a>
|
66 |
+
</li>
|
67 |
+
<li><div class="relative ">
|
68 |
+
<button class="px-2 py-0.5 group hover:text-green-700 dark:hover:text-gray-400 flex items-center " type="button">
|
69 |
+
<svg class="mr-1.5 text-gray-400 group-hover:text-green-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-tertiary" d="M19 6H5a3 3 0 0 0-3 3v2.72L8.837 14h6.326L22 11.72V9a3 3 0 0 0-3-3z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M10 6V5h4v1h2V5a2.002 2.002 0 0 0-2-2h-4a2.002 2.002 0 0 0-2 2v1h2zm-1.163 8L2 11.72V18a3.003 3.003 0 0 0 3 3h14a3.003 3.003 0 0 0 3-3v-6.28L15.163 14H8.837z" fill="currentColor"></path></svg>
|
70 |
+
Solutions
|
71 |
+
</button>
|
72 |
+
|
73 |
+
|
74 |
+
|
75 |
+
</div></li>
|
76 |
+
<li><a class="group flex items-center px-2 py-0.5 hover:text-gray-500 dark:hover:text-gray-400" href="/pricing">Pricing
|
77 |
+
</a></li>
|
78 |
+
|
79 |
+
<li><div class="relative group">
|
80 |
+
<button class="px-2 py-0.5 hover:text-gray-500 dark:hover:text-gray-600 flex items-center " type="button">
|
81 |
+
<svg class="mr-1.5 text-gray-500 w-5 group-hover:text-gray-400 dark:text-gray-300 dark:group-hover:text-gray-400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" viewBox="0 0 32 18" preserveAspectRatio="xMidYMid meet"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4504 3.30221C14.4504 2.836 14.8284 2.45807 15.2946 2.45807H28.4933C28.9595 2.45807 29.3374 2.836 29.3374 3.30221C29.3374 3.76842 28.9595 4.14635 28.4933 4.14635H15.2946C14.8284 4.14635 14.4504 3.76842 14.4504 3.30221Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4504 9.00002C14.4504 8.53382 14.8284 8.15588 15.2946 8.15588H28.4933C28.9595 8.15588 29.3374 8.53382 29.3374 9.00002C29.3374 9.46623 28.9595 9.84417 28.4933 9.84417H15.2946C14.8284 9.84417 14.4504 9.46623 14.4504 9.00002Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4504 14.6978C14.4504 14.2316 14.8284 13.8537 15.2946 13.8537H28.4933C28.9595 13.8537 29.3374 14.2316 29.3374 14.6978C29.3374 15.164 28.9595 15.542 28.4933 15.542H15.2946C14.8284 15.542 14.4504 15.164 14.4504 14.6978Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M1.94549 6.87377C2.27514 6.54411 2.80962 6.54411 3.13928 6.87377L6.23458 9.96907L9.32988 6.87377C9.65954 6.54411 10.194 6.54411 10.5237 6.87377C10.8533 7.20343 10.8533 7.73791 10.5237 8.06756L6.23458 12.3567L1.94549 8.06756C1.61583 7.73791 1.61583 7.20343 1.94549 6.87377Z" fill="currentColor"></path></svg>
|
82 |
+
|
83 |
+
</button>
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
</div></li>
|
88 |
+
<li><hr class="h-5 w-0.5 border-none bg-gray-100 dark:bg-gray-800"></li>
|
89 |
+
<li><a class="block cursor-pointer px-2 py-0.5 hover:text-gray-500 dark:hover:text-gray-400" href="/login">Log In
|
90 |
+
</a></li>
|
91 |
+
<li><a class="rounded-full border border-transparent bg-gray-900 px-3 py-1 leading-none text-white hover:border-black hover:bg-white hover:text-black" href="/join">Sign Up
|
92 |
+
</a></li></ul></nav></div></header></div>
|
93 |
+
|
94 |
+
<div class="SVELTE_HYDRATER contents" data-props="{}" data-target="GoogleAnalyticsTracker"></div>
|
95 |
+
|
96 |
+
|
97 |
+
<div class="SVELTE_HYDRATER contents" data-props="{}" data-target="SSOBanner"></div>
|
98 |
+
|
99 |
+
<main class="flex flex-1 flex-col"><div class="SVELTE_HYDRATER contents" data-props="{"activeTab":"files","author":{"avatarUrl":"https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1642793296366-61e1188afc27c0f5e3641eb3.jpeg?w=200&h=200&f=face","fullname":"CVPR Demo Track","name":"CVPR","type":"org","isHf":false},"canReadRepoSettings":false,"canDisable":false,"discussionsStats":{"closed":5,"open":6,"total":11},"query":{},"space":{"author":"CVPR","colorFrom":"indigo","colorTo":"indigo","cardData":{"title":"Image Animation Using Thin Plate Spline Motion Model","emoji":"👁","colorFrom":"indigo","colorTo":"indigo","sdk":"gradio","sdk_version":"3.48.0","app_file":"app.py","pinned":false},"emoji":"👁","discussionsDisabled":false,"duplicationDisabled":false,"id":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","isLikedByUser":false,"isWatchedByUser":false,"lastModified":"2023-10-25T19:06:23.000Z","likes":510,"pinned":false,"private":false,"gated":false,"repoType":"space","subdomain":"cvpr-image-animation-using-thin-plate-spline-mot-e234846","sdk":"gradio","sdkVersion":"3.48.0","title":"Image Animation Using Thin Plate Spline Motion Model","runtime":{"stage":"RUNNING","hardware":{"current":"cpu-basic","requested":"cpu-basic"},"storage":null,"gcTimeout":null,"replicas":{"current":1,"requested":1}},"iframe":{"host":"https://cvpr-image-animation-using-thin-plate-spline-mot-e234846.hf.space","src":"https://cvpr-image-animation-using-thin-plate-spline-mot-e234846.hf.space"},"secrets":[],"variables":[],"sse":{"url":"https://api.hf.space/v1/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","jwt":"eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJpYXQiOjE2OTk2NzcwMzAsInN1YiI6Ii9zcGFjZXMvQ1ZQUi9JbWFnZS1BbmltYXRpb24tdXNpbmctVGhpbi1QbGF0ZS1TcGxpbmUtTW90aW9uLU1vZGVsIiwiZXhwIjoxNjk5NzYzNDMwLCJpc3MiOiJodHRwczovL2h1Z2dpbmdmYWNlLmNvIn0.nxRNmb5j7C9N6s39Ow6bcPYKPrle53adrYtTYgkReMoFC580D_PHupK1_SdPxZ1VSlE5WJ7FCIo6LU-NKfTFBQ"},"linkedModels":[],"linkedDatasets":[],"linkedCollections":[]}}" data-target="SpaceHeader"><header class="from-gray-50-to-white border-b border-gray-100 bg-gradient-to-t via-white dark:via-gray-950 pt-4 xl:pt-0"><div class="container relative flex flex-col xl:flex-row"><h1 class="flex flex-wrap items-center leading-tight gap-y-1 text-lg xl:flex-none"><a href="/spaces" class="group flex items-center"><svg class="mr-1 text-gray-400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M7.80914 18.7462V24.1907H13.2536V18.7462H7.80914Z" fill="#FF3270"></path><path d="M18.7458 18.7462V24.1907H24.1903V18.7462H18.7458Z" fill="#861FFF"></path><path d="M7.80914 7.80982V13.2543H13.2536V7.80982H7.80914Z" fill="#097EFF"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.41775C4 5.08246 5.08246 4 6.41775 4H14.6457C15.7626 4 16.7026 4.75724 16.9802 5.78629C18.1505 4.67902 19.7302 4 21.4685 4C25.0758 4 28.0003 6.92436 28.0003 10.5317C28.0003 12.27 27.3212 13.8497 26.2139 15.02C27.243 15.2977 28.0003 16.2376 28.0003 17.3545V25.5824C28.0003 26.9177 26.9177 28.0003 25.5824 28.0003H17.0635H14.9367H6.41775C5.08246 28.0003 4 26.9177 4 25.5824V15.1587V14.9367V6.41775ZM7.80952 7.80952V13.254H13.254V7.80952H7.80952ZM7.80952 24.1907V18.7462H13.254V24.1907H7.80952ZM18.7462 24.1907V18.7462H24.1907V24.1907H18.7462ZM18.7462 10.5317C18.7462 9.0283 19.9651 7.80952 21.4685 7.80952C22.9719 7.80952 24.1907 9.0283 24.1907 10.5317C24.1907 12.0352 22.9719 13.254 21.4685 13.254C19.9651 13.254 18.7462 12.0352 18.7462 10.5317Z" fill="black"></path><path d="M21.4681 7.80982C19.9647 7.80982 18.7458 9.02861 18.7458 10.5321C18.7458 12.0355 19.9647 13.2543 21.4681 13.2543C22.9715 13.2543 24.1903 12.0355 24.1903 10.5321C24.1903 9.02861 22.9715 7.80982 21.4681 7.80982Z" fill="#FFD702"></path></svg>
|
100 |
+
<span class="mr-2.5 font-semibold text-gray-400 group-hover:text-gray-500">Spaces:</span></a>
|
101 |
+
<div class="group flex flex-none items-center"><div class="relative mr-1.5 flex items-center">
|
102 |
+
|
103 |
+
<img alt="" class="w-3.5 h-3.5 rounded " src="https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1642793296366-61e1188afc27c0f5e3641eb3.jpeg?w=200&h=200&f=face" crossorigin="anonymous"></div>
|
104 |
+
<a href="/CVPR" class="text-gray-400 hover:text-blue-600">CVPR</a>
|
105 |
+
<div class="mx-0.5 text-gray-300">/</div></div>
|
106 |
+
|
107 |
+
<div class="max-w-full xl:flex xl:min-w-0 xl:flex-nowrap xl:items-center xl:gap-x-1"><a class="break-words font-mono font-semibold hover:text-blue-600 text-[1.07rem] xl:truncate" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model">Image-Animation-using-Thin-Plate-Spline-Motion-Model</a>
|
108 |
+
<button class="relative text-xs mr-3 inline-flex cursor-pointer items-center text-sm focus:outline-none mx-0.5 text-gray-600 " title="Copy space name to clipboard" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg>
|
109 |
+
|
110 |
+
</button></div>
|
111 |
+
<div class="inline-flex items-center overflow-hidden whitespace-nowrap rounded-md border bg-white text-sm leading-none text-gray-500 mr-2"><button class="relative flex items-center px-1.5 py-1 hover:bg-gradient-to-t focus:outline-none overflow-hidden from-red-50 to-transparent dark:from-red-900 dark:to-red-800" title="Like"><svg class="left-1.5 absolute" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" fill="currentColor"><path d="M22.45,6a5.47,5.47,0,0,1,3.91,1.64,5.7,5.7,0,0,1,0,8L16,26.13,5.64,15.64a5.7,5.7,0,0,1,0-8,5.48,5.48,0,0,1,7.82,0L16,10.24l2.53-2.58A5.44,5.44,0,0,1,22.45,6m0-2a7.47,7.47,0,0,0-5.34,2.24L16,7.36,14.89,6.24a7.49,7.49,0,0,0-10.68,0,7.72,7.72,0,0,0,0,10.82L16,29,27.79,17.06a7.72,7.72,0,0,0,0-10.82A7.49,7.49,0,0,0,22.45,4Z"></path></svg>
|
112 |
+
|
113 |
+
|
114 |
+
<span class="ml-4 pl-0.5">like</span></button>
|
115 |
+
<button class="flex items-center border-l px-1.5 py-1 text-gray-400 hover:bg-gray-50 focus:bg-gray-100 focus:outline-none dark:hover:bg-gray-900 dark:focus:bg-gray-800" title="See users who liked this repository">510</button></div>
|
116 |
+
|
117 |
+
|
118 |
+
|
119 |
+
|
120 |
+
|
121 |
+
|
122 |
+
|
123 |
+
|
124 |
+
|
125 |
+
<div class="inline-flex select-none items-center overflow-hidden font-mono text-xs flex-shrink-0 mr-2 rounded-lg border px-2 py-[0.32rem] leading-none dark:bg-gray-900
|
126 |
+
bg-green-50
|
127 |
+
border-green-100
|
128 |
+
text-green-700 dark:text-green-500">
|
129 |
+
<div class="ml-0.5 mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"></div>
|
130 |
+
Running
|
131 |
+
</div>
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
+
|
136 |
+
<div class="sm:hidden"><div class="relative ">
|
137 |
+
<button class="btn px-1 py-1 text-sm translate-y-0 " type="button">
|
138 |
+
|
139 |
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="p-px" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><circle cx="16" cy="7" r="3" fill="currentColor"></circle><circle cx="16" cy="16" r="3" fill="currentColor"></circle><circle cx="16" cy="25" r="3" fill="currentColor"></circle></svg>
|
140 |
+
|
141 |
+
|
142 |
+
</button>
|
143 |
+
|
144 |
+
|
145 |
+
|
146 |
+
</div></div></h1>
|
147 |
+
|
148 |
+
|
149 |
+
<div class="flex flex-col-reverse gap-x-2 sm:flex-row sm:items-center sm:justify-between xl:ml-auto"><div class="-mb-px flex h-12 items-center overflow-x-auto overflow-y-hidden sm:h-[3.25rem]"><a class="tab-alternate " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model"><svg class="mr-1.5 text-gray-400 flex-none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-quaternary" d="M20.23 7.24L12 12L3.77 7.24a1.98 1.98 0 0 1 .7-.71L11 2.76c.62-.35 1.38-.35 2 0l6.53 3.77c.29.173.531.418.7.71z" opacity=".25" fill="currentColor"></path><path class="uim-tertiary" d="M12 12v9.5a2.09 2.09 0 0 1-.91-.21L4.5 17.48a2.003 2.003 0 0 1-1-1.73v-7.5a2.06 2.06 0 0 1 .27-1.01L12 12z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M20.5 8.25v7.5a2.003 2.003 0 0 1-1 1.73l-6.62 3.82c-.275.13-.576.198-.88.2V12l8.23-4.76c.175.308.268.656.27 1.01z" fill="currentColor"></path></svg>
|
150 |
+
App
|
151 |
+
|
152 |
+
|
153 |
+
</a><a class="tab-alternate active" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/tree/main"><svg class="mr-1.5 text-gray-400 flex-none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-tertiary" d="M21 19h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2zm0-4h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2zm0-8h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2zm0 4h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M9 19a1 1 0 0 1-1-1V6a1 1 0 0 1 2 0v12a1 1 0 0 1-1 1zm-6-4.333a1 1 0 0 1-.64-1.769L3.438 12l-1.078-.898a1 1 0 0 1 1.28-1.538l2 1.667a1 1 0 0 1 0 1.538l-2 1.667a.999.999 0 0 1-.64.231z" fill="currentColor"></path></svg>
|
154 |
+
<span class="xl:hidden">Files</span>
|
155 |
+
<span class="hidden xl:inline">Files</span>
|
156 |
+
|
157 |
+
|
158 |
+
</a><a class="tab-alternate " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/discussions"><svg class="mr-1.5 text-gray-400 flex-none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M20.6081 3C21.7684 3 22.8053 3.49196 23.5284 4.38415C23.9756 4.93678 24.4428 5.82749 24.4808 7.16133C24.9674 7.01707 25.4353 6.93643 25.8725 6.93643C26.9833 6.93643 27.9865 7.37587 28.696 8.17411C29.6075 9.19872 30.0124 10.4579 29.8361 11.7177C29.7523 12.3177 29.5581 12.8555 29.2678 13.3534C29.8798 13.8646 30.3306 14.5763 30.5485 15.4322C30.719 16.1032 30.8939 17.5006 29.9808 18.9403C30.0389 19.0342 30.0934 19.1319 30.1442 19.2318C30.6932 20.3074 30.7283 21.5229 30.2439 22.6548C29.5093 24.3704 27.6841 25.7219 24.1397 27.1727C21.9347 28.0753 19.9174 28.6523 19.8994 28.6575C16.9842 29.4379 14.3477 29.8345 12.0653 29.8345C7.87017 29.8345 4.8668 28.508 3.13831 25.8921C0.356375 21.6797 0.754104 17.8269 4.35369 14.1131C6.34591 12.058 7.67023 9.02782 7.94613 8.36275C8.50224 6.39343 9.97271 4.20438 12.4172 4.20438H12.4179C12.6236 4.20438 12.8314 4.2214 13.0364 4.25468C14.107 4.42854 15.0428 5.06476 15.7115 6.02205C16.4331 5.09583 17.134 4.359 17.7682 3.94323C18.7242 3.31737 19.6794 3 20.6081 3ZM20.6081 5.95917C20.2427 5.95917 19.7963 6.1197 19.3039 6.44225C17.7754 7.44319 14.8258 12.6772 13.7458 14.7131C13.3839 15.3952 12.7655 15.6837 12.2086 15.6837C11.1036 15.6837 10.2408 14.5497 12.1076 13.1085C14.9146 10.9402 13.9299 7.39584 12.5898 7.1776C12.5311 7.16799 12.4731 7.16355 12.4172 7.16355C11.1989 7.16355 10.6615 9.33114 10.6615 9.33114C10.6615 9.33114 9.0863 13.4148 6.38031 16.206C3.67434 18.998 3.5346 21.2388 5.50675 24.2246C6.85185 26.2606 9.42666 26.8753 12.0653 26.8753C14.8021 26.8753 17.6077 26.2139 19.1799 25.793C19.2574 25.7723 28.8193 22.984 27.6081 20.6107C27.4046 20.212 27.0693 20.0522 26.6471 20.0522C24.9416 20.0522 21.8393 22.6726 20.5057 22.6726C20.2076 22.6726 19.9976 22.5416 19.9116 22.222C19.3433 20.1173 28.552 19.2325 27.7758 16.1839C27.639 15.6445 27.2677 15.4256 26.746 15.4263C24.4923 15.4263 19.4358 19.5181 18.3759 19.5181C18.2949 19.5181 18.2368 19.4937 18.2053 19.4419C17.6743 18.557 17.9653 17.9394 21.7082 15.6009C25.4511 13.2617 28.0783 11.8545 26.5841 10.1752C26.4121 9.98141 26.1684 9.8956 25.8725 9.8956C23.6001 9.89634 18.2311 14.9403 18.2311 14.9403C18.2311 14.9403 16.7821 16.496 15.9057 16.496C15.7043 16.496 15.533 16.4139 15.4169 16.2112C14.7956 15.1296 21.1879 10.1286 21.5484 8.06535C21.7928 6.66715 21.3771 5.95917 20.6081 5.95917Z" fill="#FF9D00"></path><path d="M5.50686 24.2246C3.53472 21.2387 3.67446 18.9979 6.38043 16.206C9.08641 13.4147 10.6615 9.33111 10.6615 9.33111C10.6615 9.33111 11.2499 6.95933 12.59 7.17757C13.93 7.39581 14.9139 10.9401 12.1069 13.1084C9.29997 15.276 12.6659 16.7489 13.7459 14.713C14.8258 12.6772 17.7747 7.44316 19.304 6.44221C20.8326 5.44128 21.9089 6.00204 21.5484 8.06532C21.188 10.1286 14.795 15.1295 15.4171 16.2118C16.0391 17.2934 18.2312 14.9402 18.2312 14.9402C18.2312 14.9402 25.0907 8.49588 26.5842 10.1752C28.0776 11.8545 25.4512 13.2616 21.7082 15.6008C17.9646 17.9393 17.6744 18.557 18.2054 19.4418C18.7372 20.3266 26.9998 13.1351 27.7759 16.1838C28.5513 19.2324 19.3434 20.1173 19.9117 22.2219C20.48 24.3274 26.3979 18.2382 27.6082 20.6107C28.8193 22.9839 19.2574 25.7722 19.18 25.7929C16.0914 26.62 8.24723 28.3726 5.50686 24.2246Z" fill="#FFD21E"></path></svg>
|
159 |
+
Community
|
160 |
+
<div class="ml-1.5 flex h-4 min-w-[1rem] items-center justify-center rounded px-1 text-xs leading-none shadow-sm bg-black text-white dark:bg-gray-800 dark:text-gray-200">11
|
161 |
+
</div>
|
162 |
+
|
163 |
+
</a>
|
164 |
+
</div>
|
165 |
+
|
166 |
+
|
167 |
+
|
168 |
+
<div class="hidden sm:block mt-2 lg:mt-0"><div class="relative ">
|
169 |
+
<button class="btn px-1 py-1 text-base translate-y-px " type="button">
|
170 |
+
|
171 |
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="p-0.5" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><circle cx="16" cy="7" r="3" fill="currentColor"></circle><circle cx="16" cy="16" r="3" fill="currentColor"></circle><circle cx="16" cy="25" r="3" fill="currentColor"></circle></svg>
|
172 |
+
|
173 |
+
|
174 |
+
</button>
|
175 |
+
|
176 |
+
|
177 |
+
|
178 |
+
</div></div>
|
179 |
+
</div></div></header>
|
180 |
+
|
181 |
+
|
182 |
+
|
183 |
+
|
184 |
+
|
185 |
+
|
186 |
+
|
187 |
+
|
188 |
+
|
189 |
+
|
190 |
+
|
191 |
+
|
192 |
+
|
193 |
+
|
194 |
+
|
195 |
+
</div>
|
196 |
+
|
197 |
+
<div class="container relative flex flex-col md:grid md:space-y-0 w-full md:grid-cols-12 space-y-4 md:gap-6 mb-16"><section class="pt-8 border-gray-100 col-span-full"><header class="flex flex-wrap items-center justify-start pb-2 md:justify-end lg:flex-nowrap"><div class="mr-4 flex min-w-0 basis-auto flex-wrap items-center md:flex-grow md:basis-full lg:basis-auto lg:flex-nowrap"><div class="SVELTE_HYDRATER contents" data-props="{"path":"requirements.txt","repoName":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","repoType":"space","rev":"main","refs":{"branches":[{"name":"main","ref":"refs/heads/main","targetCommit":"626d7ffc7b07ba96290bd80cb09b73993f85bf40"}],"tags":[],"converts":[]},"view":"blob"}" data-target="BranchSelector"><div class="relative mr-4 mb-2">
|
198 |
+
<button class="text-sm md:text-base btn w-full cursor-pointer text-sm" type="button">
|
199 |
+
<svg class="mr-1.5 text-gray-700 dark:text-gray-400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" style="transform: rotate(360deg);"><path d="M13 14c-3.36 0-4.46 1.35-4.82 2.24C9.25 16.7 10 17.76 10 19a3 3 0 0 1-3 3a3 3 0 0 1-3-3c0-1.31.83-2.42 2-2.83V7.83A2.99 2.99 0 0 1 4 5a3 3 0 0 1 3-3a3 3 0 0 1 3 3c0 1.31-.83 2.42-2 2.83v5.29c.88-.65 2.16-1.12 4-1.12c2.67 0 3.56-1.34 3.85-2.23A3.006 3.006 0 0 1 14 7a3 3 0 0 1 3-3a3 3 0 0 1 3 3c0 1.34-.88 2.5-2.09 2.86C17.65 11.29 16.68 14 13 14m-6 4a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1M7 4a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1m10 2a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1z" fill="currentColor"></path></svg>
|
200 |
+
main
|
201 |
+
<svg class="-mr-1 text-gray-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" style="transform: rotate(360deg);"><path d="M7 10l5 5l5-5z" fill="currentColor"></path></svg></button>
|
202 |
+
|
203 |
+
|
204 |
+
|
205 |
+
</div></div>
|
206 |
+
<div class="mb-2 flex items-center overflow-hidden"><a class="truncate text-gray-800 hover:underline" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/tree/main">Image-Animation-using-Thin-Plate-Spline-Motion-Model</a>
|
207 |
+
<span class="mx-1 text-gray-300">/</span>
|
208 |
+
<span class="dark:text-gray-300">requirements.txt</span></div></div>
|
209 |
+
|
210 |
+
|
211 |
+
</header>
|
212 |
+
<div class="SVELTE_HYDRATER contents" data-props="{"commitLast":{"date":"2023-10-25T19:06:23.000Z","subject":"Fix dependency issues and add some updates (#10)","authors":[{"_id":"605b1a536ce6cabbb3474b5a","avatar":"https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1655583590216-605b1a536ce6cabbb3474b5a.jpeg?w=200&h=200&f=face","isHf":false,"user":"animesh007"}],"commit":{"id":"626d7ffc7b07ba96290bd80cb09b73993f85bf40","parentIds":["6614b1ace6e25e6d94942514c1e9b6e9d3942f46"]},"title":"Fix dependency issues and add some updates (<a href=\"/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/discussions/10\">#10</a>)"},"repo":{"name":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","type":"space"}}" data-target="LastCommit"><div class="from-gray-100-to-white flex items-baseline rounded-t-lg border border-b-0 bg-gradient-to-t px-3 py-2 dark:border-gray-800"><img class="mr-2.5 mt-0.5 h-4 w-4 self-center rounded-full" alt="animesh007's picture" src="https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1655583590216-605b1a536ce6cabbb3474b5a.jpeg?w=200&h=200&f=face">
|
213 |
+
<div class="mr-5 flex flex-none items-center truncate"><a class="hover:underline" href="/animesh007">animesh007
|
214 |
+
</a>
|
215 |
+
|
216 |
+
</div>
|
217 |
+
<div class="mr-4 truncate font-mono text-sm text-gray-500 hover:prose-a:underline"><!-- HTML_TAG_START -->Fix dependency issues and add some updates (<a href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/discussions/10">#10</a>)<!-- HTML_TAG_END --></div>
|
218 |
+
<a class="rounded border bg-gray-50 px-1.5 text-sm hover:underline dark:border-gray-800 dark:bg-gray-900" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/commit/626d7ffc7b07ba96290bd80cb09b73993f85bf40">626d7ff</a>
|
219 |
+
|
220 |
+
<time class="ml-auto hidden flex-none truncate pl-2 text-gray-500 dark:text-gray-400 lg:block" datetime="2023-10-25T19:06:23" title="Wed, 25 Oct 2023 19:06:23 GMT">16 days ago</time></div></div>
|
221 |
+
<div class="flex flex-wrap items-center border px-3 py-1.5 text-sm text-gray-800 dark:border-gray-800 dark:bg-gray-900">
|
222 |
+
<a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/raw/main/requirements.txt"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" style="transform: rotate(360deg);"><path d="M31 16l-7 7l-1.41-1.41L28.17 16l-5.58-5.59L24 9l7 7z" fill="currentColor"></path><path d="M1 16l7-7l1.41 1.41L3.83 16l5.58 5.59L8 23l-7-7z" fill="currentColor"></path><path d="M12.419 25.484L17.639 6l1.932.518L14.35 26z" fill="currentColor"></path></svg>
|
223 |
+
raw
|
224 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/commits/main/requirements.txt"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" style="transform: rotate(360deg);"><path d="M16 4C9.383 4 4 9.383 4 16s5.383 12 12 12s12-5.383 12-12S22.617 4 16 4zm0 2c5.535 0 10 4.465 10 10s-4.465 10-10 10S6 21.535 6 16S10.465 6 16 6zm-1 2v9h7v-2h-5V8z" fill="currentColor"></path></svg>
|
225 |
+
history
|
226 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/blame/main/requirements.txt"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" style="transform: rotate(360deg);"><path d="M16 2a14 14 0 1 0 14 14A14 14 0 0 0 16 2zm0 26a12 12 0 1 1 12-12a12 12 0 0 1-12 12z" fill="currentColor"></path><path d="M11.5 11a2.5 2.5 0 1 0 2.5 2.5a2.48 2.48 0 0 0-2.5-2.5z" fill="currentColor"></path><path d="M20.5 11a2.5 2.5 0 1 0 2.5 2.5a2.48 2.48 0 0 0-2.5-2.5z" fill="currentColor"></path></svg>
|
227 |
+
blame
|
228 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline text-green-600 dark:text-gray-300" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/edit/main/requirements.txt"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M2 26h28v2H2z" fill="currentColor"></path><path d="M25.4 9c.8-.8.8-2 0-2.8l-3.6-3.6c-.8-.8-2-.8-2.8 0l-15 15V24h6.4l15-15zm-5-5L24 7.6l-3 3L17.4 7l3-3zM6 22v-3.6l10-10l3.6 3.6l-10 10H6z" fill="currentColor"></path></svg>
|
229 |
+
contribute
|
230 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/delete/main/requirements.txt"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M12 12h2v12h-2z" fill="currentColor"></path><path d="M18 12h2v12h-2z" fill="currentColor"></path><path d="M4 6v2h2v20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h2V6zm4 22V8h16v20z" fill="currentColor"></path><path d="M12 2h8v2h-8z" fill="currentColor"></path></svg>
|
231 |
+
delete
|
232 |
+
</a>
|
233 |
+
<div class="mr-4 flex items-center text-gray-400"><svg class="text-gray-300 text-sm mr-1.5 -translate-y-px" width="1em" height="1em" viewBox="0 0 22 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M15.3634 10.3639C15.8486 10.8491 15.8486 11.6357 15.3634 12.1209L10.9292 16.5551C10.6058 16.8785 10.0814 16.8785 9.7579 16.5551L7.03051 13.8277C6.54532 13.3425 6.54532 12.5558 7.03051 12.0707C7.51569 11.5855 8.30234 11.5855 8.78752 12.0707L9.7579 13.041C10.0814 13.3645 10.6058 13.3645 10.9292 13.041L13.6064 10.3639C14.0916 9.8787 14.8782 9.8787 15.3634 10.3639Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M10.6666 27.12C4.93329 25.28 0 19.2267 0 12.7867V6.52001C0 5.40001 0.693334 4.41334 1.73333 4.01334L9.73333 1.01334C10.3333 0.786673 11 0.786673 11.6 1.02667L19.6 4.02667C20.1083 4.21658 20.5465 4.55701 20.8562 5.00252C21.1659 5.44803 21.3324 5.97742 21.3333 6.52001V12.7867C21.3333 19.24 16.4 25.28 10.6666 27.12Z" fill="currentColor" fill-opacity="0.22"></path><path d="M10.0845 1.94967L10.0867 1.94881C10.4587 1.8083 10.8666 1.81036 11.2286 1.95515L11.2387 1.95919L11.2489 1.963L19.2489 4.963L19.25 4.96342C19.5677 5.08211 19.8416 5.29488 20.0351 5.57333C20.2285 5.85151 20.3326 6.18203 20.3333 6.52082C20.3333 6.52113 20.3333 6.52144 20.3333 6.52176L20.3333 12.7867C20.3333 18.6535 15.8922 24.2319 10.6666 26.0652C5.44153 24.2316 1 18.6409 1 12.7867V6.52001C1 5.82357 1.42893 5.20343 2.08883 4.94803L10.0845 1.94967Z" stroke="currentColor" stroke-opacity="0.30" stroke-width="2"></path></svg>
|
234 |
+
|
235 |
+
No virus
|
236 |
+
</div>
|
237 |
+
|
238 |
+
<div class="dark:text-gray-300 sm:ml-auto">1.34 kB</div></div>
|
239 |
+
|
240 |
+
<div class="relative min-h-[100px] rounded-b-lg border border-t-0 leading-tight dark:border-gray-800 dark:bg-gray-925">
|
241 |
+
<div class="py-3"><div class="SVELTE_HYDRATER contents" data-props="{"lines":["aiofiles==23.2.1","altair==5.1.2","annotated-types==0.6.0","anyio==3.7.1","attrs==23.1.0","beautifulsoup4==4.12.2","certifi==2023.7.22","charset-normalizer==3.3.0","click==8.1.7","cmake==3.27.7","contourpy==1.1.1","cycler==0.12.1","exceptiongroup==1.1.3","fastapi==0.103.2","ffmpy==0.3.1","filelock==3.12.4","fonttools==4.43.1","fsspec==2023.9.2","gdown==4.7.1","gradio==3.48.0","gradio_client==0.6.1","h11==0.14.0","httpcore==0.18.0","httpx==0.25.0","huggingface-hub==0.18.0","idna==3.4","imageio==2.31.5","imageio-ffmpeg==0.4.9","importlib-resources==6.1.0","Jinja2==3.1.2","jsonschema==4.19.1","jsonschema-specifications==2023.7.1","kiwisolver==1.4.5","lazy_loader==0.3","lit==17.0.3","MarkupSafe==2.1.3","matplotlib==3.8.0","mpmath==1.3.0","networkx==3.1","numpy==1.25.2","orjson==3.9.9","packaging==23.2","pandas==2.1.1","Pillow==10.1.0","psutil==5.9.6","pydantic==2.4.2","pydantic_core==2.10.1","pydub==0.25.1","pyparsing==3.1.1","PySocks==1.7.1","python-dateutil==2.8.2","python-multipart==0.0.6","pytz==2023.3.post1","PyYAML==6.0.1","referencing==0.30.2","requests==2.31.0","rpds-py==0.10.6","scikit-image==0.22.0","scipy==1.11.3","semantic-version==2.10.0","setuptools-scm==8.0.4","six==1.16.0","sniffio==1.3.0","soupsieve==2.5","starlette==0.27.0","sympy==1.12","tifffile==2023.9.26","tomli==2.0.1","toolz==0.12.0","torch==2.0.0","torchvision==0.15.1","tqdm==4.66.1","triton==2.0.0","typing_extensions==4.8.0","tzdata==2023.3","urllib3==2.0.7","uvicorn==0.23.2","websockets==11.0.3",""],"context":{"repo":{"name":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","type":"space"},"revision":"626d7ffc7b07ba96290bd80cb09b73993f85bf40","path":"requirements.txt"}}" data-target="BlobContent">
|
242 |
+
|
243 |
+
<div class="relative text-sm"><div class="overflow-x-auto"><table class="min-w-full border-collapse font-mono"><tbody><tr class="" id="L1">
|
244 |
+
|
245 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="1"></td>
|
246 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->aiofiles==23.2.1<!-- HTML_TAG_END --></td>
|
247 |
+
</tr><tr class="" id="L2">
|
248 |
+
|
249 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="2"></td>
|
250 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->altair==5.1.2<!-- HTML_TAG_END --></td>
|
251 |
+
</tr><tr class="" id="L3">
|
252 |
+
|
253 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="3"></td>
|
254 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->annotated-types==0.6.0<!-- HTML_TAG_END --></td>
|
255 |
+
</tr><tr class="" id="L4">
|
256 |
+
|
257 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="4"></td>
|
258 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->anyio==3.7.1<!-- HTML_TAG_END --></td>
|
259 |
+
</tr><tr class="" id="L5">
|
260 |
+
|
261 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="5"></td>
|
262 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->attrs==23.1.0<!-- HTML_TAG_END --></td>
|
263 |
+
</tr><tr class="" id="L6">
|
264 |
+
|
265 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="6"></td>
|
266 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->beautifulsoup4==4.12.2<!-- HTML_TAG_END --></td>
|
267 |
+
</tr><tr class="" id="L7">
|
268 |
+
|
269 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="7"></td>
|
270 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->certifi==2023.7.22<!-- HTML_TAG_END --></td>
|
271 |
+
</tr><tr class="" id="L8">
|
272 |
+
|
273 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="8"></td>
|
274 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->charset-normalizer==3.3.0<!-- HTML_TAG_END --></td>
|
275 |
+
</tr><tr class="" id="L9">
|
276 |
+
|
277 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="9"></td>
|
278 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->click==8.1.7<!-- HTML_TAG_END --></td>
|
279 |
+
</tr><tr class="" id="L10">
|
280 |
+
|
281 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="10"></td>
|
282 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->cmake==3.27.7<!-- HTML_TAG_END --></td>
|
283 |
+
</tr><tr class="" id="L11">
|
284 |
+
|
285 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="11"></td>
|
286 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->contourpy==1.1.1<!-- HTML_TAG_END --></td>
|
287 |
+
</tr><tr class="" id="L12">
|
288 |
+
|
289 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="12"></td>
|
290 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->cycler==0.12.1<!-- HTML_TAG_END --></td>
|
291 |
+
</tr><tr class="" id="L13">
|
292 |
+
|
293 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="13"></td>
|
294 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->exceptiongroup==1.1.3<!-- HTML_TAG_END --></td>
|
295 |
+
</tr><tr class="" id="L14">
|
296 |
+
|
297 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="14"></td>
|
298 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->fastapi==0.103.2<!-- HTML_TAG_END --></td>
|
299 |
+
</tr><tr class="" id="L15">
|
300 |
+
|
301 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="15"></td>
|
302 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->ffmpy==0.3.1<!-- HTML_TAG_END --></td>
|
303 |
+
</tr><tr class="" id="L16">
|
304 |
+
|
305 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="16"></td>
|
306 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->filelock==3.12.4<!-- HTML_TAG_END --></td>
|
307 |
+
</tr><tr class="" id="L17">
|
308 |
+
|
309 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="17"></td>
|
310 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->fonttools==4.43.1<!-- HTML_TAG_END --></td>
|
311 |
+
</tr><tr class="" id="L18">
|
312 |
+
|
313 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="18"></td>
|
314 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->fsspec==2023.9.2<!-- HTML_TAG_END --></td>
|
315 |
+
</tr><tr class="" id="L19">
|
316 |
+
|
317 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="19"></td>
|
318 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->gdown==4.7.1<!-- HTML_TAG_END --></td>
|
319 |
+
</tr><tr class="" id="L20">
|
320 |
+
|
321 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="20"></td>
|
322 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->gradio==3.48.0<!-- HTML_TAG_END --></td>
|
323 |
+
</tr><tr class="" id="L21">
|
324 |
+
|
325 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="21"></td>
|
326 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->gradio_client==0.6.1<!-- HTML_TAG_END --></td>
|
327 |
+
</tr><tr class="" id="L22">
|
328 |
+
|
329 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="22"></td>
|
330 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->h11==0.14.0<!-- HTML_TAG_END --></td>
|
331 |
+
</tr><tr class="" id="L23">
|
332 |
+
|
333 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="23"></td>
|
334 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->httpcore==0.18.0<!-- HTML_TAG_END --></td>
|
335 |
+
</tr><tr class="" id="L24">
|
336 |
+
|
337 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="24"></td>
|
338 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->httpx==0.25.0<!-- HTML_TAG_END --></td>
|
339 |
+
</tr><tr class="" id="L25">
|
340 |
+
|
341 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="25"></td>
|
342 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->huggingface-hub==0.18.0<!-- HTML_TAG_END --></td>
|
343 |
+
</tr><tr class="" id="L26">
|
344 |
+
|
345 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="26"></td>
|
346 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->idna==3.4<!-- HTML_TAG_END --></td>
|
347 |
+
</tr><tr class="" id="L27">
|
348 |
+
|
349 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="27"></td>
|
350 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->imageio==2.31.5<!-- HTML_TAG_END --></td>
|
351 |
+
</tr><tr class="" id="L28">
|
352 |
+
|
353 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="28"></td>
|
354 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->imageio-ffmpeg==0.4.9<!-- HTML_TAG_END --></td>
|
355 |
+
</tr><tr class="" id="L29">
|
356 |
+
|
357 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="29"></td>
|
358 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->importlib-resources==6.1.0<!-- HTML_TAG_END --></td>
|
359 |
+
</tr><tr class="" id="L30">
|
360 |
+
|
361 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="30"></td>
|
362 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->Jinja2==3.1.2<!-- HTML_TAG_END --></td>
|
363 |
+
</tr><tr class="" id="L31">
|
364 |
+
|
365 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="31"></td>
|
366 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->jsonschema==4.19.1<!-- HTML_TAG_END --></td>
|
367 |
+
</tr><tr class="" id="L32">
|
368 |
+
|
369 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="32"></td>
|
370 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->jsonschema-specifications==2023.7.1<!-- HTML_TAG_END --></td>
|
371 |
+
</tr><tr class="" id="L33">
|
372 |
+
|
373 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="33"></td>
|
374 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->kiwisolver==1.4.5<!-- HTML_TAG_END --></td>
|
375 |
+
</tr><tr class="" id="L34">
|
376 |
+
|
377 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="34"></td>
|
378 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->lazy_loader==0.3<!-- HTML_TAG_END --></td>
|
379 |
+
</tr><tr class="" id="L35">
|
380 |
+
|
381 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="35"></td>
|
382 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->lit==17.0.3<!-- HTML_TAG_END --></td>
|
383 |
+
</tr><tr class="" id="L36">
|
384 |
+
|
385 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="36"></td>
|
386 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->MarkupSafe==2.1.3<!-- HTML_TAG_END --></td>
|
387 |
+
</tr><tr class="" id="L37">
|
388 |
+
|
389 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="37"></td>
|
390 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->matplotlib==3.8.0<!-- HTML_TAG_END --></td>
|
391 |
+
</tr><tr class="" id="L38">
|
392 |
+
|
393 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="38"></td>
|
394 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->mpmath==1.3.0<!-- HTML_TAG_END --></td>
|
395 |
+
</tr><tr class="" id="L39">
|
396 |
+
|
397 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="39"></td>
|
398 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->networkx==3.1<!-- HTML_TAG_END --></td>
|
399 |
+
</tr><tr class="" id="L40">
|
400 |
+
|
401 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="40"></td>
|
402 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->numpy==1.25.2<!-- HTML_TAG_END --></td>
|
403 |
+
</tr><tr class="" id="L41">
|
404 |
+
|
405 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="41"></td>
|
406 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->orjson==3.9.9<!-- HTML_TAG_END --></td>
|
407 |
+
</tr><tr class="" id="L42">
|
408 |
+
|
409 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="42"></td>
|
410 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->packaging==23.2<!-- HTML_TAG_END --></td>
|
411 |
+
</tr><tr class="" id="L43">
|
412 |
+
|
413 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="43"></td>
|
414 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->pandas==2.1.1<!-- HTML_TAG_END --></td>
|
415 |
+
</tr><tr class="" id="L44">
|
416 |
+
|
417 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="44"></td>
|
418 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->Pillow==10.1.0<!-- HTML_TAG_END --></td>
|
419 |
+
</tr><tr class="" id="L45">
|
420 |
+
|
421 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="45"></td>
|
422 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->psutil==5.9.6<!-- HTML_TAG_END --></td>
|
423 |
+
</tr><tr class="" id="L46">
|
424 |
+
|
425 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="46"></td>
|
426 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->pydantic==2.4.2<!-- HTML_TAG_END --></td>
|
427 |
+
</tr><tr class="" id="L47">
|
428 |
+
|
429 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="47"></td>
|
430 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->pydantic_core==2.10.1<!-- HTML_TAG_END --></td>
|
431 |
+
</tr><tr class="" id="L48">
|
432 |
+
|
433 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="48"></td>
|
434 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->pydub==0.25.1<!-- HTML_TAG_END --></td>
|
435 |
+
</tr><tr class="" id="L49">
|
436 |
+
|
437 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="49"></td>
|
438 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->pyparsing==3.1.1<!-- HTML_TAG_END --></td>
|
439 |
+
</tr><tr class="" id="L50">
|
440 |
+
|
441 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="50"></td>
|
442 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->PySocks==1.7.1<!-- HTML_TAG_END --></td>
|
443 |
+
</tr><tr class="" id="L51">
|
444 |
+
|
445 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="51"></td>
|
446 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->python-dateutil==2.8.2<!-- HTML_TAG_END --></td>
|
447 |
+
</tr><tr class="" id="L52">
|
448 |
+
|
449 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="52"></td>
|
450 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->python-multipart==0.0.6<!-- HTML_TAG_END --></td>
|
451 |
+
</tr><tr class="" id="L53">
|
452 |
+
|
453 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="53"></td>
|
454 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->pytz==2023.3.post1<!-- HTML_TAG_END --></td>
|
455 |
+
</tr><tr class="" id="L54">
|
456 |
+
|
457 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="54"></td>
|
458 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->PyYAML==6.0.1<!-- HTML_TAG_END --></td>
|
459 |
+
</tr><tr class="" id="L55">
|
460 |
+
|
461 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="55"></td>
|
462 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->referencing==0.30.2<!-- HTML_TAG_END --></td>
|
463 |
+
</tr><tr class="" id="L56">
|
464 |
+
|
465 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="56"></td>
|
466 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->requests==2.31.0<!-- HTML_TAG_END --></td>
|
467 |
+
</tr><tr class="" id="L57">
|
468 |
+
|
469 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="57"></td>
|
470 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->rpds-py==0.10.6<!-- HTML_TAG_END --></td>
|
471 |
+
</tr><tr class="" id="L58">
|
472 |
+
|
473 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="58"></td>
|
474 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->scikit-image==0.22.0<!-- HTML_TAG_END --></td>
|
475 |
+
</tr><tr class="" id="L59">
|
476 |
+
|
477 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="59"></td>
|
478 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->scipy==1.11.3<!-- HTML_TAG_END --></td>
|
479 |
+
</tr><tr class="" id="L60">
|
480 |
+
|
481 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="60"></td>
|
482 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->semantic-version==2.10.0<!-- HTML_TAG_END --></td>
|
483 |
+
</tr><tr class="" id="L61">
|
484 |
+
|
485 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="61"></td>
|
486 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->setuptools-scm==8.0.4<!-- HTML_TAG_END --></td>
|
487 |
+
</tr><tr class="" id="L62">
|
488 |
+
|
489 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="62"></td>
|
490 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->six==1.16.0<!-- HTML_TAG_END --></td>
|
491 |
+
</tr><tr class="" id="L63">
|
492 |
+
|
493 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="63"></td>
|
494 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->sniffio==1.3.0<!-- HTML_TAG_END --></td>
|
495 |
+
</tr><tr class="" id="L64">
|
496 |
+
|
497 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="64"></td>
|
498 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->soupsieve==2.5<!-- HTML_TAG_END --></td>
|
499 |
+
</tr><tr class="" id="L65">
|
500 |
+
|
501 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="65"></td>
|
502 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->starlette==0.27.0<!-- HTML_TAG_END --></td>
|
503 |
+
</tr><tr class="" id="L66">
|
504 |
+
|
505 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="66"></td>
|
506 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->sympy==1.12<!-- HTML_TAG_END --></td>
|
507 |
+
</tr><tr class="" id="L67">
|
508 |
+
|
509 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="67"></td>
|
510 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->tifffile==2023.9.26<!-- HTML_TAG_END --></td>
|
511 |
+
</tr><tr class="" id="L68">
|
512 |
+
|
513 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="68"></td>
|
514 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->tomli==2.0.1<!-- HTML_TAG_END --></td>
|
515 |
+
</tr><tr class="" id="L69">
|
516 |
+
|
517 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="69"></td>
|
518 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->toolz==0.12.0<!-- HTML_TAG_END --></td>
|
519 |
+
</tr><tr class="" id="L70">
|
520 |
+
|
521 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="70"></td>
|
522 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->torch==2.0.0<!-- HTML_TAG_END --></td>
|
523 |
+
</tr><tr class="" id="L71">
|
524 |
+
|
525 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="71"></td>
|
526 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->torchvision==0.15.1<!-- HTML_TAG_END --></td>
|
527 |
+
</tr><tr class="" id="L72">
|
528 |
+
|
529 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="72"></td>
|
530 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->tqdm==4.66.1<!-- HTML_TAG_END --></td>
|
531 |
+
</tr><tr class="" id="L73">
|
532 |
+
|
533 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="73"></td>
|
534 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->triton==2.0.0<!-- HTML_TAG_END --></td>
|
535 |
+
</tr><tr class="" id="L74">
|
536 |
+
|
537 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="74"></td>
|
538 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->typing_extensions==4.8.0<!-- HTML_TAG_END --></td>
|
539 |
+
</tr><tr class="" id="L75">
|
540 |
+
|
541 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="75"></td>
|
542 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->tzdata==2023.3<!-- HTML_TAG_END --></td>
|
543 |
+
</tr><tr class="" id="L76">
|
544 |
+
|
545 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="76"></td>
|
546 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->urllib3==2.0.7<!-- HTML_TAG_END --></td>
|
547 |
+
</tr><tr class="" id="L77">
|
548 |
+
|
549 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="77"></td>
|
550 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->uvicorn==0.23.2<!-- HTML_TAG_END --></td>
|
551 |
+
</tr><tr class="" id="L78">
|
552 |
+
|
553 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="78"></td>
|
554 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->websockets==11.0.3<!-- HTML_TAG_END --></td>
|
555 |
+
</tr><tr class="" id="L79">
|
556 |
+
|
557 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="79"></td>
|
558 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->
|
559 |
+
<!-- HTML_TAG_END --></td>
|
560 |
+
</tr></tbody></table></div>
|
561 |
+
</div></div></div></div></section></div></main>
|
562 |
+
</div>
|
563 |
+
|
564 |
+
<script>
|
565 |
+
import("/front/build/kube-63b5efc/index.js");
|
566 |
+
window.moonSha = "kube-63b5efc/";
|
567 |
+
window.hubConfig = JSON.parse(`{"features":{"signupDisabled":false},"sshGitUrl":"[email protected]","moonHttpUrl":"https://huggingface.co","captchaApiKey":"bd5f2066-93dc-4bdd-a64b-a24646ca3859","captchaDisabledOnSignup":true,"datasetsServerPublicUrl":"https://datasets-server.huggingface.co","stripePublicKey":"pk_live_x2tdjFXBCvXo2FFmMybezpeM00J6gPCAAc","environment":"production","userAgent":"HuggingFace (production)"}`);
|
568 |
+
</script>
|
569 |
+
|
570 |
+
<!-- Stripe -->
|
571 |
+
<script>
|
572 |
+
if (["hf.co", "huggingface.co"].includes(window.location.hostname)) {
|
573 |
+
const script = document.createElement("script");
|
574 |
+
script.src = "https://js.stripe.com/v3/";
|
575 |
+
script.async = true;
|
576 |
+
document.head.appendChild(script);
|
577 |
+
}
|
578 |
+
</script>
|
579 |
+
|
580 |
+
<!-- Google analytics v4 -->
|
581 |
+
<script>
|
582 |
+
if (["hf.co", "huggingface.co"].includes(window.location.hostname)) {
|
583 |
+
const script = document.createElement("script");
|
584 |
+
script.src = "https://www.googletagmanager.com/gtag/js?id=G-8Q63TH4CSL";
|
585 |
+
script.async = true;
|
586 |
+
document.head.appendChild(script);
|
587 |
+
|
588 |
+
window.dataLayer = window.dataLayer || [];
|
589 |
+
function gtag() {
|
590 |
+
if (window.dataLayer !== undefined) {
|
591 |
+
window.dataLayer.push(arguments);
|
592 |
+
}
|
593 |
+
}
|
594 |
+
gtag("js", new Date());
|
595 |
+
gtag("config", "G-8Q63TH4CSL", { page_path: "/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/blob/main/requirements.txt" });
|
596 |
+
/// ^ See https://developers.google.com/analytics/devguides/collection/gtagjs/pages
|
597 |
+
gtag("consent", "default", { ad_storage: "denied", analytics_storage: "denied" });
|
598 |
+
/// ^ See https://developers.google.com/tag-platform/gtagjs/reference#consent
|
599 |
+
/// TODO: ask the user for their consent and update this with gtag('consent', 'update')
|
600 |
+
}
|
601 |
+
</script>
|
602 |
+
</body>
|
603 |
+
</html>
|
style.css
ADDED
@@ -0,0 +1,362 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html class="">
|
3 |
+
<head>
|
4 |
+
<meta charset="utf-8" />
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
|
6 |
+
<meta name="description" content="We’re on a journey to advance and democratize artificial intelligence through open source and open science." />
|
7 |
+
<meta property="fb:app_id" content="1321688464574422" />
|
8 |
+
<meta name="twitter:card" content="summary_large_image" />
|
9 |
+
<meta name="twitter:site" content="@huggingface" />
|
10 |
+
<meta property="og:title" content="style.css · CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model at main" />
|
11 |
+
<meta property="og:type" content="website" />
|
12 |
+
<meta property="og:url" content="https://huggingface.co/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/blob/main/style.css" />
|
13 |
+
<meta property="og:image" content="https://cdn-thumbnails.huggingface.co/social-thumbnails/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model.png" />
|
14 |
+
|
15 |
+
<link rel="stylesheet" href="/front/build/kube-63b5efc/style.css" />
|
16 |
+
|
17 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
18 |
+
<link
|
19 |
+
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900&display=swap"
|
20 |
+
rel="stylesheet"
|
21 |
+
/>
|
22 |
+
<link
|
23 |
+
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&display=swap"
|
24 |
+
rel="stylesheet"
|
25 |
+
/>
|
26 |
+
|
27 |
+
<link
|
28 |
+
rel="preload"
|
29 |
+
href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.css"
|
30 |
+
as="style"
|
31 |
+
onload="this.onload=null;this.rel='stylesheet'"
|
32 |
+
/>
|
33 |
+
<noscript>
|
34 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.css" />
|
35 |
+
</noscript>
|
36 |
+
|
37 |
+
<!-- HEAD_svelte-1oal594_START --><style>.blob-line-num::before {
|
38 |
+
content: attr(data-line-num);
|
39 |
+
}
|
40 |
+
</style><!-- HEAD_svelte-1oal594_END -->
|
41 |
+
|
42 |
+
<title>style.css · CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model at main</title>
|
43 |
+
|
44 |
+
<script defer data-domain="huggingface.co" src="/js/script.js"></script>
|
45 |
+
<script type="text/javascript" src="https://de5282c3ca0c.edge.sdk.awswaf.com/de5282c3ca0c/526cf06acb0d/challenge.js" defer></script>
|
46 |
+
</head>
|
47 |
+
<body class="flex flex-col min-h-screen bg-white dark:bg-gray-950 text-black ViewerBlobPage">
|
48 |
+
<div class="flex min-h-screen flex-col">
|
49 |
+
<div class="SVELTE_HYDRATER contents" data-props="{"classNames":"","isWide":false,"isZh":false}" data-target="MainHeader"><header class="border-b border-gray-100 "><div class="w-full px-4 container flex h-16 items-center"><div class="flex flex-1 items-center"><a class="mr-5 flex flex-none items-center lg:mr-6" href="/"><img alt="Hugging Face's logo" class="w-7 md:mr-2" src="/front/assets/huggingface_logo-noborder.svg">
|
50 |
+
<span class="hidden whitespace-nowrap text-lg font-bold md:block">Hugging Face</span></a>
|
51 |
+
<div class="relative flex-1 lg:max-w-sm mr-2 sm:mr-4 lg:mr-6"><input autocomplete="off" class="w-full dark:bg-gray-950 pl-8 form-input-alt h-9 pr-3 focus:shadow-xl" name="" placeholder="Search models, datasets, users..." spellcheck="false" type="text" value="">
|
52 |
+
<svg class="absolute left-2.5 text-gray-400 top-1/2 transform -translate-y-1/2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M30 28.59L22.45 21A11 11 0 1 0 21 22.45L28.59 30zM5 14a9 9 0 1 1 9 9a9 9 0 0 1-9-9z" fill="currentColor"></path></svg>
|
53 |
+
</div>
|
54 |
+
<div class="flex flex-none items-center justify-center p-0.5 place-self-stretch lg:hidden"><button class="relative z-40 flex h-6 w-8 items-center justify-center" type="button"><svg width="1em" height="1em" viewBox="0 0 10 10" class="text-xl" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" preserveAspectRatio="xMidYMid meet" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.65039 2.9999C1.65039 2.8066 1.80709 2.6499 2.00039 2.6499H8.00039C8.19369 2.6499 8.35039 2.8066 8.35039 2.9999C8.35039 3.1932 8.19369 3.3499 8.00039 3.3499H2.00039C1.80709 3.3499 1.65039 3.1932 1.65039 2.9999ZM1.65039 4.9999C1.65039 4.8066 1.80709 4.6499 2.00039 4.6499H8.00039C8.19369 4.6499 8.35039 4.8066 8.35039 4.9999C8.35039 5.1932 8.19369 5.3499 8.00039 5.3499H2.00039C1.80709 5.3499 1.65039 5.1932 1.65039 4.9999ZM2.00039 6.6499C1.80709 6.6499 1.65039 6.8066 1.65039 6.9999C1.65039 7.1932 1.80709 7.3499 2.00039 7.3499H8.00039C8.19369 7.3499 8.35039 7.1932 8.35039 6.9999C8.35039 6.8066 8.19369 6.6499 8.00039 6.6499H2.00039Z"></path></svg>
|
55 |
+
</button>
|
56 |
+
|
57 |
+
</div></div>
|
58 |
+
<nav aria-label="Main" class="ml-auto hidden lg:block"><ul class="flex items-center space-x-2"><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-indigo-700" href="/models"><svg class="mr-1.5 text-gray-400 group-hover:text-indigo-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-quaternary" d="M20.23 7.24L12 12L3.77 7.24a1.98 1.98 0 0 1 .7-.71L11 2.76c.62-.35 1.38-.35 2 0l6.53 3.77c.29.173.531.418.7.71z" opacity=".25" fill="currentColor"></path><path class="uim-tertiary" d="M12 12v9.5a2.09 2.09 0 0 1-.91-.21L4.5 17.48a2.003 2.003 0 0 1-1-1.73v-7.5a2.06 2.06 0 0 1 .27-1.01L12 12z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M20.5 8.25v7.5a2.003 2.003 0 0 1-1 1.73l-6.62 3.82c-.275.13-.576.198-.88.2V12l8.23-4.76c.175.308.268.656.27 1.01z" fill="currentColor"></path></svg>
|
59 |
+
Models</a>
|
60 |
+
</li><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-red-700" href="/datasets"><svg class="mr-1.5 text-gray-400 group-hover:text-red-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 25 25"><ellipse cx="12.5" cy="5" fill="currentColor" fill-opacity="0.25" rx="7.5" ry="2"></ellipse><path d="M12.5 15C16.6421 15 20 14.1046 20 13V20C20 21.1046 16.6421 22 12.5 22C8.35786 22 5 21.1046 5 20V13C5 14.1046 8.35786 15 12.5 15Z" fill="currentColor" opacity="0.5"></path><path d="M12.5 7C16.6421 7 20 6.10457 20 5V11.5C20 12.6046 16.6421 13.5 12.5 13.5C8.35786 13.5 5 12.6046 5 11.5V5C5 6.10457 8.35786 7 12.5 7Z" fill="currentColor" opacity="0.5"></path><path d="M5.23628 12C5.08204 12.1598 5 12.8273 5 13C5 14.1046 8.35786 15 12.5 15C16.6421 15 20 14.1046 20 13C20 12.8273 19.918 12.1598 19.7637 12C18.9311 12.8626 15.9947 13.5 12.5 13.5C9.0053 13.5 6.06886 12.8626 5.23628 12Z" fill="currentColor"></path></svg>
|
61 |
+
Datasets</a>
|
62 |
+
</li><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-blue-700" href="/spaces"><svg class="mr-1.5 text-gray-400 group-hover:text-blue-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" viewBox="0 0 25 25"><path opacity=".5" d="M6.016 14.674v4.31h4.31v-4.31h-4.31ZM14.674 14.674v4.31h4.31v-4.31h-4.31ZM6.016 6.016v4.31h4.31v-4.31h-4.31Z" fill="currentColor"></path><path opacity=".75" fill-rule="evenodd" clip-rule="evenodd" d="M3 4.914C3 3.857 3.857 3 4.914 3h6.514c.884 0 1.628.6 1.848 1.414a5.171 5.171 0 0 1 7.31 7.31c.815.22 1.414.964 1.414 1.848v6.514A1.914 1.914 0 0 1 20.086 22H4.914A1.914 1.914 0 0 1 3 20.086V4.914Zm3.016 1.102v4.31h4.31v-4.31h-4.31Zm0 12.968v-4.31h4.31v4.31h-4.31Zm8.658 0v-4.31h4.31v4.31h-4.31Zm0-10.813a2.155 2.155 0 1 1 4.31 0 2.155 2.155 0 0 1-4.31 0Z" fill="currentColor"></path><path opacity=".25" d="M16.829 6.016a2.155 2.155 0 1 0 0 4.31 2.155 2.155 0 0 0 0-4.31Z" fill="currentColor"></path></svg>
|
63 |
+
Spaces</a>
|
64 |
+
</li><li><a class="group flex items-center px-2 py-0.5 dark:hover:text-gray-400 hover:text-yellow-700" href="/docs"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="mr-1.5 text-gray-400 group-hover:text-yellow-500" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path opacity="0.5" d="M20.9022 5.10334L10.8012 10.8791L7.76318 9.11193C8.07741 8.56791 8.5256 8.11332 9.06512 7.7914L15.9336 3.73907C17.0868 3.08811 18.5002 3.26422 19.6534 3.91519L19.3859 3.73911C19.9253 4.06087 20.5879 4.56025 20.9022 5.10334Z" fill="currentColor"></path><path d="M10.7999 10.8792V28.5483C10.2136 28.5475 9.63494 28.4139 9.10745 28.1578C8.5429 27.8312 8.074 27.3621 7.74761 26.7975C7.42122 26.2327 7.24878 25.5923 7.24756 24.9402V10.9908C7.25062 10.3319 7.42358 9.68487 7.74973 9.1123L10.7999 10.8792Z" fill="currentColor" fill-opacity="0.75"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M21.3368 10.8499V6.918C21.3331 6.25959 21.16 5.61234 20.8346 5.03949L10.7971 10.8727L10.8046 10.874L21.3368 10.8499Z" fill="currentColor"></path><path opacity="0.5" d="M21.7937 10.8488L10.7825 10.8741V28.5486L21.7937 28.5234C23.3344 28.5234 24.5835 27.2743 24.5835 25.7335V13.6387C24.5835 12.0979 23.4365 11.1233 21.7937 10.8488Z" fill="currentColor"></path></svg>
|
65 |
+
Docs</a>
|
66 |
+
</li>
|
67 |
+
<li><div class="relative ">
|
68 |
+
<button class="px-2 py-0.5 group hover:text-green-700 dark:hover:text-gray-400 flex items-center " type="button">
|
69 |
+
<svg class="mr-1.5 text-gray-400 group-hover:text-green-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-tertiary" d="M19 6H5a3 3 0 0 0-3 3v2.72L8.837 14h6.326L22 11.72V9a3 3 0 0 0-3-3z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M10 6V5h4v1h2V5a2.002 2.002 0 0 0-2-2h-4a2.002 2.002 0 0 0-2 2v1h2zm-1.163 8L2 11.72V18a3.003 3.003 0 0 0 3 3h14a3.003 3.003 0 0 0 3-3v-6.28L15.163 14H8.837z" fill="currentColor"></path></svg>
|
70 |
+
Solutions
|
71 |
+
</button>
|
72 |
+
|
73 |
+
|
74 |
+
|
75 |
+
</div></li>
|
76 |
+
<li><a class="group flex items-center px-2 py-0.5 hover:text-gray-500 dark:hover:text-gray-400" href="/pricing">Pricing
|
77 |
+
</a></li>
|
78 |
+
|
79 |
+
<li><div class="relative group">
|
80 |
+
<button class="px-2 py-0.5 hover:text-gray-500 dark:hover:text-gray-600 flex items-center " type="button">
|
81 |
+
<svg class="mr-1.5 text-gray-500 w-5 group-hover:text-gray-400 dark:text-gray-300 dark:group-hover:text-gray-400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" viewBox="0 0 32 18" preserveAspectRatio="xMidYMid meet"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4504 3.30221C14.4504 2.836 14.8284 2.45807 15.2946 2.45807H28.4933C28.9595 2.45807 29.3374 2.836 29.3374 3.30221C29.3374 3.76842 28.9595 4.14635 28.4933 4.14635H15.2946C14.8284 4.14635 14.4504 3.76842 14.4504 3.30221Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4504 9.00002C14.4504 8.53382 14.8284 8.15588 15.2946 8.15588H28.4933C28.9595 8.15588 29.3374 8.53382 29.3374 9.00002C29.3374 9.46623 28.9595 9.84417 28.4933 9.84417H15.2946C14.8284 9.84417 14.4504 9.46623 14.4504 9.00002Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4504 14.6978C14.4504 14.2316 14.8284 13.8537 15.2946 13.8537H28.4933C28.9595 13.8537 29.3374 14.2316 29.3374 14.6978C29.3374 15.164 28.9595 15.542 28.4933 15.542H15.2946C14.8284 15.542 14.4504 15.164 14.4504 14.6978Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M1.94549 6.87377C2.27514 6.54411 2.80962 6.54411 3.13928 6.87377L6.23458 9.96907L9.32988 6.87377C9.65954 6.54411 10.194 6.54411 10.5237 6.87377C10.8533 7.20343 10.8533 7.73791 10.5237 8.06756L6.23458 12.3567L1.94549 8.06756C1.61583 7.73791 1.61583 7.20343 1.94549 6.87377Z" fill="currentColor"></path></svg>
|
82 |
+
|
83 |
+
</button>
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
</div></li>
|
88 |
+
<li><hr class="h-5 w-0.5 border-none bg-gray-100 dark:bg-gray-800"></li>
|
89 |
+
<li><a class="block cursor-pointer px-2 py-0.5 hover:text-gray-500 dark:hover:text-gray-400" href="/login">Log In
|
90 |
+
</a></li>
|
91 |
+
<li><a class="rounded-full border border-transparent bg-gray-900 px-3 py-1 leading-none text-white hover:border-black hover:bg-white hover:text-black" href="/join">Sign Up
|
92 |
+
</a></li></ul></nav></div></header></div>
|
93 |
+
|
94 |
+
<div class="SVELTE_HYDRATER contents" data-props="{}" data-target="GoogleAnalyticsTracker"></div>
|
95 |
+
|
96 |
+
|
97 |
+
<div class="SVELTE_HYDRATER contents" data-props="{}" data-target="SSOBanner"></div>
|
98 |
+
|
99 |
+
<main class="flex flex-1 flex-col"><div class="SVELTE_HYDRATER contents" data-props="{"activeTab":"files","author":{"avatarUrl":"https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1642793296366-61e1188afc27c0f5e3641eb3.jpeg?w=200&h=200&f=face","fullname":"CVPR Demo Track","name":"CVPR","type":"org","isHf":false},"canReadRepoSettings":false,"canDisable":false,"discussionsStats":{"closed":5,"open":6,"total":11},"query":{},"space":{"author":"CVPR","colorFrom":"indigo","colorTo":"indigo","cardData":{"title":"Image Animation Using Thin Plate Spline Motion Model","emoji":"👁","colorFrom":"indigo","colorTo":"indigo","sdk":"gradio","sdk_version":"3.48.0","app_file":"app.py","pinned":false},"emoji":"👁","discussionsDisabled":false,"duplicationDisabled":false,"id":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","isLikedByUser":false,"isWatchedByUser":false,"lastModified":"2023-10-25T19:06:23.000Z","likes":510,"pinned":false,"private":false,"gated":false,"repoType":"space","subdomain":"cvpr-image-animation-using-thin-plate-spline-mot-e234846","sdk":"gradio","sdkVersion":"3.48.0","title":"Image Animation Using Thin Plate Spline Motion Model","runtime":{"stage":"RUNNING","hardware":{"current":"cpu-basic","requested":"cpu-basic"},"storage":null,"gcTimeout":null,"replicas":{"current":1,"requested":1}},"iframe":{"host":"https://cvpr-image-animation-using-thin-plate-spline-mot-e234846.hf.space","src":"https://cvpr-image-animation-using-thin-plate-spline-mot-e234846.hf.space"},"secrets":[],"variables":[],"sse":{"url":"https://api.hf.space/v1/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","jwt":"eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJpYXQiOjE2OTk2NzcwMzgsInN1YiI6Ii9zcGFjZXMvQ1ZQUi9JbWFnZS1BbmltYXRpb24tdXNpbmctVGhpbi1QbGF0ZS1TcGxpbmUtTW90aW9uLU1vZGVsIiwiZXhwIjoxNjk5NzYzNDM4LCJpc3MiOiJodHRwczovL2h1Z2dpbmdmYWNlLmNvIn0.bSZqBZNqVJDcXVcTiL9p8UhdzsZ0QYjJjAZZrfIxUyQMMzRcqS6sk2ZrpEyQqqzn9-qTGJbmQV5KlqKlEkAODg"},"linkedModels":[],"linkedDatasets":[],"linkedCollections":[]}}" data-target="SpaceHeader"><header class="from-gray-50-to-white border-b border-gray-100 bg-gradient-to-t via-white dark:via-gray-950 pt-4 xl:pt-0"><div class="container relative flex flex-col xl:flex-row"><h1 class="flex flex-wrap items-center leading-tight gap-y-1 text-lg xl:flex-none"><a href="/spaces" class="group flex items-center"><svg class="mr-1 text-gray-400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M7.80914 18.7462V24.1907H13.2536V18.7462H7.80914Z" fill="#FF3270"></path><path d="M18.7458 18.7462V24.1907H24.1903V18.7462H18.7458Z" fill="#861FFF"></path><path d="M7.80914 7.80982V13.2543H13.2536V7.80982H7.80914Z" fill="#097EFF"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M4 6.41775C4 5.08246 5.08246 4 6.41775 4H14.6457C15.7626 4 16.7026 4.75724 16.9802 5.78629C18.1505 4.67902 19.7302 4 21.4685 4C25.0758 4 28.0003 6.92436 28.0003 10.5317C28.0003 12.27 27.3212 13.8497 26.2139 15.02C27.243 15.2977 28.0003 16.2376 28.0003 17.3545V25.5824C28.0003 26.9177 26.9177 28.0003 25.5824 28.0003H17.0635H14.9367H6.41775C5.08246 28.0003 4 26.9177 4 25.5824V15.1587V14.9367V6.41775ZM7.80952 7.80952V13.254H13.254V7.80952H7.80952ZM7.80952 24.1907V18.7462H13.254V24.1907H7.80952ZM18.7462 24.1907V18.7462H24.1907V24.1907H18.7462ZM18.7462 10.5317C18.7462 9.0283 19.9651 7.80952 21.4685 7.80952C22.9719 7.80952 24.1907 9.0283 24.1907 10.5317C24.1907 12.0352 22.9719 13.254 21.4685 13.254C19.9651 13.254 18.7462 12.0352 18.7462 10.5317Z" fill="black"></path><path d="M21.4681 7.80982C19.9647 7.80982 18.7458 9.02861 18.7458 10.5321C18.7458 12.0355 19.9647 13.2543 21.4681 13.2543C22.9715 13.2543 24.1903 12.0355 24.1903 10.5321C24.1903 9.02861 22.9715 7.80982 21.4681 7.80982Z" fill="#FFD702"></path></svg>
|
100 |
+
<span class="mr-2.5 font-semibold text-gray-400 group-hover:text-gray-500">Spaces:</span></a>
|
101 |
+
<div class="group flex flex-none items-center"><div class="relative mr-1.5 flex items-center">
|
102 |
+
|
103 |
+
<img alt="" class="w-3.5 h-3.5 rounded " src="https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1642793296366-61e1188afc27c0f5e3641eb3.jpeg?w=200&h=200&f=face" crossorigin="anonymous"></div>
|
104 |
+
<a href="/CVPR" class="text-gray-400 hover:text-blue-600">CVPR</a>
|
105 |
+
<div class="mx-0.5 text-gray-300">/</div></div>
|
106 |
+
|
107 |
+
<div class="max-w-full xl:flex xl:min-w-0 xl:flex-nowrap xl:items-center xl:gap-x-1"><a class="break-words font-mono font-semibold hover:text-blue-600 text-[1.07rem] xl:truncate" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model">Image-Animation-using-Thin-Plate-Spline-Motion-Model</a>
|
108 |
+
<button class="relative text-xs mr-3 inline-flex cursor-pointer items-center text-sm focus:outline-none mx-0.5 text-gray-600 " title="Copy space name to clipboard" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg>
|
109 |
+
|
110 |
+
</button></div>
|
111 |
+
<div class="inline-flex items-center overflow-hidden whitespace-nowrap rounded-md border bg-white text-sm leading-none text-gray-500 mr-2"><button class="relative flex items-center px-1.5 py-1 hover:bg-gradient-to-t focus:outline-none overflow-hidden from-red-50 to-transparent dark:from-red-900 dark:to-red-800" title="Like"><svg class="left-1.5 absolute" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" fill="currentColor"><path d="M22.45,6a5.47,5.47,0,0,1,3.91,1.64,5.7,5.7,0,0,1,0,8L16,26.13,5.64,15.64a5.7,5.7,0,0,1,0-8,5.48,5.48,0,0,1,7.82,0L16,10.24l2.53-2.58A5.44,5.44,0,0,1,22.45,6m0-2a7.47,7.47,0,0,0-5.34,2.24L16,7.36,14.89,6.24a7.49,7.49,0,0,0-10.68,0,7.72,7.72,0,0,0,0,10.82L16,29,27.79,17.06a7.72,7.72,0,0,0,0-10.82A7.49,7.49,0,0,0,22.45,4Z"></path></svg>
|
112 |
+
|
113 |
+
|
114 |
+
<span class="ml-4 pl-0.5">like</span></button>
|
115 |
+
<button class="flex items-center border-l px-1.5 py-1 text-gray-400 hover:bg-gray-50 focus:bg-gray-100 focus:outline-none dark:hover:bg-gray-900 dark:focus:bg-gray-800" title="See users who liked this repository">510</button></div>
|
116 |
+
|
117 |
+
|
118 |
+
|
119 |
+
|
120 |
+
|
121 |
+
|
122 |
+
|
123 |
+
|
124 |
+
|
125 |
+
<div class="inline-flex select-none items-center overflow-hidden font-mono text-xs flex-shrink-0 mr-2 rounded-lg border px-2 py-[0.32rem] leading-none dark:bg-gray-900
|
126 |
+
bg-green-50
|
127 |
+
border-green-100
|
128 |
+
text-green-700 dark:text-green-500">
|
129 |
+
<div class="ml-0.5 mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"></div>
|
130 |
+
Running
|
131 |
+
</div>
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
+
|
136 |
+
<div class="sm:hidden"><div class="relative ">
|
137 |
+
<button class="btn px-1 py-1 text-sm translate-y-0 " type="button">
|
138 |
+
|
139 |
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="p-px" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><circle cx="16" cy="7" r="3" fill="currentColor"></circle><circle cx="16" cy="16" r="3" fill="currentColor"></circle><circle cx="16" cy="25" r="3" fill="currentColor"></circle></svg>
|
140 |
+
|
141 |
+
|
142 |
+
</button>
|
143 |
+
|
144 |
+
|
145 |
+
|
146 |
+
</div></div></h1>
|
147 |
+
|
148 |
+
|
149 |
+
<div class="flex flex-col-reverse gap-x-2 sm:flex-row sm:items-center sm:justify-between xl:ml-auto"><div class="-mb-px flex h-12 items-center overflow-x-auto overflow-y-hidden sm:h-[3.25rem]"><a class="tab-alternate " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model"><svg class="mr-1.5 text-gray-400 flex-none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-quaternary" d="M20.23 7.24L12 12L3.77 7.24a1.98 1.98 0 0 1 .7-.71L11 2.76c.62-.35 1.38-.35 2 0l6.53 3.77c.29.173.531.418.7.71z" opacity=".25" fill="currentColor"></path><path class="uim-tertiary" d="M12 12v9.5a2.09 2.09 0 0 1-.91-.21L4.5 17.48a2.003 2.003 0 0 1-1-1.73v-7.5a2.06 2.06 0 0 1 .27-1.01L12 12z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M20.5 8.25v7.5a2.003 2.003 0 0 1-1 1.73l-6.62 3.82c-.275.13-.576.198-.88.2V12l8.23-4.76c.175.308.268.656.27 1.01z" fill="currentColor"></path></svg>
|
150 |
+
App
|
151 |
+
|
152 |
+
|
153 |
+
</a><a class="tab-alternate active" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/tree/main"><svg class="mr-1.5 text-gray-400 flex-none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-tertiary" d="M21 19h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2zm0-4h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2zm0-8h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2zm0 4h-8a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M9 19a1 1 0 0 1-1-1V6a1 1 0 0 1 2 0v12a1 1 0 0 1-1 1zm-6-4.333a1 1 0 0 1-.64-1.769L3.438 12l-1.078-.898a1 1 0 0 1 1.28-1.538l2 1.667a1 1 0 0 1 0 1.538l-2 1.667a.999.999 0 0 1-.64.231z" fill="currentColor"></path></svg>
|
154 |
+
<span class="xl:hidden">Files</span>
|
155 |
+
<span class="hidden xl:inline">Files</span>
|
156 |
+
|
157 |
+
|
158 |
+
</a><a class="tab-alternate " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/discussions"><svg class="mr-1.5 text-gray-400 flex-none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M20.6081 3C21.7684 3 22.8053 3.49196 23.5284 4.38415C23.9756 4.93678 24.4428 5.82749 24.4808 7.16133C24.9674 7.01707 25.4353 6.93643 25.8725 6.93643C26.9833 6.93643 27.9865 7.37587 28.696 8.17411C29.6075 9.19872 30.0124 10.4579 29.8361 11.7177C29.7523 12.3177 29.5581 12.8555 29.2678 13.3534C29.8798 13.8646 30.3306 14.5763 30.5485 15.4322C30.719 16.1032 30.8939 17.5006 29.9808 18.9403C30.0389 19.0342 30.0934 19.1319 30.1442 19.2318C30.6932 20.3074 30.7283 21.5229 30.2439 22.6548C29.5093 24.3704 27.6841 25.7219 24.1397 27.1727C21.9347 28.0753 19.9174 28.6523 19.8994 28.6575C16.9842 29.4379 14.3477 29.8345 12.0653 29.8345C7.87017 29.8345 4.8668 28.508 3.13831 25.8921C0.356375 21.6797 0.754104 17.8269 4.35369 14.1131C6.34591 12.058 7.67023 9.02782 7.94613 8.36275C8.50224 6.39343 9.97271 4.20438 12.4172 4.20438H12.4179C12.6236 4.20438 12.8314 4.2214 13.0364 4.25468C14.107 4.42854 15.0428 5.06476 15.7115 6.02205C16.4331 5.09583 17.134 4.359 17.7682 3.94323C18.7242 3.31737 19.6794 3 20.6081 3ZM20.6081 5.95917C20.2427 5.95917 19.7963 6.1197 19.3039 6.44225C17.7754 7.44319 14.8258 12.6772 13.7458 14.7131C13.3839 15.3952 12.7655 15.6837 12.2086 15.6837C11.1036 15.6837 10.2408 14.5497 12.1076 13.1085C14.9146 10.9402 13.9299 7.39584 12.5898 7.1776C12.5311 7.16799 12.4731 7.16355 12.4172 7.16355C11.1989 7.16355 10.6615 9.33114 10.6615 9.33114C10.6615 9.33114 9.0863 13.4148 6.38031 16.206C3.67434 18.998 3.5346 21.2388 5.50675 24.2246C6.85185 26.2606 9.42666 26.8753 12.0653 26.8753C14.8021 26.8753 17.6077 26.2139 19.1799 25.793C19.2574 25.7723 28.8193 22.984 27.6081 20.6107C27.4046 20.212 27.0693 20.0522 26.6471 20.0522C24.9416 20.0522 21.8393 22.6726 20.5057 22.6726C20.2076 22.6726 19.9976 22.5416 19.9116 22.222C19.3433 20.1173 28.552 19.2325 27.7758 16.1839C27.639 15.6445 27.2677 15.4256 26.746 15.4263C24.4923 15.4263 19.4358 19.5181 18.3759 19.5181C18.2949 19.5181 18.2368 19.4937 18.2053 19.4419C17.6743 18.557 17.9653 17.9394 21.7082 15.6009C25.4511 13.2617 28.0783 11.8545 26.5841 10.1752C26.4121 9.98141 26.1684 9.8956 25.8725 9.8956C23.6001 9.89634 18.2311 14.9403 18.2311 14.9403C18.2311 14.9403 16.7821 16.496 15.9057 16.496C15.7043 16.496 15.533 16.4139 15.4169 16.2112C14.7956 15.1296 21.1879 10.1286 21.5484 8.06535C21.7928 6.66715 21.3771 5.95917 20.6081 5.95917Z" fill="#FF9D00"></path><path d="M5.50686 24.2246C3.53472 21.2387 3.67446 18.9979 6.38043 16.206C9.08641 13.4147 10.6615 9.33111 10.6615 9.33111C10.6615 9.33111 11.2499 6.95933 12.59 7.17757C13.93 7.39581 14.9139 10.9401 12.1069 13.1084C9.29997 15.276 12.6659 16.7489 13.7459 14.713C14.8258 12.6772 17.7747 7.44316 19.304 6.44221C20.8326 5.44128 21.9089 6.00204 21.5484 8.06532C21.188 10.1286 14.795 15.1295 15.4171 16.2118C16.0391 17.2934 18.2312 14.9402 18.2312 14.9402C18.2312 14.9402 25.0907 8.49588 26.5842 10.1752C28.0776 11.8545 25.4512 13.2616 21.7082 15.6008C17.9646 17.9393 17.6744 18.557 18.2054 19.4418C18.7372 20.3266 26.9998 13.1351 27.7759 16.1838C28.5513 19.2324 19.3434 20.1173 19.9117 22.2219C20.48 24.3274 26.3979 18.2382 27.6082 20.6107C28.8193 22.9839 19.2574 25.7722 19.18 25.7929C16.0914 26.62 8.24723 28.3726 5.50686 24.2246Z" fill="#FFD21E"></path></svg>
|
159 |
+
Community
|
160 |
+
<div class="ml-1.5 flex h-4 min-w-[1rem] items-center justify-center rounded px-1 text-xs leading-none shadow-sm bg-black text-white dark:bg-gray-800 dark:text-gray-200">11
|
161 |
+
</div>
|
162 |
+
|
163 |
+
</a>
|
164 |
+
</div>
|
165 |
+
|
166 |
+
|
167 |
+
|
168 |
+
<div class="hidden sm:block mt-2 lg:mt-0"><div class="relative ">
|
169 |
+
<button class="btn px-1 py-1 text-base translate-y-px " type="button">
|
170 |
+
|
171 |
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="p-0.5" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><circle cx="16" cy="7" r="3" fill="currentColor"></circle><circle cx="16" cy="16" r="3" fill="currentColor"></circle><circle cx="16" cy="25" r="3" fill="currentColor"></circle></svg>
|
172 |
+
|
173 |
+
|
174 |
+
</button>
|
175 |
+
|
176 |
+
|
177 |
+
|
178 |
+
</div></div>
|
179 |
+
</div></div></header>
|
180 |
+
|
181 |
+
|
182 |
+
|
183 |
+
|
184 |
+
|
185 |
+
|
186 |
+
|
187 |
+
|
188 |
+
|
189 |
+
|
190 |
+
|
191 |
+
|
192 |
+
|
193 |
+
|
194 |
+
|
195 |
+
</div>
|
196 |
+
|
197 |
+
<div class="container relative flex flex-col md:grid md:space-y-0 w-full md:grid-cols-12 space-y-4 md:gap-6 mb-16"><section class="pt-8 border-gray-100 col-span-full"><header class="flex flex-wrap items-center justify-start pb-2 md:justify-end lg:flex-nowrap"><div class="mr-4 flex min-w-0 basis-auto flex-wrap items-center md:flex-grow md:basis-full lg:basis-auto lg:flex-nowrap"><div class="SVELTE_HYDRATER contents" data-props="{"path":"style.css","repoName":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","repoType":"space","rev":"main","refs":{"branches":[{"name":"main","ref":"refs/heads/main","targetCommit":"626d7ffc7b07ba96290bd80cb09b73993f85bf40"}],"tags":[],"converts":[]},"view":"blob"}" data-target="BranchSelector"><div class="relative mr-4 mb-2">
|
198 |
+
<button class="text-sm md:text-base btn w-full cursor-pointer text-sm" type="button">
|
199 |
+
<svg class="mr-1.5 text-gray-700 dark:text-gray-400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" style="transform: rotate(360deg);"><path d="M13 14c-3.36 0-4.46 1.35-4.82 2.24C9.25 16.7 10 17.76 10 19a3 3 0 0 1-3 3a3 3 0 0 1-3-3c0-1.31.83-2.42 2-2.83V7.83A2.99 2.99 0 0 1 4 5a3 3 0 0 1 3-3a3 3 0 0 1 3 3c0 1.31-.83 2.42-2 2.83v5.29c.88-.65 2.16-1.12 4-1.12c2.67 0 3.56-1.34 3.85-2.23A3.006 3.006 0 0 1 14 7a3 3 0 0 1 3-3a3 3 0 0 1 3 3c0 1.34-.88 2.5-2.09 2.86C17.65 11.29 16.68 14 13 14m-6 4a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1M7 4a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1m10 2a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1z" fill="currentColor"></path></svg>
|
200 |
+
main
|
201 |
+
<svg class="-mr-1 text-gray-500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" style="transform: rotate(360deg);"><path d="M7 10l5 5l5-5z" fill="currentColor"></path></svg></button>
|
202 |
+
|
203 |
+
|
204 |
+
|
205 |
+
</div></div>
|
206 |
+
<div class="mb-2 flex items-center overflow-hidden"><a class="truncate text-gray-800 hover:underline" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/tree/main">Image-Animation-using-Thin-Plate-Spline-Motion-Model</a>
|
207 |
+
<span class="mx-1 text-gray-300">/</span>
|
208 |
+
<span class="dark:text-gray-300">style.css</span></div></div>
|
209 |
+
|
210 |
+
|
211 |
+
</header>
|
212 |
+
<div class="SVELTE_HYDRATER contents" data-props="{"commitLast":{"date":"2022-06-20T17:20:56.000Z","subject":"Create new file","authors":[{"_id":"605b1a536ce6cabbb3474b5a","avatar":"https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1655583590216-605b1a536ce6cabbb3474b5a.jpeg?w=200&h=200&f=face","isHf":false,"user":"animesh007"}],"commit":{"id":"80691d374a3a292e95e3493d74d5e64672092b87","parentIds":["d5893be6be05a2fed6d76ca5611fd17ecb667a55"]},"title":"Create new file"},"repo":{"name":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","type":"space"}}" data-target="LastCommit"><div class="from-gray-100-to-white flex items-baseline rounded-t-lg border border-b-0 bg-gradient-to-t px-3 py-2 dark:border-gray-800"><img class="mr-2.5 mt-0.5 h-4 w-4 self-center rounded-full" alt="animesh007's picture" src="https://aeiljuispo.cloudimg.io/v7/https://cdn-uploads.huggingface.co/production/uploads/1655583590216-605b1a536ce6cabbb3474b5a.jpeg?w=200&h=200&f=face">
|
213 |
+
<div class="mr-5 flex flex-none items-center truncate"><a class="hover:underline" href="/animesh007">animesh007
|
214 |
+
</a>
|
215 |
+
|
216 |
+
</div>
|
217 |
+
<div class="mr-4 truncate font-mono text-sm text-gray-500 hover:prose-a:underline"><!-- HTML_TAG_START -->Create new file<!-- HTML_TAG_END --></div>
|
218 |
+
<a class="rounded border bg-gray-50 px-1.5 text-sm hover:underline dark:border-gray-800 dark:bg-gray-900" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/commit/80691d374a3a292e95e3493d74d5e64672092b87">80691d3</a>
|
219 |
+
|
220 |
+
<time class="ml-auto hidden flex-none truncate pl-2 text-gray-500 dark:text-gray-400 lg:block" datetime="2022-06-20T17:20:56" title="Mon, 20 Jun 2022 17:20:56 GMT">over 1 year ago</time></div></div>
|
221 |
+
<div class="flex flex-wrap items-center border px-3 py-1.5 text-sm text-gray-800 dark:border-gray-800 dark:bg-gray-900">
|
222 |
+
<a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/raw/main/style.css"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" style="transform: rotate(360deg);"><path d="M31 16l-7 7l-1.41-1.41L28.17 16l-5.58-5.59L24 9l7 7z" fill="currentColor"></path><path d="M1 16l7-7l1.41 1.41L3.83 16l5.58 5.59L8 23l-7-7z" fill="currentColor"></path><path d="M12.419 25.484L17.639 6l1.932.518L14.35 26z" fill="currentColor"></path></svg>
|
223 |
+
raw
|
224 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/commits/main/style.css"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" style="transform: rotate(360deg);"><path d="M16 4C9.383 4 4 9.383 4 16s5.383 12 12 12s12-5.383 12-12S22.617 4 16 4zm0 2c5.535 0 10 4.465 10 10s-4.465 10-10 10S6 21.535 6 16S10.465 6 16 6zm-1 2v9h7v-2h-5V8z" fill="currentColor"></path></svg>
|
225 |
+
history
|
226 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/blame/main/style.css"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32" style="transform: rotate(360deg);"><path d="M16 2a14 14 0 1 0 14 14A14 14 0 0 0 16 2zm0 26a12 12 0 1 1 12-12a12 12 0 0 1-12 12z" fill="currentColor"></path><path d="M11.5 11a2.5 2.5 0 1 0 2.5 2.5a2.48 2.48 0 0 0-2.5-2.5z" fill="currentColor"></path><path d="M20.5 11a2.5 2.5 0 1 0 2.5 2.5a2.48 2.48 0 0 0-2.5-2.5z" fill="currentColor"></path></svg>
|
227 |
+
blame
|
228 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline text-green-600 dark:text-gray-300" href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/edit/main/style.css"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M2 26h28v2H2z" fill="currentColor"></path><path d="M25.4 9c.8-.8.8-2 0-2.8l-3.6-3.6c-.8-.8-2-.8-2.8 0l-15 15V24h6.4l15-15zm-5-5L24 7.6l-3 3L17.4 7l3-3zM6 22v-3.6l10-10l3.6 3.6l-10 10H6z" fill="currentColor"></path></svg>
|
229 |
+
contribute
|
230 |
+
</a><a class="my-1 mr-4 flex items-center hover:underline " href="/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/delete/main/style.css"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M12 12h2v12h-2z" fill="currentColor"></path><path d="M18 12h2v12h-2z" fill="currentColor"></path><path d="M4 6v2h2v20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h2V6zm4 22V8h16v20z" fill="currentColor"></path><path d="M12 2h8v2h-8z" fill="currentColor"></path></svg>
|
231 |
+
delete
|
232 |
+
</a>
|
233 |
+
<div class="mr-4 flex items-center text-gray-400"><svg class="text-gray-300 text-sm mr-1.5 -translate-y-px" width="1em" height="1em" viewBox="0 0 22 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M15.3634 10.3639C15.8486 10.8491 15.8486 11.6357 15.3634 12.1209L10.9292 16.5551C10.6058 16.8785 10.0814 16.8785 9.7579 16.5551L7.03051 13.8277C6.54532 13.3425 6.54532 12.5558 7.03051 12.0707C7.51569 11.5855 8.30234 11.5855 8.78752 12.0707L9.7579 13.041C10.0814 13.3645 10.6058 13.3645 10.9292 13.041L13.6064 10.3639C14.0916 9.8787 14.8782 9.8787 15.3634 10.3639Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M10.6666 27.12C4.93329 25.28 0 19.2267 0 12.7867V6.52001C0 5.40001 0.693334 4.41334 1.73333 4.01334L9.73333 1.01334C10.3333 0.786673 11 0.786673 11.6 1.02667L19.6 4.02667C20.1083 4.21658 20.5465 4.55701 20.8562 5.00252C21.1659 5.44803 21.3324 5.97742 21.3333 6.52001V12.7867C21.3333 19.24 16.4 25.28 10.6666 27.12Z" fill="currentColor" fill-opacity="0.22"></path><path d="M10.0845 1.94967L10.0867 1.94881C10.4587 1.8083 10.8666 1.81036 11.2286 1.95515L11.2387 1.95919L11.2489 1.963L19.2489 4.963L19.25 4.96342C19.5677 5.08211 19.8416 5.29488 20.0351 5.57333C20.2285 5.85151 20.3326 6.18203 20.3333 6.52082C20.3333 6.52113 20.3333 6.52144 20.3333 6.52176L20.3333 12.7867C20.3333 18.6535 15.8922 24.2319 10.6666 26.0652C5.44153 24.2316 1 18.6409 1 12.7867V6.52001C1 5.82357 1.42893 5.20343 2.08883 4.94803L10.0845 1.94967Z" stroke="currentColor" stroke-opacity="0.30" stroke-width="2"></path></svg>
|
234 |
+
|
235 |
+
No virus
|
236 |
+
</div>
|
237 |
+
|
238 |
+
<div class="dark:text-gray-300 sm:ml-auto">273 Bytes</div></div>
|
239 |
+
|
240 |
+
<div class="relative min-h-[100px] rounded-b-lg border border-t-0 leading-tight dark:border-gray-800 dark:bg-gray-925">
|
241 |
+
<div class="py-3"><div class="SVELTE_HYDRATER contents" data-props="{"lines":["<span class=\"hljs-selector-tag\">h1</span> {"," <span class=\"hljs-attribute\">text-align</span>: center;","}","<span class=\"hljs-selector-tag\">img</span><span class=\"hljs-selector-id\">#overview</span> {"," <span class=\"hljs-attribute\">max-width</span>: <span class=\"hljs-number\">1000px</span>;"," <span class=\"hljs-attribute\">max-height</span>: <span class=\"hljs-number\">600px</span>;"," <span class=\"hljs-attribute\">display</span>: block;"," <span class=\"hljs-attribute\">margin</span>: auto;","}","<span class=\"hljs-selector-tag\">img</span><span class=\"hljs-selector-id\">#style-image</span> {"," <span class=\"hljs-attribute\">max-width</span>: <span class=\"hljs-number\">1000px</span>;"," <span class=\"hljs-attribute\">max-height</span>: <span class=\"hljs-number\">600px</span>;"," <span class=\"hljs-attribute\">display</span>: block;"," <span class=\"hljs-attribute\">margin</span>: auto;","}","<span class=\"hljs-selector-tag\">img</span><span class=\"hljs-selector-id\">#visitor-badge</span> {"," <span class=\"hljs-attribute\">display</span>: block;"," <span class=\"hljs-attribute\">margin</span>: auto;","}"],"context":{"repo":{"name":"CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model","type":"space"},"revision":"626d7ffc7b07ba96290bd80cb09b73993f85bf40","path":"style.css"}}" data-target="BlobContent">
|
242 |
+
|
243 |
+
<div class="relative text-sm"><div class="overflow-x-auto"><table class="min-w-full border-collapse font-mono"><tbody><tr class="" id="L1">
|
244 |
+
|
245 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="1"></td>
|
246 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-selector-tag">h1</span> {<!-- HTML_TAG_END --></td>
|
247 |
+
</tr><tr class="" id="L2">
|
248 |
+
|
249 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="2"></td>
|
250 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-attribute">text-align</span>: center;<!-- HTML_TAG_END --></td>
|
251 |
+
</tr><tr class="" id="L3">
|
252 |
+
|
253 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="3"></td>
|
254 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->}<!-- HTML_TAG_END --></td>
|
255 |
+
</tr><tr class="" id="L4">
|
256 |
+
|
257 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="4"></td>
|
258 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-selector-tag">img</span><span class="hljs-selector-id">#overview</span> {<!-- HTML_TAG_END --></td>
|
259 |
+
</tr><tr class="" id="L5">
|
260 |
+
|
261 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="5"></td>
|
262 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-attribute">max-width</span>: <span class="hljs-number">1000px</span>;<!-- HTML_TAG_END --></td>
|
263 |
+
</tr><tr class="" id="L6">
|
264 |
+
|
265 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="6"></td>
|
266 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-attribute">max-height</span>: <span class="hljs-number">600px</span>;<!-- HTML_TAG_END --></td>
|
267 |
+
</tr><tr class="" id="L7">
|
268 |
+
|
269 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="7"></td>
|
270 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-attribute">display</span>: block;<!-- HTML_TAG_END --></td>
|
271 |
+
</tr><tr class="" id="L8">
|
272 |
+
|
273 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="8"></td>
|
274 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-attribute">margin</span>: auto;<!-- HTML_TAG_END --></td>
|
275 |
+
</tr><tr class="" id="L9">
|
276 |
+
|
277 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="9"></td>
|
278 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->}<!-- HTML_TAG_END --></td>
|
279 |
+
</tr><tr class="" id="L10">
|
280 |
+
|
281 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="10"></td>
|
282 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-selector-tag">img</span><span class="hljs-selector-id">#style-image</span> {<!-- HTML_TAG_END --></td>
|
283 |
+
</tr><tr class="" id="L11">
|
284 |
+
|
285 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="11"></td>
|
286 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-attribute">max-width</span>: <span class="hljs-number">1000px</span>;<!-- HTML_TAG_END --></td>
|
287 |
+
</tr><tr class="" id="L12">
|
288 |
+
|
289 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="12"></td>
|
290 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-attribute">max-height</span>: <span class="hljs-number">600px</span>;<!-- HTML_TAG_END --></td>
|
291 |
+
</tr><tr class="" id="L13">
|
292 |
+
|
293 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="13"></td>
|
294 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-attribute">display</span>: block;<!-- HTML_TAG_END --></td>
|
295 |
+
</tr><tr class="" id="L14">
|
296 |
+
|
297 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="14"></td>
|
298 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-attribute">margin</span>: auto;<!-- HTML_TAG_END --></td>
|
299 |
+
</tr><tr class="" id="L15">
|
300 |
+
|
301 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="15"></td>
|
302 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->}<!-- HTML_TAG_END --></td>
|
303 |
+
</tr><tr class="" id="L16">
|
304 |
+
|
305 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="16"></td>
|
306 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --><span class="hljs-selector-tag">img</span><span class="hljs-selector-id">#visitor-badge</span> {<!-- HTML_TAG_END --></td>
|
307 |
+
</tr><tr class="" id="L17">
|
308 |
+
|
309 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="17"></td>
|
310 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-attribute">display</span>: block;<!-- HTML_TAG_END --></td>
|
311 |
+
</tr><tr class="" id="L18">
|
312 |
+
|
313 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="18"></td>
|
314 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START --> <span class="hljs-attribute">margin</span>: auto;<!-- HTML_TAG_END --></td>
|
315 |
+
</tr><tr class="" id="L19">
|
316 |
+
|
317 |
+
<td class="blob-line-num w-1 cursor-pointer select-none pl-5 pr-3 text-right text-gray-300 hover:text-black" data-line-num="19"></td>
|
318 |
+
<td class="overflow-visible whitespace-pre px-3"><!-- HTML_TAG_START -->}<!-- HTML_TAG_END --></td>
|
319 |
+
</tr></tbody></table></div>
|
320 |
+
</div></div></div></div></section></div></main>
|
321 |
+
</div>
|
322 |
+
|
323 |
+
<script>
|
324 |
+
import("/front/build/kube-63b5efc/index.js");
|
325 |
+
window.moonSha = "kube-63b5efc/";
|
326 |
+
window.hubConfig = JSON.parse(`{"features":{"signupDisabled":false},"sshGitUrl":"[email protected]","moonHttpUrl":"https://huggingface.co","captchaApiKey":"bd5f2066-93dc-4bdd-a64b-a24646ca3859","captchaDisabledOnSignup":true,"datasetsServerPublicUrl":"https://datasets-server.huggingface.co","stripePublicKey":"pk_live_x2tdjFXBCvXo2FFmMybezpeM00J6gPCAAc","environment":"production","userAgent":"HuggingFace (production)"}`);
|
327 |
+
</script>
|
328 |
+
|
329 |
+
<!-- Stripe -->
|
330 |
+
<script>
|
331 |
+
if (["hf.co", "huggingface.co"].includes(window.location.hostname)) {
|
332 |
+
const script = document.createElement("script");
|
333 |
+
script.src = "https://js.stripe.com/v3/";
|
334 |
+
script.async = true;
|
335 |
+
document.head.appendChild(script);
|
336 |
+
}
|
337 |
+
</script>
|
338 |
+
|
339 |
+
<!-- Google analytics v4 -->
|
340 |
+
<script>
|
341 |
+
if (["hf.co", "huggingface.co"].includes(window.location.hostname)) {
|
342 |
+
const script = document.createElement("script");
|
343 |
+
script.src = "https://www.googletagmanager.com/gtag/js?id=G-8Q63TH4CSL";
|
344 |
+
script.async = true;
|
345 |
+
document.head.appendChild(script);
|
346 |
+
|
347 |
+
window.dataLayer = window.dataLayer || [];
|
348 |
+
function gtag() {
|
349 |
+
if (window.dataLayer !== undefined) {
|
350 |
+
window.dataLayer.push(arguments);
|
351 |
+
}
|
352 |
+
}
|
353 |
+
gtag("js", new Date());
|
354 |
+
gtag("config", "G-8Q63TH4CSL", { page_path: "/spaces/CVPR/Image-Animation-using-Thin-Plate-Spline-Motion-Model/blob/main/style.css" });
|
355 |
+
/// ^ See https://developers.google.com/analytics/devguides/collection/gtagjs/pages
|
356 |
+
gtag("consent", "default", { ad_storage: "denied", analytics_storage: "denied" });
|
357 |
+
/// ^ See https://developers.google.com/tag-platform/gtagjs/reference#consent
|
358 |
+
/// TODO: ask the user for their consent and update this with gtag('consent', 'update')
|
359 |
+
}
|
360 |
+
</script>
|
361 |
+
</body>
|
362 |
+
</html>
|