seawolf2357 toonist commited on
Commit
caf1564
·
0 Parent(s):

Duplicate from toonist/DualStyleGAN

Browse files

Co-authored-by: Pawan Kumar <toonist@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.jpg filter=lfs diff=lfs merge=lfs -text
2
+ *.7z filter=lfs diff=lfs merge=lfs -text
3
+ *.arrow filter=lfs diff=lfs merge=lfs -text
4
+ *.bin filter=lfs diff=lfs merge=lfs -text
5
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
6
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
7
+ *.ftz filter=lfs diff=lfs merge=lfs -text
8
+ *.gz filter=lfs diff=lfs merge=lfs -text
9
+ *.h5 filter=lfs diff=lfs merge=lfs -text
10
+ *.joblib filter=lfs diff=lfs merge=lfs -text
11
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.onnx filter=lfs diff=lfs merge=lfs -text
15
+ *.ot filter=lfs diff=lfs merge=lfs -text
16
+ *.parquet filter=lfs diff=lfs merge=lfs -text
17
+ *.pb filter=lfs diff=lfs merge=lfs -text
18
+ *.pt filter=lfs diff=lfs merge=lfs -text
19
+ *.pth filter=lfs diff=lfs merge=lfs -text
20
+ *.rar filter=lfs diff=lfs merge=lfs -text
21
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
22
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
23
+ *.tflite filter=lfs diff=lfs merge=lfs -text
24
+ *.tgz filter=lfs diff=lfs merge=lfs -text
25
+ *.xz filter=lfs diff=lfs merge=lfs -text
26
+ *.zip filter=lfs diff=lfs merge=lfs -text
27
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
28
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ shape_predictor_68_face_landmarks.dat*
.gitmodules ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [submodule "DualStyleGAN"]
2
+ path = DualStyleGAN
3
+ url = https://github.com/williamyang1991/DualStyleGAN
.pre-commit-config.yaml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.2.0
4
+ hooks:
5
+ - id: check-executables-have-shebangs
6
+ - id: check-json
7
+ - id: check-merge-conflict
8
+ - id: check-shebang-scripts-are-executable
9
+ - id: check-toml
10
+ - id: check-yaml
11
+ - id: double-quote-string-fixer
12
+ - id: end-of-file-fixer
13
+ - id: mixed-line-ending
14
+ args: ['--fix=lf']
15
+ - id: requirements-txt-fixer
16
+ - id: trailing-whitespace
17
+ - repo: https://github.com/myint/docformatter
18
+ rev: v1.4
19
+ hooks:
20
+ - id: docformatter
21
+ args: ['--in-place']
22
+ - repo: https://github.com/pycqa/isort
23
+ rev: 5.10.1
24
+ hooks:
25
+ - id: isort
26
+ - repo: https://github.com/pre-commit/mirrors-mypy
27
+ rev: v0.812
28
+ hooks:
29
+ - id: mypy
30
+ args: ['--ignore-missing-imports']
31
+ - repo: https://github.com/google/yapf
32
+ rev: v0.32.0
33
+ hooks:
34
+ - id: yapf
35
+ args: ['--parallel', '--in-place']
.style.yapf ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ [style]
2
+ based_on_style = pep8
3
+ blank_line_before_nested_class_or_def = false
4
+ spaces_before_comment = 2
5
+ split_before_logical_operator = true
DualStyleGAN ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit d9c52c2313913352cd2e35707f72fd450bf16630
README.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Portrait Style Transfer with DualStyleGAN
3
+ emoji: 😻
4
+ colorFrom: purple
5
+ colorTo: red
6
+ sdk: gradio
7
+ sdk_version: 3.0.15
8
+ app_file: app.py
9
+ pinned: false
10
+ duplicated_from: toonist/DualStyleGAN
11
+ ---
12
+
13
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
app.py ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import pathlib
7
+
8
+ import gradio as gr
9
+
10
+ from dualstylegan import Model
11
+
12
+ DESCRIPTION = '''# Portrait Style Transfer with <a href="https://github.com/williamyang1991/DualStyleGAN">DualStyleGAN</a>
13
+
14
+ <img id="overview" alt="overview" src="https://raw.githubusercontent.com/williamyang1991/DualStyleGAN/main/doc_images/overview.jpg" />
15
+ '''
16
+ FOOTER = '<img id="visitor-badge" alt="visitor badge" src="https://visitor-badge.glitch.me/badge?page_id=gradio-blocks.dualstylegan" />'
17
+
18
+
19
+ def parse_args() -> argparse.Namespace:
20
+ parser = argparse.ArgumentParser()
21
+ parser.add_argument('--device', type=str, default='cpu')
22
+ parser.add_argument('--theme', type=str)
23
+ parser.add_argument('--share', action='store_true')
24
+ parser.add_argument('--port', type=int)
25
+ parser.add_argument('--disable-queue',
26
+ dest='enable_queue',
27
+ action='store_false')
28
+ return parser.parse_args()
29
+
30
+
31
+ def get_style_image_url(style_name: str) -> str:
32
+ base_url = 'https://raw.githubusercontent.com/williamyang1991/DualStyleGAN/main/doc_images'
33
+ filenames = {
34
+ 'cartoon': 'cartoon_overview.jpg',
35
+ 'caricature': 'caricature_overview.jpg',
36
+ 'anime': 'anime_overview.jpg',
37
+ 'arcane': 'Reconstruction_arcane_overview.jpg',
38
+ 'comic': 'Reconstruction_comic_overview.jpg',
39
+ 'pixar': 'Reconstruction_pixar_overview.jpg',
40
+ 'slamdunk': 'Reconstruction_slamdunk_overview.jpg',
41
+ }
42
+ return f'{base_url}/{filenames[style_name]}'
43
+
44
+
45
+ def get_style_image_markdown_text(style_name: str) -> str:
46
+ url = get_style_image_url(style_name)
47
+ return f'<img id="style-image" src="{url}" alt="style image">'
48
+
49
+
50
+ def update_slider(choice: str) -> dict:
51
+ max_vals = {
52
+ 'cartoon': 316,
53
+ 'caricature': 198,
54
+ 'anime': 173,
55
+ 'arcane': 99,
56
+ 'comic': 100,
57
+ 'pixar': 121,
58
+ 'slamdunk': 119,
59
+ }
60
+ return gr.Slider.update(maximum=max_vals[choice])
61
+
62
+
63
+ def update_style_image(style_name: str) -> dict:
64
+ text = get_style_image_markdown_text(style_name)
65
+ return gr.Markdown.update(value=text)
66
+
67
+
68
+ def set_example_image(example: list) -> dict:
69
+ return gr.Image.update(value=example[0])
70
+
71
+
72
+ def set_example_styles(example: list) -> list[dict]:
73
+ return [
74
+ gr.Radio.update(value=example[0]),
75
+ gr.Slider.update(value=example[1]),
76
+ ]
77
+
78
+
79
+ def set_example_weights(example: list) -> list[dict]:
80
+ return [
81
+ gr.Slider.update(value=example[0]),
82
+ gr.Slider.update(value=example[1]),
83
+ ]
84
+
85
+
86
+ def main():
87
+ args = parse_args()
88
+ model = Model(device=args.device)
89
+
90
+ with gr.Blocks(theme=args.theme, css='style.css') as demo:
91
+ gr.Markdown(DESCRIPTION)
92
+
93
+ with gr.Box():
94
+ gr.Markdown('''## Step 1 (Preprocess Input Image)
95
+
96
+ - Drop an image containing a near-frontal face to the **Input Image**.
97
+ - If there are multiple faces in the image, hit the Edit button in the upper right corner and crop the input image beforehand.
98
+ - Hit the **Preprocess** button.
99
+ - The final result will be based on this **Reconstructed Face**. So, if the reconstructed image is not satisfactory, you may want to change the input image.
100
+ ''')
101
+ with gr.Row():
102
+ with gr.Column():
103
+ with gr.Row():
104
+ input_image = gr.Image(label='Input Image',
105
+ type='file')
106
+ with gr.Row():
107
+ preprocess_button = gr.Button('Preprocess')
108
+ with gr.Column():
109
+ with gr.Row():
110
+ aligned_face = gr.Image(label='Aligned Face',
111
+ type='numpy',
112
+ interactive=False)
113
+ with gr.Column():
114
+ reconstructed_face = gr.Image(label='Reconstructed Face',
115
+ type='numpy')
116
+ instyle = gr.Variable()
117
+
118
+ with gr.Row():
119
+ paths = sorted(pathlib.Path('images').glob('*.jpg'))
120
+ example_images = gr.Dataset(components=[input_image],
121
+ samples=[[path.as_posix()]
122
+ for path in paths])
123
+
124
+ with gr.Box():
125
+ gr.Markdown('''## Step 2 (Select Style Image)
126
+
127
+ - Select **Style Type**.
128
+ - Select **Style Image Index** from the image table below.
129
+ ''')
130
+ with gr.Row():
131
+ with gr.Column():
132
+ style_type = gr.Radio(model.style_types,
133
+ label='Style Type')
134
+ text = get_style_image_markdown_text('cartoon')
135
+ style_image = gr.Markdown(value=text)
136
+ style_index = gr.Slider(0,
137
+ 316,
138
+ value=26,
139
+ step=1,
140
+ label='Style Image Index')
141
+
142
+ with gr.Row():
143
+ example_styles = gr.Dataset(
144
+ components=[style_type, style_index],
145
+ samples=[
146
+ ['cartoon', 26],
147
+ ['caricature', 65],
148
+ ['arcane', 63],
149
+ ['pixar', 80],
150
+ ])
151
+
152
+ with gr.Box():
153
+ gr.Markdown('''## Step 3 (Generate Style Transferred Image)
154
+
155
+ - Adjust **Structure Weight** and **Color Weight**.
156
+ - These are weights for the style image, so the larger the value, the closer the resulting image will be to the style image.
157
+ - Hit the **Generate** button.
158
+ ''')
159
+ with gr.Row():
160
+ with gr.Column():
161
+ with gr.Row():
162
+ structure_weight = gr.Slider(0,
163
+ 1,
164
+ value=0.6,
165
+ step=0.1,
166
+ label='Structure Weight')
167
+ with gr.Row():
168
+ color_weight = gr.Slider(0,
169
+ 1,
170
+ value=1,
171
+ step=0.1,
172
+ label='Color Weight')
173
+ with gr.Row():
174
+ structure_only = gr.Checkbox(label='Structure Only')
175
+ with gr.Row():
176
+ generate_button = gr.Button('Generate')
177
+
178
+ with gr.Column():
179
+ result = gr.Image(label='Result')
180
+
181
+ with gr.Row():
182
+ example_weights = gr.Dataset(
183
+ components=[structure_weight, color_weight],
184
+ samples=[
185
+ [0.6, 1.0],
186
+ [0.3, 1.0],
187
+ [0.0, 1.0],
188
+ [1.0, 0.0],
189
+ ])
190
+
191
+ gr.Markdown(FOOTER)
192
+
193
+ preprocess_button.click(fn=model.detect_and_align_face,
194
+ inputs=input_image,
195
+ outputs=aligned_face)
196
+ aligned_face.change(fn=model.reconstruct_face,
197
+ inputs=aligned_face,
198
+ outputs=[
199
+ reconstructed_face,
200
+ instyle,
201
+ ])
202
+ style_type.change(fn=update_slider,
203
+ inputs=style_type,
204
+ outputs=style_index)
205
+ style_type.change(fn=update_style_image,
206
+ inputs=style_type,
207
+ outputs=style_image)
208
+ generate_button.click(fn=model.generate,
209
+ inputs=[
210
+ style_type,
211
+ style_index,
212
+ structure_weight,
213
+ color_weight,
214
+ structure_only,
215
+ instyle,
216
+ ],
217
+ outputs=result)
218
+ example_images.click(fn=set_example_image,
219
+ inputs=example_images,
220
+ outputs=example_images.components)
221
+ example_styles.click(fn=set_example_styles,
222
+ inputs=example_styles,
223
+ outputs=example_styles.components)
224
+ example_weights.click(fn=set_example_weights,
225
+ inputs=example_weights,
226
+ outputs=example_weights.components)
227
+
228
+ demo.launch(
229
+ enable_queue=args.enable_queue,
230
+ server_port=args.port,
231
+ share=args.share,
232
+ )
233
+
234
+
235
+ if __name__ == '__main__':
236
+ main()
dualstylegan.py ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import argparse
4
+ import os
5
+ import pathlib
6
+ import subprocess
7
+ import sys
8
+ from typing import Callable
9
+
10
+ import dlib
11
+ import huggingface_hub
12
+ import numpy as np
13
+ import PIL.Image
14
+ import torch
15
+ import torch.nn as nn
16
+ import torchvision.transforms as T
17
+
18
+ if os.getenv('SYSTEM') == 'spaces':
19
+ os.system("sed -i '10,17d' DualStyleGAN/model/stylegan/op/fused_act.py")
20
+ os.system("sed -i '10,17d' DualStyleGAN/model/stylegan/op/upfirdn2d.py")
21
+
22
+ app_dir = pathlib.Path(__file__).parent
23
+ submodule_dir = app_dir / 'DualStyleGAN'
24
+ sys.path.insert(0, submodule_dir.as_posix())
25
+
26
+ from model.dualstylegan import DualStyleGAN
27
+ from model.encoder.align_all_parallel import align_face
28
+ from model.encoder.psp import pSp
29
+
30
+ MODEL_REPO = 'CVPR/DualStyleGAN'
31
+
32
+
33
+ class Model:
34
+ def __init__(self, device: torch.device | str):
35
+ self.device = torch.device(device)
36
+ self.landmark_model = self._create_dlib_landmark_model()
37
+ self.encoder = self._load_encoder()
38
+ self.transform = self._create_transform()
39
+
40
+ self.style_types = [
41
+ 'cartoon',
42
+ 'caricature',
43
+ 'anime',
44
+ 'arcane',
45
+ 'comic',
46
+ 'pixar',
47
+ 'slamdunk',
48
+ ]
49
+ self.generator_dict = {
50
+ style_type: self._load_generator(style_type)
51
+ for style_type in self.style_types
52
+ }
53
+ self.exstyle_dict = {
54
+ style_type: self._load_exstylecode(style_type)
55
+ for style_type in self.style_types
56
+ }
57
+
58
+ @staticmethod
59
+ def _create_dlib_landmark_model():
60
+ url = 'http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2'
61
+ path = pathlib.Path('shape_predictor_68_face_landmarks.dat')
62
+ if not path.exists():
63
+ bz2_path = 'shape_predictor_68_face_landmarks.dat.bz2'
64
+ torch.hub.download_url_to_file(url, bz2_path)
65
+ subprocess.run(f'bunzip2 -d {bz2_path}'.split())
66
+ return dlib.shape_predictor(path.as_posix())
67
+
68
+ def _load_encoder(self) -> nn.Module:
69
+ ckpt_path = huggingface_hub.hf_hub_download(MODEL_REPO,
70
+ 'models/encoder.pt')
71
+ ckpt = torch.load(ckpt_path, map_location='cpu')
72
+ opts = ckpt['opts']
73
+ opts['device'] = self.device.type
74
+ opts['checkpoint_path'] = ckpt_path
75
+ opts = argparse.Namespace(**opts)
76
+ model = pSp(opts)
77
+ model.to(self.device)
78
+ model.eval()
79
+ return model
80
+
81
+ @staticmethod
82
+ def _create_transform() -> Callable:
83
+ transform = T.Compose([
84
+ T.Resize(256),
85
+ T.CenterCrop(256),
86
+ T.ToTensor(),
87
+ T.Normalize([0.5, 0.5, 0.5], [0.5, 0.5, 0.5]),
88
+ ])
89
+ return transform
90
+
91
+ def _load_generator(self, style_type: str) -> nn.Module:
92
+ model = DualStyleGAN(1024, 512, 8, 2, res_index=6)
93
+ ckpt_path = huggingface_hub.hf_hub_download(
94
+ MODEL_REPO, f'models/{style_type}/generator.pt')
95
+ ckpt = torch.load(ckpt_path, map_location='cpu')
96
+ model.load_state_dict(ckpt['g_ema'])
97
+ model.to(self.device)
98
+ model.eval()
99
+ return model
100
+
101
+ @staticmethod
102
+ def _load_exstylecode(style_type: str) -> dict[str, np.ndarray]:
103
+ if style_type in ['cartoon', 'caricature', 'anime']:
104
+ filename = 'refined_exstyle_code.npy'
105
+ else:
106
+ filename = 'exstyle_code.npy'
107
+ path = huggingface_hub.hf_hub_download(
108
+ MODEL_REPO, f'models/{style_type}/{filename}')
109
+ exstyles = np.load(path, allow_pickle=True).item()
110
+ return exstyles
111
+
112
+ def detect_and_align_face(self, image) -> np.ndarray:
113
+ image = align_face(filepath=image.name, predictor=self.landmark_model)
114
+ return image
115
+
116
+ @staticmethod
117
+ def denormalize(tensor: torch.Tensor) -> torch.Tensor:
118
+ return torch.clamp((tensor + 1) / 2 * 255, 0, 255).to(torch.uint8)
119
+
120
+ def postprocess(self, tensor: torch.Tensor) -> np.ndarray:
121
+ tensor = self.denormalize(tensor)
122
+ return tensor.cpu().numpy().transpose(1, 2, 0)
123
+
124
+ @torch.inference_mode()
125
+ def reconstruct_face(self,
126
+ image: np.ndarray) -> tuple[np.ndarray, torch.Tensor]:
127
+ image = PIL.Image.fromarray(image)
128
+ input_data = self.transform(image).unsqueeze(0).to(self.device)
129
+ img_rec, instyle = self.encoder(input_data,
130
+ randomize_noise=False,
131
+ return_latents=True,
132
+ z_plus_latent=True,
133
+ return_z_plus_latent=True,
134
+ resize=False)
135
+ img_rec = torch.clamp(img_rec.detach(), -1, 1)
136
+ img_rec = self.postprocess(img_rec[0])
137
+ return img_rec, instyle
138
+
139
+ @torch.inference_mode()
140
+ def generate(self, style_type: str, style_id: int, structure_weight: float,
141
+ color_weight: float, structure_only: bool,
142
+ instyle: torch.Tensor) -> np.ndarray:
143
+ generator = self.generator_dict[style_type]
144
+ exstyles = self.exstyle_dict[style_type]
145
+
146
+ style_id = int(style_id)
147
+ stylename = list(exstyles.keys())[style_id]
148
+
149
+ latent = torch.tensor(exstyles[stylename]).to(self.device)
150
+ if structure_only:
151
+ latent[0, 7:18] = instyle[0, 7:18]
152
+ exstyle = generator.generator.style(
153
+ latent.reshape(latent.shape[0] * latent.shape[1],
154
+ latent.shape[2])).reshape(latent.shape)
155
+
156
+ img_gen, _ = generator([instyle],
157
+ exstyle,
158
+ z_plus_latent=True,
159
+ truncation=0.7,
160
+ truncation_latent=0,
161
+ use_res=True,
162
+ interp_weights=[structure_weight] * 7 +
163
+ [color_weight] * 11)
164
+ img_gen = torch.clamp(img_gen.detach(), -1, 1)
165
+ img_gen = self.postprocess(img_gen[0])
166
+ return img_gen
images/95UF6LXe-Lo.jpg ADDED

