Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
Kolors-FaceID
Commits
5a859f55
Commit
5a859f55
authored
Nov 06, 2024
by
chenpangpang
Browse files
feat: 解决bug;路径均改成绝对路径
parent
380c862e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
Dockerfile
Dockerfile
+3
-2
Kolors-FaceID/app.py
Kolors-FaceID/app.py
+6
-6
start.sh
start.sh
+1
-2
No files found.
Dockerfile
View file @
5a859f55
...
...
@@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y gcc g++
RUN
pip
install
-r
requirements.txt
RUN
wget
--no-check-certificate
--content-disposition
\
'https://cancon.hpccube.com:65024/directlink/4/onnxruntime/DAS1.2/onnxruntime-1.15.0+das.opt1.dtk24042-cp310-cp310-manylinux_2_28_x86_64.whl'
&&
\
pip
install
onnxruntime-1.15.0+das.opt1.dtk24042-cp310-cp310-manylinux_2_28_x86_64.whl
\
pip
install
onnxruntime-1.15.0+das.opt1.dtk24042-cp310-cp310-manylinux_2_28_x86_64.whl
RUN
pip
install
numpy
==
1.24.4
#########
...
...
@@ -25,4 +25,5 @@ COPY chenyh/$IMAGE/antelopev2 /root/$IMAGE_UPPER/.insightface/models/antelopev2
RUN
apt-get update
&&
apt
install
-y
libglib2.0-dev
COPY
--from=base /opt/conda/lib/python3.10/site-packages /opt/conda/lib/python3.10/site-packages
COPY
--from=base /root/$IMAGE/$IMAGE_UPPER /root/$IMAGE_UPPER
COPY
--from=base /root/$IMAGE/启动器.ipynb /root/$IMAGE/start.sh /root/$IMAGE/assets /root/
\ No newline at end of file
COPY
--from=base /root/$IMAGE/启动器.ipynb /root/$IMAGE/start.sh /root/
COPY
--from=base /root/$IMAGE/assets/ /root/
\ No newline at end of file
Kolors-FaceID/app.py
View file @
5a859f55
...
...
@@ -18,8 +18,8 @@ from insightface.app import FaceAnalysis
from
insightface.data
import
get_image
as
ins_get_image
device
=
"cuda"
ckpt_dir
=
"Kwai-Kolors/Kolors"
ckpt_dir_faceid
=
"Kwai-Kolors/Kolors-IP-Adapter-FaceID-Plus"
ckpt_dir
=
"
/root/Kolors-FaceID/
Kwai-Kolors/Kolors"
ckpt_dir_faceid
=
"
/root/Kolors-FaceID/
Kwai-Kolors/Kolors-IP-Adapter-FaceID-Plus"
text_encoder
=
ChatGLMModel
.
from_pretrained
(
f
'
{
ckpt_dir
}
/text_encoder'
,
torch_dtype
=
torch
.
float16
).
half
().
to
(
device
)
tokenizer
=
ChatGLMTokenizer
.
from_pretrained
(
f
'
{
ckpt_dir
}
/text_encoder'
)
...
...
@@ -44,7 +44,7 @@ pipe = StableDiffusionXLPipeline(
class
FaceInfoGenerator
():
def
__init__
(
self
,
root_dir
=
"
.
/.insightface/"
):
def
__init__
(
self
,
root_dir
=
"
/root/Kolors-FaceID
/.insightface/"
):
self
.
app
=
FaceAnalysis
(
name
=
'antelopev2'
,
root
=
root_dir
,
providers
=
[
'CUDAExecutionProvider'
,
'CPUExecutionProvider'
])
self
.
app
.
prepare
(
ctx_id
=
0
,
det_size
=
(
640
,
640
))
...
...
@@ -123,9 +123,9 @@ def infer(prompt,
examples
=
[
[
"穿着晚礼服,在星光下的晚宴场景中,烛光闪闪,整个场景洋溢着浪漫而奢华的氛围"
,
"image/image1.png"
],
[
"穿着晚礼服,在星光下的晚宴场景中,烛光闪闪,整个场景洋溢着浪漫而奢华的氛围"
,
"
/root/Kolors-FaceID/
image/image1.png"
],
[
"西部牛仔,牛仔帽,荒野大镖客,背景是西部小镇,仙人掌,,日落余晖, 暖色调, 使用XT4胶片拍摄, 噪点, 晕影, 柯达胶卷,复古"
,
"image/image2.png"
]
"
/root/Kolors-FaceID/
image/image2.png"
]
]
css
=
"""
...
...
@@ -150,7 +150,7 @@ def load_description(fp):
with
gr
.
Blocks
(
css
=
css
)
as
Kolors
:
gr
.
HTML
(
load_description
(
"assets/title.md"
))
gr
.
HTML
(
load_description
(
"
/root/Kolors-FaceID/
assets/title.md"
))
with
gr
.
Row
():
with
gr
.
Column
(
elem_id
=
"col-left"
):
with
gr
.
Row
():
...
...
start.sh
View file @
5a859f55
#!/bin/bash
cd
/root/Kolors-FaceID
python app.py
python /root/Kolors-FaceID/app.py
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment