.pre-commit-config.yaml CHANGED
@@ -1,61 +1,46 @@
1
- exclude: ^patch
2
  repos:
3
- - repo: https://github.com/pre-commit/pre-commit-hooks
4
- rev: v4.6.0
5
- hooks:
6
- - id: check-executables-have-shebangs
7
- - id: check-json
8
- - id: check-merge-conflict
9
- - id: check-shebang-scripts-are-executable
10
- - id: check-toml
11
- - id: check-yaml
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.7.5
19
- hooks:
20
- - id: docformatter
21
- args: ["--in-place"]
22
- - repo: https://github.com/pycqa/isort
23
- rev: 5.13.2
24
- hooks:
25
- - id: isort
26
- args: ["--profile", "black"]
27
- - repo: https://github.com/pre-commit/mirrors-mypy
28
- rev: v1.10.0
29
- hooks:
30
- - id: mypy
31
- args: ["--ignore-missing-imports"]
32
- additional_dependencies:
33
- [
34
- "types-python-slugify",
35
- "types-requests",
36
- "types-PyYAML",
37
- "types-pytz",
38
- ]
39
- - repo: https://github.com/psf/black
40
- rev: 24.4.2
41
- hooks:
42
- - id: black
43
- language_version: python3.10
44
- args: ["--line-length", "119"]
45
- - repo: https://github.com/kynan/nbstripout
46
- rev: 0.7.1
47
- hooks:
48
- - id: nbstripout
49
- args:
50
- [
51
- "--extra-keys",
52
- "metadata.interpreter metadata.kernelspec cell.metadata.pycharm",
53
- ]
54
- - repo: https://github.com/nbQA-dev/nbQA
55
- rev: 1.8.5
56
- hooks:
57
- - id: nbqa-black
58
- - id: nbqa-pyupgrade
59
- args: ["--py37-plus"]
60
- - id: nbqa-isort
61
- args: ["--float-to-top"]
 
1
+ exclude: ^(Text2Human|patch)
2
  repos:
3
+ - repo: https://github.com/pre-commit/pre-commit-hooks
4
+ rev: v4.2.0
5
+ hooks:
6
+ - id: check-executables-have-shebangs
7
+ - id: check-json
8
+ - id: check-merge-conflict
9
+ - id: check-shebang-scripts-are-executable
10
+ - id: check-toml
11
+ - id: check-yaml
12
+ - id: double-quote-string-fixer
13
+ - id: end-of-file-fixer
14
+ - id: mixed-line-ending
15
+ args: ['--fix=lf']
16
+ - id: requirements-txt-fixer
17
+ - id: trailing-whitespace
18
+ - repo: https://github.com/myint/docformatter
19
+ rev: v1.4
20
+ hooks:
21
+ - id: docformatter
22
+ args: ['--in-place']
23
+ - repo: https://github.com/pycqa/isort
24
+ rev: 5.10.1
25
+ hooks:
26
+ - id: isort
27
+ - repo: https://github.com/pre-commit/mirrors-mypy
28
+ rev: v0.812
29
+ hooks:
30
+ - id: mypy
31
+ args: ['--ignore-missing-imports']
32
+ - repo: https://github.com/google/yapf
33
+ rev: v0.32.0
34
+ hooks:
35
+ - id: yapf
36
+ args: ['--parallel', '--in-place']
37
+ - repo: https://github.com/kynan/nbstripout
38
+ rev: 0.5.0
39
+ hooks:
40
+ - id: nbstripout
41
+ args: ['--extra-keys', 'metadata.interpreter metadata.kernelspec cell.metadata.pycharm']
42
+ - repo: https://github.com/nbQA-dev/nbQA
43
+ rev: 1.3.1
44
+ hooks:
45
+ - id: nbqa-isort
46
+ - id: nbqa-yapf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.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
README.md CHANGED
@@ -4,10 +4,9 @@ emoji: 🏃
4
  colorFrom: purple
5
  colorTo: gray
6
  sdk: gradio
7
- sdk_version: 4.36.1
8
  app_file: app.py
9
  pinned: false
10
- suggested_hardware: t4-small
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
 
4
  colorFrom: purple
5
  colorTo: gray
6
  sdk: gradio
7
+ sdk_version: 3.0.17
8
  app_file: app.py