Git LFS Details

  • SHA256: 9ba751a6519822fa683e062ee3a383e748f15b41d4ca87d14c4fa73f9beed845
  • Pointer size: 131 Bytes
  • Size of remote file: 503 kB
images/ILip77SbmOE.jpg ADDED

Git LFS Details

  • SHA256: 3eed82923bc76a90f067415f148d56239fdfa4a1aca9eef1d459bc6050c9dde8
  • Pointer size: 131 Bytes
  • Size of remote file: 939 kB
images/README.md ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ These images are freely-usable ones from [Unsplash](https://unsplash.com/).
2
+
3
+ - https://unsplash.com/photos/rDEOVtE7vOs
4
+ - https://unsplash.com/photos/et_78QkMMQs
5
+ - https://unsplash.com/photos/ILip77SbmOE
6
+ - https://unsplash.com/photos/95UF6LXe-Lo
images/et_78QkMMQs.jpg ADDED

Git LFS Details

  • SHA256: c63a2e9de5eda3cb28012cfc8e4ba9384daeda8cca7a8989ad90b21a1293cc6f
  • Pointer size: 131 Bytes
  • Size of remote file: 371 kB
images/rDEOVtE7vOs.jpg ADDED

Git LFS Details

  • SHA256: b136bf195fef5599f277a563f0eef79af5301d9352d4ebf82bd7a0a061b7bdc0
  • Pointer size: 131 Bytes
  • Size of remote file: 155 kB
packages.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ bzip2
2
+ cmake
3
+ ninja-build
requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ dlib==19.23.0
2
+ numpy==1.22.3
3
+ opencv-python-headless==4.5.5.62
4
+ Pillow==9.0.1
5
+ scipy==1.8.0
6
+ torch==1.11.0
7
+ torchvision==0.12.0
style.css ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ h1 {
2
+ text-align: center;
3
+ }
4
+ img#overview {
5
+ max-width: 1000px;
6
+ max-height: 600px;
7
+ display: block;
8
+ margin: auto;
9
+ }
10
+ img#style-image {
11
+ max-width: 1000px;
12
+ max-height: 600px;
13
+ display: block;
14
+ margin: auto;
15
+ }
16
+ img#visitor-badge {
17
+ display: block;
18
+ margin: auto;
19
+ }