bigdefence commited on
Commit
7e5436e
1 Parent(s): 85620c0

Upload 5 files

Browse files
Files changed (5) hide show
  1. app.py +268 -0
  2. facescore.h5 +3 -0
  3. model.py +110 -0
  4. requirements.txt +9 -0
  5. weights/face_paint_512_v2.pt +3 -0
app.py ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import numpy as np
3
+ import google.generativeai as genai
4
+ from PIL import Image, ImageOps
5
+ import mediapipe as mp
6
+ import cv2
7
+ from tensorflow.keras.models import load_model
8
+ import os
9
+ import suno
10
+ from PIL import Image
11
+ from torchvision.transforms.functional import to_tensor, to_pil_image
12
+ from model import Generator
13
+ import gradio as gr
14
+ from diffusers import DiffusionPipeline
15
+ import spaces
16
+
17
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
18
+
19
+ GEMINI_MODEL = 'gemini-1.5-flash'
20
+ @spaces.GPU
21
+ def load_models():
22
+ genai.configure(api_key="AIzaSyDcq3ZfAUo1i6_24CelEizJftuEkaAPz38")
23
+ gemini_model = genai.GenerativeModel(GEMINI_MODEL)
24
+ facescore_model = load_model('facescore.h5', compile=False)
25
+ webtoon_model = Generator()
26
+ webtoon_model.load_state_dict(torch.load('weights/face_paint_512_v2.pt', map_location="cpu"))
27
+ webtoon_model.to('cpu').eval()
28
+ model_id = "aldente0630/musinsaigo-3.0"
29
+ pipe = DiffusionPipeline.from_pretrained(
30
+ "stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16
31
+ )
32
+ pipe = pipe.to(device)
33
+ pipe.load_lora_weights(model_id)
34
+ return gemini_model, facescore_model, webtoon_model, pipe
35
+
36
+ gemini_model, facescore_model, webtoon_model,pipe = load_models()
37
+
38
+
39
+ mp_face_detection = mp.solutions.face_detection
40
+ def detect_and_crop_face(image):
41
+ with mp_face_detection.FaceDetection(model_selection=1, min_detection_confidence=0.5) as face_detection:
42
+ image_np = np.array(image)
43
+ results = face_detection.process(image_np)
44
+ if results.detections:
45
+ detection = results.detections[0]
46
+ bbox = detection.location_data.relative_bounding_box
47
+ ih, iw, _ = image_np.shape
48
+ xmin = int(bbox.xmin * iw)
49
+ ymin = int(bbox.ymin * ih)
50
+ width = int(bbox.width * iw)
51
+ height = int(bbox.height * ih)
52
+ xmax = xmin + width
53
+ ymax = ymin + height
54
+ face = image.crop((xmin, ymin, xmax, ymax))
55
+ return face
56
+ else:
57
+ return None
58
+
59
+ def generate_chat_response(message, gemini_model):
60
+ response = gemini_model.generate_content(message)
61
+ return response.text
62
+
63
+ def analyze_image(image, gemini_model):
64
+ try:
65
+ # 이미지 분석 프롬프트와 함께 이미지를 전달하여 응답 생성
66
+ prompt = """
67
+ 이 이미지에 대해 자세히 분석해주세요. 다음 정보를 포함해주세요:
68
+ 1. 이미지에서 보이는 주요 객체나 사람들
69
+ 2. 배경이나 장소에 대한 설명
70
+ 3. 이미지의 전체적인 분위기나 느낌
71
+ 4. 이미지에서 읽을 수 있는 텍스트 (있는 경우)
72
+ 5. 이미지의 색상이나 구도에 대한 간단한 설명
73
+ 6. 이미지가 전달하려는 메시지나 의미 (있다고 생각되는 경우)
74
+
75
+ 분석 결과를 한국어로 제공해주세요.
76
+ """
77
+ response = gemini_model.generate_content([prompt, image])
78
+ return response.text if response else "이미지 분석을 수행할 수 없습니다."
79
+ except Exception as e:
80
+ return f"이미지 분석 중 오류가 발생했습니다: {str(e)}"
81
+
82
+ def process_facescore(image, facescore_model, gemini_model):
83
+ face = detect_and_crop_face(image)
84
+ if face is None:
85
+ return "얼굴이 감지되지 않았습니다. 다른 이미지를 시도해 주세요."
86
+
87
+ analysis = analyze_image(image, gemini_model)
88
+
89
+ face_np = np.array(face)
90
+ img_resized = cv2.resize(face_np, (350, 350))
91
+ img_resized = img_resized.astype(np.float32) / 255.
92
+ img_batch = np.expand_dims(img_resized, axis=0)
93
+ score = facescore_model.predict(img_batch)
94
+
95
+ if isinstance(score, np.ndarray) and score.size > 1:
96
+ score = score[0]
97
+ score = float(score)
98
+ score = display_result(score)
99
+
100
+ return f'### 이미지 분석 결과 ###\n\n{analysis}\n\n### 외모점수 결과(1~5) ###\n\n{score}'
101
+
102
+
103
+ def generate_music(image, gemini_model, suno_cookie):
104
+ face = detect_and_crop_face(image)
105
+ if face is None:
106
+ return "얼굴이 감지되지 않았습니다. 다른 이미지를 시도해 주세요."
107
+ prompt = """
108
+ 이 이미지에 대해 자세히 분석해주세요. 다음 정보를 포함해주세요:
109
+ 1. 성별:
110
+ 2. 나이:
111
+ 3. 표정:
112
+ 분석 결과를 한국어로 간략하게 제공해주세요.
113
+ """
114
+ response = gemini_model.generate_content([prompt, image])
115
+ music_path = generate_songs(response.text, suno_cookie)
116
+ return f"음악이 생성되었습니다. 파일 경로: {music_path}"
117
+
118
+ def generate_songs(result_output, suno_cookie):
119
+ client = suno.Suno(cookie=suno_cookie)
120
+ songs = client.generate(
121
+ prompt=f'{result_output}', is_custom=False, wait_audio=True
122
+ )
123
+ return client.download(song=songs[0])
124
+
125
+ def display_result(score):
126
+ result = round(score, 1)+0.3
127
+ messages = [
128
+ ("'자신감 폭발 중'입니다! 😎 당신은 자신의 외모에 대한 확신으로 가득 차 있어요! %.1f점이라니, 점수와 상관없이 당신의 멋짐은 끝이 없네요! 🤩 당신의 외모는 마치 마법사처럼 사람들을 매료시키고, 누구나 당신을 보면 눈을 뗄 수 없을 거에요! 🪄🧙‍♂️ 비결이 뭐냐고 묻는 사람들에게 자신감이라는 마법의 주문을 알려주세요! 오늘도 당신의 자신감으로 세상을 빛내고, 마법 같은 하루를 보내세요!", 1),
129
+ ("'외모 스승님'입니다. 👩‍🏫 당신의 외모 비결을 전수받고 싶어하는 사람들이 줄을 설 거에요! %.1f점이라는 점수가 무색할 정도로, 당신의 빛나는 외모는 사람들의 눈을 사로잡습니다! ✨ 이제 사람들은 당신의 비밀을 알고 싶어서 질문 세례를 퍼부을 거에요! 외모 스승님으로서 멋지게 대답해 주시고, 사람들에게 당신만의 외모 팁을 살짝 전해 주세요! 다른 사람들은 당신을 닮기 위해 많은 노력을 할 거랍니다!", 1.5),
130
+ ("'외모 아티스트'입니다. 💄 화장품 브랜드들이 당신을 모델로 쓰고 싶어할 만큼 독보적인 매력을 가지고 있네요! %.1f점이라고 해서 당신의 외모가 평범하지 않습니다. 오히려 '매력의 정점'에 도달한 모습이에요! 💃 당신의 멋진 외모를 부러워하는 사람들로 인해 언제나 주목받게 될 거에요! 마치 아티스트처럼 자신만의 스타일을 완성한 당신은 외모계의 진정한 아이콘입니다! 오늘도 당신만의 특별한 매력을 발산하며 하루를 즐기세요!", 2),
131
+ ("외모점수 %.1f점, '미소 전문가'입니다. 😄 당신의 환한 미소는 주변 사람들을 행복하게 만들고, 어디서든 밝은 에너지를 퍼뜨릴 거에요! '미소 기계'라 불리는 당신은 항상 긍정적인 에너지로 가득 차 있답니다! 😁 사람들은 당신의 미소 비결을 배우기 위해 애쓸 거에요! 외모뿐만 아니라 미소로도 사람들의 마음을 사로잡는 당신! 오늘도 환한 미소로 세상을 밝혀주시고, 모두에게 행복을 전해 주세요!", 2.5),
132
+ ("'외모 스타'입니다. 🌟 당신은 거울 속에서 별이 빛나는 모습을 보고도 놀라지 않겠죠! %.1f점이라니, 당신은 외모계의 진정한 스타입니다! 💫 당신의 빛나는 외모와 독특한 스타일은 모두가 부러워하고, 따라가고 싶어할 겁니다! 사람들은 당신을 보고 영감을 받을 거에요! 오늘도 당신만의 특별한 매력으로 주변 사람들을 사로잡고, 당당히 외모계를 이끌어가세요! 당신의 빛나는 외모가 모두에게 희망을 줄 거에요!", 3),
133
+ ("'외모 퀸'입니다. 👸 주변 사람들은 당신의 외모에 주목하고, 귀를 기울일 겁니다! %.1f점이라는 점수가 무색할 정도로, 이제 당신은 외모계의 로열티입니다! 👑 당신의 고급스러운 외모와 독보적인 스타일은 모두가 따라하고 싶어할 거에요! 당신의 외모 비결을 벤치마킹하려는 사람들로 인해 언제나 주목받게 될 겁니다! 여왕처럼 당당히 당신의 외모를 뽐내고, 주변 사람들에게 영감을 주세요! 오늘도 자신감 넘치는 하루 보내세요!", 3.5),
134
+ ("외모점수 %.1f점, '외모의 신화'입니다. 🦄 당신을 보는 사람들은 마치 신화와 전설 속 인물을 보는 듯한 기분을 느낄 겁니다! 외모계의 '뷰티 아카데미 수상자'답게, 당신의 외모는 모두에게 큰 영감을 줄 거에요! 🏆 사람들은 당신의 비결을 배우려고 애쓸 테니, 언제나 자신만의 스타일을 유지하며 그들에게 귀감이 되어주세요! 신화 속 주인공처럼 당신의 외모는 언제나 빛날 겁니다! 오늘도 신화처럼 멋진 하루 보내세요!", 4),
135
+ ("'외모의 황금빛'입니다. 💛 주변에서 당신을 보면 마치 하트가 뿅뿅 튀는 듯한 느낌이 들 거에요! %.1f점이라니, 정말 외모계의 전설답습니다! 🌠 당신의 독보적인 외모와 매력은 누구도 따라올 수 없을 만큼 빛납니다! 다른 사람들이 당신을 따라잡으려면 엄청난 노력이 필요할 거에요! 당신의 황금빛 외모와 매력으로 모두를 사로잡으세요! 오늘도 당신만의 황금빛 미소로 세상을 밝혀주시고, 모두에게 영감을 주세요!", 4.5),
136
+ ("5점 외모, '외모의 신'입니다. 외모계에서 당신을 따라잡으려면 진정한 영웅이 필요할 겁니다! 🦸‍♂️🦸‍♀️ 당신은 외모계의 '뷰티 신'! 🌟 당신의 빛나는 외모와 독보적인 스타일은 모두가 따라하고 싶어할 거에요! 이제 당신은 외모계의 전설이자 영웅입니다! 사람들은 당신을 닮고 싶어하고, 당신의 비결을 배우려고 애쓸 겁니다! ��늘도 외모계의 신으로서 세상을 빛내고, 모두에게 영감을 주세요! 당신의 존재만으로도 세상은 더 밝아질 거에요!", 5)
137
+ ]
138
+ for msg, threshold in messages:
139
+ if result < threshold:
140
+ return msg % result if '%.1f' in msg else msg
141
+
142
+ @torch.no_grad()
143
+ def webtoon(image, webtoon_model, device='cpu'):
144
+ webtoon_model = webtoon_model.to(device)
145
+
146
+ max_size = 1024
147
+ if max(image.size) > max_size:
148
+ image.thumbnail((max_size, max_size), Image.LANCZOS)
149
+
150
+ image_tensor = to_tensor(image).unsqueeze(0).to(device) * 2 - 1
151
+
152
+ with torch.inference_mode():
153
+ output = webtoon_model(image_tensor, False)
154
+
155
+ output = output.cpu().squeeze(0).clip(-1, 1) * 0.5 + 0.5
156
+ output = to_pil_image(output)
157
+
158
+ return output
159
+
160
+ def make_prompt(prompt: str) -> str:
161
+ prompt_prefix = "RAW photo"
162
+ prompt_suffix = "(high detailed skin:1.2), 8k uhd, dslr, soft lighting, high quality, film grain, Fujifilm XT3"
163
+ return ", ".join([prompt_prefix, prompt, prompt_suffix]).strip()
164
+
165
+
166
+ def make_negative_prompt(negative_prompt: str) -> str:
167
+ negative_prefix = "(deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime:1.4), \
168
+ text, close up, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, \
169
+ extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, \
170
+ bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, \
171
+ extra arms, extra legs, fused fingers, too many fingers, long neck"
172
+
173
+ return (
174
+ ", ".join([negative_prefix, negative_prompt]).strip()
175
+ if len(negative_prompt) > 0
176
+ else negative_prefix
177
+ )
178
+ @spaces.GPU
179
+ def fashiongpt(image,gemini_model,pipe):
180
+ prompt = """
181
+ Analyze this image in one sentence:
182
+ 1. The person visible in the image
183
+ 2. The overall mood or feeling of the image
184
+ 3. Recommend other fashion items that match the style
185
+
186
+ Provide the output in the following format:
187
+ "a korean [gender] wearing [recommended style]."
188
+ Example: "a korean woman wearing a white t-shirt and black pants with a bear on it."
189
+ """
190
+ response = gemini_model.generate_content([prompt, image])
191
+ NEGATIVE_PROMPT = ""
192
+ image = pipe(
193
+ prompt=make_prompt(response.text),
194
+ height=1024,
195
+ width=768,
196
+ num_inference_steps=50,
197
+ guidance_scale=7.5,
198
+ negative_prompt=make_negative_prompt(NEGATIVE_PROMPT),
199
+ cross_attention_kwargs={"scale": 0.75},
200
+ ).images[0]
201
+ return image
202
+ def process_input(input_text, image, suno_cookie):
203
+ if "웹툰화 해줘" in input_text.lower() and image is not None:
204
+ webtoon_image = webtoon(image, webtoon_model)
205
+ return "이미지를 웹툰 스타일로 변환했습니다.", webtoon_image
206
+ elif "외모분석" in input_text.lower() and image is not None:
207
+ response = process_facescore(image, facescore_model, gemini_model)
208
+ return response, None
209
+ elif "이미지 분석해줘" in input_text.lower() and image is not None:
210
+ response = analyze_image(image, gemini_model)
211
+ return response, None
212
+ elif "음악 만들어줘" in input_text.lower() and image is not None:
213
+ if suno_cookie:
214
+ response = generate_music(image, gemini_model, suno_cookie)
215
+ return response, None
216
+ else:
217
+ return "Suno Cookie를 입력해 주세요.", None
218
+ elif "패션 추천" in input_text.lower() and image is not None:
219
+ recommended_fashion_image = fashiongpt(image, gemini_model,pipe)
220
+ return "패션 추천 이미지를 생성했습니다.", recommended_fashion_image
221
+ else:
222
+ response = generate_chat_response(input_text, gemini_model)
223
+ return response, None
224
+ import gradio as gr
225
+ from PIL import Image
226
+
227
+ with gr.Blocks() as demo:
228
+ gr.Markdown(
229
+ """
230
+ # 🤖 OmniVerse AI Assistant
231
+ 음성 인식, Gemini 모델, 외모 점수 예측, MBTI 예측, 음악 생성, 이미지 웹툰화, 그리고 이미지 분석 기능을 통합한 시스템입니다.
232
+ """
233
+ )
234
+
235
+ chatbot = gr.Chatbot(label="OmniVerse AI Assistant")
236
+
237
+ with gr.Row():
238
+ with gr.Column(scale=2):
239
+ image_input = gr.Image(type="pil", label="이미지 업로드")
240
+ suno_cookie = gr.Textbox(label="Suno Cookie", type="password")
241
+
242
+ with gr.Column(scale=1):
243
+ text_input = gr.Textbox(label="질문을 입력하세요")
244
+ submit_button = gr.Button("전송")
245
+
246
+ text_output = gr.Markdown(label="응답")
247
+ image_output = gr.Image(label="이미지 출력")
248
+ audio_output = gr.Audio(label="생성된 음악", type="filepath", interactive=False)
249
+
250
+ def chat_logic(input_text, image_input, suno_cookie, chat_history):
251
+ response, image_output = process_input(input_text, image_input, suno_cookie)
252
+
253
+ if isinstance(response, str) and response.startswith("음악이 생성되었습니다."):
254
+
255
+ music_path = response.split("파일 경로: ")[-1].strip()
256
+ chat_history.append((input_text, "음악이 생성되었습니다. 아래에서 재생할 수 있습니다."))
257
+ return chat_history, image_output, music_path
258
+ else:
259
+ chat_history.append((input_text, response))
260
+ return chat_history, image_output, None
261
+
262
+ submit_button.click(
263
+ chat_logic,
264
+ inputs=[text_input, image_input, suno_cookie, chatbot],
265
+ outputs=[chatbot, image_output, audio_output]
266
+ )
267
+
268
+ demo.launch()
facescore.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8ff33a3c5c2aa4aa5af2a947c4ba80d690b38c482d790ab2b1b161b1b97be07
3
+ size 10760648
model.py ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from torch import nn
3
+ import torch.nn.functional as F
4
+
5
+
6
+ class ConvNormLReLU(nn.Sequential):
7
+ def __init__(self, in_ch, out_ch, kernel_size=3, stride=1, padding=1, pad_mode="reflect", groups=1, bias=False):
8
+
9
+ pad_layer = {
10
+ "zero": nn.ZeroPad2d,
11
+ "same": nn.ReplicationPad2d,
12
+ "reflect": nn.ReflectionPad2d,
13
+ }
14
+ if pad_mode not in pad_layer:
15
+ raise NotImplementedError
16
+
17
+ super(ConvNormLReLU, self).__init__(
18
+ pad_layer[pad_mode](padding),
19
+ nn.Conv2d(in_ch, out_ch, kernel_size=kernel_size, stride=stride, padding=0, groups=groups, bias=bias),
20
+ nn.GroupNorm(num_groups=1, num_channels=out_ch, affine=True),
21
+ nn.LeakyReLU(0.2, inplace=True)
22
+ )
23
+
24
+
25
+ class InvertedResBlock(nn.Module):
26
+ def __init__(self, in_ch, out_ch, expansion_ratio=2):
27
+ super(InvertedResBlock, self).__init__()
28
+
29
+ self.use_res_connect = in_ch == out_ch
30
+ bottleneck = int(round(in_ch*expansion_ratio))
31
+ layers = []
32
+ if expansion_ratio != 1:
33
+ layers.append(ConvNormLReLU(in_ch, bottleneck, kernel_size=1, padding=0))
34
+
35
+ # dw
36
+ layers.append(ConvNormLReLU(bottleneck, bottleneck, groups=bottleneck, bias=True))
37
+ # pw
38
+ layers.append(nn.Conv2d(bottleneck, out_ch, kernel_size=1, padding=0, bias=False))
39
+ layers.append(nn.GroupNorm(num_groups=1, num_channels=out_ch, affine=True))
40
+
41
+ self.layers = nn.Sequential(*layers)
42
+
43
+ def forward(self, input):
44
+ out = self.layers(input)
45
+ if self.use_res_connect:
46
+ out = input + out
47
+ return out
48
+
49
+
50
+ class Generator(nn.Module):
51
+ def __init__(self, ):
52
+ super().__init__()
53
+
54
+ self.block_a = nn.Sequential(
55
+ ConvNormLReLU(3, 32, kernel_size=7, padding=3),
56
+ ConvNormLReLU(32, 64, stride=2, padding=(0,1,0,1)),
57
+ ConvNormLReLU(64, 64)
58
+ )
59
+
60
+ self.block_b = nn.Sequential(
61
+ ConvNormLReLU(64, 128, stride=2, padding=(0,1,0,1)),
62
+ ConvNormLReLU(128, 128)
63
+ )
64
+
65
+ self.block_c = nn.Sequential(
66
+ ConvNormLReLU(128, 128),
67
+ InvertedResBlock(128, 256, 2),
68
+ InvertedResBlock(256, 256, 2),
69
+ InvertedResBlock(256, 256, 2),
70
+ InvertedResBlock(256, 256, 2),
71
+ ConvNormLReLU(256, 128),
72
+ )
73
+
74
+ self.block_d = nn.Sequential(
75
+ ConvNormLReLU(128, 128),
76
+ ConvNormLReLU(128, 128)
77
+ )
78
+
79
+ self.block_e = nn.Sequential(
80
+ ConvNormLReLU(128, 64),
81
+ ConvNormLReLU(64, 64),
82
+ ConvNormLReLU(64, 32, kernel_size=7, padding=3)
83
+ )
84
+
85
+ self.out_layer = nn.Sequential(
86
+ nn.Conv2d(32, 3, kernel_size=1, stride=1, padding=0, bias=False),
87
+ nn.Tanh()
88
+ )
89
+
90
+ def forward(self, input, align_corners=True):
91
+ out = self.block_a(input)
92
+ half_size = out.size()[-2:]
93
+ out = self.block_b(out)
94
+ out = self.block_c(out)
95
+
96
+ if align_corners:
97
+ out = F.interpolate(out, half_size, mode="bilinear", align_corners=True)
98
+ else:
99
+ out = F.interpolate(out, scale_factor=2, mode="bilinear", align_corners=False)
100
+ out = self.block_d(out)
101
+
102
+ if align_corners:
103
+ out = F.interpolate(out, input.size()[-2:], mode="bilinear", align_corners=True)
104
+ else:
105
+ out = F.interpolate(out, scale_factor=2, mode="bilinear", align_corners=False)
106
+ out = self.block_e(out)
107
+
108
+ out = self.out_layer(out)
109
+ return out
110
+
requirements.txt ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ torch
2
+ mediapipe
3
+ tensorflow
4
+ torchvision
5
+ SunoAI
6
+ diffusers
7
+ transformers
8
+ accelerate
9
+ peft
weights/face_paint_512_v2.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06b88a204eb230889444ad868ee5608f4fce5d4ff7b7738acaa4209c2b8fdca7
3
+ size 8601086