9
  pinned: false
 
10
  ---
11
 
12
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
app.py CHANGED
@@ -2,132 +2,157 @@
2
 
3
  from __future__ import annotations
4
 
 
5
  import os
6
  import pathlib
7
- import random
8
- import shlex
9
  import subprocess
10
 
11
- if os.getenv("SYSTEM") == "spaces":
12
- subprocess.run(shlex.split("pip install click==7.1.2"))
13
- subprocess.run(shlex.split("pip install typer==0.9.4"))
14
 
 
15
  import mim
16
 
17
- mim.uninstall("mmcv-full", confirm_yes=True)
18
- mim.install("mmcv-full==1.5.2", is_yes=True)
19
-
20
- with open("patch") as f:
21
- subprocess.run(shlex.split("patch -p1"), cwd="Text2Human", stdin=f)
22
 
23
-
24
- import gradio as gr
25
- import numpy as np
26
 
27
  from model import Model
28
 
29
- DESCRIPTION = """# [Text2Human](https://github.com/yumingj/Text2Human)
30
 
 
31
  You can modify sample steps and seeds. By varying seeds, you can sample different human images under the same pose, shape description, and texture description. The larger the sample steps, the better quality of the generated images. (The default value of sample steps is 256 in the original repo.)
32
 
33
  Label image generation step can be skipped. However, in that case, the input label image must be 512x256 in size and must contain only the specified colors.
34
- """
35
-
36
- MAX_SEED = np.iinfo(np.int32).max
37
-
38
-
39
- def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
40
- if randomize_seed:
41
- seed = random.randint(0, MAX_SEED)
42
- return seed
43
-
44
-
45
- model = Model()
46
-
47
- with gr.Blocks(css="style.css") as demo:
48
- gr.Markdown(DESCRIPTION)
49
-
50
- with gr.Row():
51
- with gr.Column():
52
- with gr.Row():
53
- input_image = gr.Image(label="Input Pose Image", type="pil", elem_id="input-image")
54
- pose_data = gr.State()
55
- with gr.Row():
56
- paths = sorted(pathlib.Path("pose_images").glob("*.png"))
57
- gr.Examples(examples=[[path.as_posix()] for path in paths], inputs=input_image)
58
-
59
- with gr.Row():
60
- shape_text = gr.Textbox(
61
- label="Shape Description",
62
- placeholder="""<gender>, <sleeve length>, <length of lower clothing>, <outer clothing type>, <other accessories1>, ...
63
- Note: The outer clothing type and accessories can be omitted.""",
64
- )
65
- with gr.Row():
66
- gr.Examples(
67
- examples=[["man, sleeveless T-shirt, long pants"], ["woman, short-sleeve T-shirt, short jeans"]],
68
- inputs=shape_text,
69
- )
70
- with gr.Row():
71
- generate_label_button = gr.Button("Generate Label Image")
72
-
73
- with gr.Column():
74
- with gr.Row():
75
- label_image = gr.Image(label="Label Image", type="numpy", format="png", elem_id="label-image")
76
-
77
- with gr.Row():
78
- texture_text = gr.Textbox(
79
- label="Texture Description",
80
- placeholder="""<upper clothing texture>, <lower clothing texture>, <outer clothing texture>
81
- Note: Currently, only 5 types of textures are supported, i.e., pure color, stripe/spline, plaid/lattice, floral, denim.""",
82
- )
83
- with gr.Row():
84
- gr.Examples(
85
- examples=[
86
- ["pure color, denim"],
87
- ["floral, stripe"],
88
- ],
89
- inputs=texture_text,
90
- )
91
- with gr.Row():
92
- sample_steps = gr.Slider(label="Sample Steps", minimum=10, maximum=300, step=1, value=256)
93
- with gr.Row():
94
- seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0)
95
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
96
- with gr.Row():
97
- generate_human_button = gr.Button("Generate Human")
98
-
99
- with gr.Column():
100
- with gr.Row():
101
- result = gr.Image(label="Result")
102
-
103
- input_image.change(
104
- fn=model.process_pose_image,
105
- inputs=input_image,
106
- outputs=pose_data,
107
- )
108
- generate_label_button.click(
109
- fn=model.generate_label_image,
110
- inputs=[
111
- pose_data,
112
- shape_text,
113
- ],
114
- outputs=label_image,
115
- )
116
- generate_human_button.click(
117
- fn=randomize_seed_fn,
118
- inputs=[seed, randomize_seed],
119
- outputs=seed,
120
- queue=False,
121
- ).then(
122
- fn=model.generate_human,
123
- inputs=[
124
- label_image,
125
- texture_text,
126
- sample_steps,
127
- seed,
128
- ],
129
- outputs=result,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  )
131
 
132
- if __name__ == "__main__":
133
- demo.queue(max_size=10).launch()
 
 
2
 
3
  from __future__ import annotations
4
 
5
+ import argparse
6
  import os
7
  import pathlib
 
 
8
  import subprocess
9
 
10
+ import gradio as gr
 
 
11
 
12
+ if os.getenv('SYSTEM') == 'spaces':
13
  import mim
14
 
15
+ mim.uninstall('mmcv-full', confirm_yes=True)
16
+ mim.install('mmcv-full==1.5.2', is_yes=True)
 
 
 
17
 
18
+ with open('patch') as f:
19
+ subprocess.run('patch -p1'.split(), cwd='Text2Human', stdin=f)
 
20
 
21
  from model import Model
22
 
23
+ DESCRIPTION = '''# Text2Human
24
 
25
+ This is an unofficial demo for <a href="https://github.com/yumingj/Text2Human">https://github.com/yumingj/Text2Human</a>.
26
  You can modify sample steps and seeds. By varying seeds, you can sample different human images under the same pose, shape description, and texture description. The larger the sample steps, the better quality of the generated images. (The default value of sample steps is 256 in the original repo.)
27
 
28
  Label image generation step can be skipped. However, in that case, the input label image must be 512x256 in size and must contain only the specified colors.
29
+ '''
30
+ FOOTER = '<img id="visitor-badge" alt="visitor badge" src="https://visitor-badge.glitch.me/badge?page_id=hysts.text2human" />'
31
+
32
+
33
+ def parse_args() -> argparse.Namespace:
34
+ parser = argparse.ArgumentParser()
35
+ parser.add_argument('--device', type=str, default='cpu')
36
+ parser.add_argument('--theme', type=str)
37
+ parser.add_argument('--share', action='store_true')
38
+ parser.add_argument('--port', type=int)
39
+ parser.add_argument('--disable-queue',
40
+ dest='enable_queue',
41
+ action='store_false')
42
+ return parser.parse_args()
43
+
44
+
45
+ def set_example_image(example: list) -> dict:
46
+ return gr.Image.update(value=example[0])
47
+
48
+
49
+ def set_example_text(example: list) -> dict:
50
+ return gr.Textbox.update(value=example[0])
51
+
52
+
53
+ def main():
54
+ args = parse_args()
55
+ model = Model(args.device)
56
+
57
+ with gr.Blocks(theme=args.theme, css='style.css') as demo:
58
+ gr.Markdown(DESCRIPTION)
59
+
60
+ with gr.Row():
61
+ with gr.Column():
62
+ with gr.Row():
63
+ input_image = gr.Image(label='Input Pose Image',
64
+ type='pil',
65
+ elem_id='input-image')
66
+ pose_data = gr.Variable()
67
+ with gr.Row():
68
+ paths = sorted(pathlib.Path('pose_images').glob('*.png'))
69
+ example_images = gr.Dataset(components=[input_image],
70
+ samples=[[path.as_posix()]
71
+ for path in paths])
72
+
73
+ with gr.Row():
74
+ shape_text = gr.Textbox(
75
+ label='Shape Description',
76
+ placeholder=
77
+ '''<gender>, <sleeve length>, <length of lower clothing>, <outer clothing type>, <other accessories1>, ...
78
+ Note: The outer clothing type and accessories can be omitted.''')
79
+ with gr.Row():
80
+ shape_example_texts = gr.Dataset(
81
+ components=[shape_text],
82
+ samples=[['man, sleeveless T-shirt, long pants'],
83
+ ['woman, short-sleeve T-shirt, short jeans']])
84
+ with gr.Row():
85
+ generate_label_button = gr.Button('Generate Label Image')
86
+
87
+ with gr.Column():
88
+ with gr.Row():
89
+ label_image = gr.Image(label='Label Image',
90
+ type='numpy',
91
+ elem_id='label-image')
92
+
93
+ with gr.Row():
94
+ texture_text = gr.Textbox(
95
+ label='Texture Description',
96
+ placeholder=
97
+ '''<upper clothing texture>, <lower clothing texture>, <outer clothing texture>
98
+ Note: Currently, only 5 types of textures are supported, i.e., pure color, stripe/spline, plaid/lattice, floral, denim.'''
99
+ )
100
+ with gr.Row():
101
+ texture_example_texts = gr.Dataset(
102
+ components=[texture_text],
103
+ samples=[['pure color, denim'], ['floral, stripe']])
104
+ with gr.Row():
105
+ sample_steps = gr.Slider(10,
106
+ 300,
107
+ value=10,
108
+ step=10,
109
+ label='Sample Steps')
110
+ with gr.Row():
111
+ seed = gr.Slider(0, 1000000, value=0, step=1, label='Seed')
112
+ with gr.Row():
113
+ generate_human_button = gr.Button('Generate Human')
114
+
115
+ with gr.Column():
116
+ with gr.Row():
117
+ result = gr.Image(label='Result',
118
+ type='numpy',
119
+ elem_id='result-image')
120
+
121
+ gr.Markdown(FOOTER)
122
+
123
+ input_image.change(fn=model.process_pose_image,
124
+ inputs=input_image,
125
+ outputs=pose_data)
126
+ generate_label_button.click(fn=model.generate_label_image,
127
+ inputs=[
128
+ pose_data,
129
+ shape_text,
130
+ ],
131
+ outputs=label_image)
132
+ generate_human_button.click(fn=model.generate_human,
133
+ inputs=[
134
+ label_image,
135
+ texture_text,
136
+ sample_steps,
137
+ seed,
138
+ ],
139
+ outputs=result)
140
+ example_images.click(fn=set_example_image,
141
+ inputs=example_images,
142
+ outputs=example_images.components)
143
+ shape_example_texts.click(fn=set_example_text,
144
+ inputs=shape_example_texts,
145
+ outputs=shape_example_texts.components)
146
+ texture_example_texts.click(fn=set_example_text,
147
+ inputs=texture_example_texts,
148
+ outputs=texture_example_texts.components)
149
+
150
+ demo.launch(
151
+ enable_queue=args.enable_queue,
152
+ server_port=args.port,
153
+ share=args.share,
154
  )
155
 
156
+
157
+ if __name__ == '__main__':
158
+ main()
model.py CHANGED
@@ -1,5 +1,6 @@
1
  from __future__ import annotations
2
 
 
3
  import pathlib
4
  import sys
5
  import zipfile
@@ -9,10 +10,11 @@ import numpy as np
9
  import PIL.Image
10
  import torch
11
 
12
- sys.path.insert(0, "Text2Human")
13
 
14
  from models.sample_model import SampleFromPoseModel
15
- from utils.language_utils import generate_shape_attributes, generate_texture_attributes
 
16
  from utils.options import dict_to_nonedict, parse
17
  from utils.util import set_random_seed
18
 
@@ -45,37 +47,39 @@ COLOR_LIST = [
45
 
46
 
47
  class Model:
48
- def __init__(self):
49
- device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
50
  self.config = self._load_config()
51
- self.config["device"] = device.type
52
  self._download_models()
53
  self.model = SampleFromPoseModel(self.config)
54
  self.model.batch_size = 1
55
 
56
  def _load_config(self) -> dict:
57
- path = "Text2Human/configs/sample_from_pose.yml"
58
  config = parse(path, is_train=False)
59
  config = dict_to_nonedict(config)
60
  return config
61
 
62
  def _download_models(self) -> None:
63
- model_dir = pathlib.Path("pretrained_models")
64
  if model_dir.exists():
65
  return
66
- path = huggingface_hub.hf_hub_download("yumingj/Text2Human_SSHQ", "pretrained_models.zip")
 
 
 
67
  model_dir.mkdir()
68
  with zipfile.ZipFile(path) as f:
69
  f.extractall(model_dir)
70
 
71
  @staticmethod
72
  def preprocess_pose_image(image: PIL.Image.Image) -> torch.Tensor:
73
- image = (
74
- np.array(image.resize(size=(256, 512), resample=PIL.Image.Resampling.LANCZOS))[:, :, 2:]
75
- .transpose(2, 0, 1)
76
- .astype(np.float32)
77
- )
78
- image = image / 12.0 - 1
79
  data = torch.from_numpy(image).unsqueeze(1)
80
  return data
81
 
@@ -105,7 +109,8 @@ class Model:
105
  self.model.feed_pose_data(data)
106
  return data
107
 
108
- def generate_label_image(self, pose_data: torch.Tensor, shape_text: str) -> np.ndarray:
 
109
  if pose_data is None:
110
  return
111
  self.model.feed_pose_data(pose_data)
@@ -117,14 +122,16 @@ class Model:
117
  colored_segm = self.model.palette_result(self.model.segm[0].cpu())
118
  return colored_segm
119
 
120
- def generate_human(self, label_image: np.ndarray, texture_text: str, sample_steps: int, seed: int) -> np.ndarray:
 
121
  if label_image is None:
122
  return
123
  mask = label_image.copy()
124
  seg_map = self.process_mask(mask)
125
  if seg_map is None:
126
  return
127
- self.model.segm = torch.from_numpy(seg_map).unsqueeze(0).unsqueeze(0).to(self.model.device)
 
128
  self.model.generate_quantized_segm()
129
 
130
  set_random_seed(seed)
 
1
  from __future__ import annotations
2
 
3
+ import os
4
  import pathlib
5
  import sys
6
  import zipfile
 
10
  import PIL.Image
11
  import torch
12
 
13
+ sys.path.insert(0, 'Text2Human')
14
 
15
  from models.sample_model import SampleFromPoseModel
16
+ from utils.language_utils import (generate_shape_attributes,
17
+ generate_texture_attributes)
18
  from utils.options import dict_to_nonedict, parse
19
  from utils.util import set_random_seed
20
 
 
47
 
48
 
49
  class Model:
50
+ def __init__(self, device: str):
 
51
  self.config = self._load_config()
52
+ self.config['device'] = device
53
  self._download_models()
54
  self.model = SampleFromPoseModel(self.config)
55
  self.model.batch_size = 1
56
 
57
  def _load_config(self) -> dict:
58
+ path = 'Text2Human/configs/sample_from_pose.yml'
59
  config = parse(path, is_train=False)
60
  config = dict_to_nonedict(config)
61
  return config
62
 
63
  def _download_models(self) -> None:
64
+ model_dir = pathlib.Path('pretrained_models')
65
  if model_dir.exists():
66
  return
67
+ token = os.getenv('HF_TOKEN')
68
+ path = huggingface_hub.hf_hub_download('hysts/Text2Human',
69
+ 'orig/pretrained_models.zip',
70
+ use_auth_token=token)
71
  model_dir.mkdir()
72
  with zipfile.ZipFile(path) as f:
73
  f.extractall(model_dir)
74
 
75
  @staticmethod
76
  def preprocess_pose_image(image: PIL.Image.Image) -> torch.Tensor:
77
+ image = np.array(
78
+ image.resize(
79
+ size=(256, 512),
80
+ resample=PIL.Image.Resampling.LANCZOS))[:, :, 2:].transpose(
81
+ 2, 0, 1).astype(np.float32)
82
+ image = image / 12. - 1
83
  data = torch.from_numpy(image).unsqueeze(1)
84
  return data
85
 
 
109
  self.model.feed_pose_data(data)
110
  return data
111
 
112
+ def generate_label_image(self, pose_data: torch.Tensor,
113
+ shape_text: str) -> np.ndarray:
114
  if pose_data is None:
115
  return
116
  self.model.feed_pose_data(pose_data)
 
122
  colored_segm = self.model.palette_result(self.model.segm[0].cpu())
123
  return colored_segm
124
 
125
+ def generate_human(self, label_image: np.ndarray, texture_text: str,
126
+ sample_steps: int, seed: int) -> np.ndarray:
127
  if label_image is None:
128
  return
129
  mask = label_image.copy()
130
  seg_map = self.process_mask(mask)
131
  if seg_map is None:
132
  return
133
+ self.model.segm = torch.from_numpy(seg_map).unsqueeze(0).unsqueeze(
134
+ 0).to(self.model.device)
135
  self.model.generate_quantized_segm()
136
 
137
  set_random_seed(seed)
pose_images/001.png CHANGED

Git LFS Details

  • SHA256: 83f059e8281483a1c8848c9e190813f2e4eb56b0bfa866cf004e87f019ef4d2c
  • Pointer size: 130 Bytes
  • Size of remote file: 48.7 kB

Git LFS Details

  • SHA256: 35b68667f2f2eb5a287ffede8e496e9db920be78871fda73b24598ed0f85dcc4
  • Pointer size: 131 Bytes
  • Size of remote file: 135 kB
pose_images/002.png CHANGED

Git LFS Details

  • SHA256: 0fe37d3d227a61259faa032f7430c95fb1162758545d02e1f4c6bd4cd2bc99fc
  • Pointer size: 130 Bytes
  • Size of remote file: 43.4 kB

Git LFS Details

  • SHA256: e109163ba1ebfe4c3323ac700e1e6dd9443d5d3cf7e468a3587de7fc40383fa8
  • Pointer size: 131 Bytes
  • Size of remote file: 116 kB
pose_images/003.png CHANGED

Git LFS Details

  • SHA256: 83f059e8281483a1c8848c9e190813f2e4eb56b0bfa866cf004e87f019ef4d2c
  • Pointer size: 130 Bytes
  • Size of remote file: 48.7 kB

Git LFS Details

  • SHA256: 35b68667f2f2eb5a287ffede8e496e9db920be78871fda73b24598ed0f85dcc4
  • Pointer size: 131 Bytes
  • Size of remote file: 135 kB
pose_images/004.png CHANGED

Git LFS Details

  • SHA256: 43a71489b88a0bfb8c3a035f62599534cdd6df7b2adb188be4da351819709de1
  • Pointer size: 130 Bytes
  • Size of remote file: 45.8 kB

Git LFS Details

  • SHA256: de2aa00f09620cd8c33e722d1eab610ea99cd473d5ce4541275e04ab5e642d99
  • Pointer size: 131 Bytes
  • Size of remote file: 122 kB
pose_images/005.png CHANGED

Git LFS Details

  • SHA256: 9bd8833ace00dd3c97eb858e5b87d6803e0611fd718234699329bad7e4f906f1
  • Pointer size: 130 Bytes
  • Size of remote file: 45.7 kB

Git LFS Details

  • SHA256: 69f6511b2e9a50c77650bd796ccf144d3c5dc12dda84ba899b6e5beb8de052de
  • Pointer size: 131 Bytes
  • Size of remote file: 137 kB
requirements.txt CHANGED
@@ -1,12 +1,12 @@
1
- einops==0.6.1
2
  lpips==0.1.4
3
  mmcv-full==1.5.2
4
  mmsegmentation==0.24.1
5
- numpy==1.23.5
6
  openmim==0.1.5
7
- Pillow==9.5.0
8
- sentence-transformers==2.2.2
9
- tokenizers==0.13.3
10
  torch==1.11.0
11
  torchvision==0.12.0
12
- transformers==4.30.2
 
1
+ einops==0.4.1
2
  lpips==0.1.4
3
  mmcv-full==1.5.2
4
  mmsegmentation==0.24.1
5
+ numpy==1.22.3
6
  openmim==0.1.5
7
+ Pillow==9.1.1
8
+ sentence-transformers==2.2.0
9
+ tokenizers==0.12.1
10
  torch==1.11.0
11
  torchvision==0.12.0
12
+ transformers==4.19.2
style.css CHANGED
@@ -1,10 +1,16 @@
1
  h1 {
2
  text-align: center;
3
- display: block;
4
  }
5
  #input-image {
6
  max-height: 300px;
7
  }
8
  #label-image {
9
- max-height: 300px;
 
 
 
 
 
 
 
10
  }
 
1
  h1 {
2
  text-align: center;
 
3
  }
4
  #input-image {
5
  max-height: 300px;
6
  }
7
  #label-image {
8
+ height: 300px;
9
+ }
10
+ #result-image {
11
+ height: 300px;
12
+ }
13
+ img#visitor-badge {
14
+ display: block;
15
+ margin: auto;
16
  }