Commit 5a859f55 authored by chenpangpang's avatar chenpangpang
Browse files

feat: 解决bug;路径均改成绝对路径

parent 380c862e
...@@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y gcc g++ ...@@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y gcc g++
RUN pip install -r requirements.txt RUN pip install -r requirements.txt
RUN wget --no-check-certificate --content-disposition \ 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' && \ '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 RUN pip install numpy==1.24.4
######### #########
...@@ -25,4 +25,5 @@ COPY chenyh/$IMAGE/antelopev2 /root/$IMAGE_UPPER/.insightface/models/antelopev2 ...@@ -25,4 +25,5 @@ COPY chenyh/$IMAGE/antelopev2 /root/$IMAGE_UPPER/.insightface/models/antelopev2
RUN apt-get update && apt install -y libglib2.0-dev 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 /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/$IMAGE_UPPER /root/$IMAGE_UPPER
COPY --from=base /root/$IMAGE/启动器.ipynb /root/$IMAGE/start.sh /root/$IMAGE/assets /root/ COPY --from=base /root/$IMAGE/启动器.ipynb /root/$IMAGE/start.sh /root/
\ No newline at end of file COPY --from=base /root/$IMAGE/assets/ /root/
\ No newline at end of file
...@@ -18,8 +18,8 @@ from insightface.app import FaceAnalysis ...@@ -18,8 +18,8 @@ from insightface.app import FaceAnalysis
from insightface.data import get_image as ins_get_image from insightface.data import get_image as ins_get_image
device = "cuda" device = "cuda"
ckpt_dir = "Kwai-Kolors/Kolors" ckpt_dir = "/root/Kolors-FaceID/Kwai-Kolors/Kolors"
ckpt_dir_faceid = "Kwai-Kolors/Kolors-IP-Adapter-FaceID-Plus" 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) 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') tokenizer = ChatGLMTokenizer.from_pretrained(f'{ckpt_dir}/text_encoder')
...@@ -44,7 +44,7 @@ pipe = StableDiffusionXLPipeline( ...@@ -44,7 +44,7 @@ pipe = StableDiffusionXLPipeline(
class FaceInfoGenerator(): 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, self.app = FaceAnalysis(name='antelopev2', root=root_dir,
providers=['CUDAExecutionProvider', 'CPUExecutionProvider']) providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
self.app.prepare(ctx_id=0, det_size=(640, 640)) self.app.prepare(ctx_id=0, det_size=(640, 640))
...@@ -123,9 +123,9 @@ def infer(prompt, ...@@ -123,9 +123,9 @@ def infer(prompt,
examples = [ examples = [
["穿着晚礼服,在星光下的晚宴场景中,烛光闪闪,整个场景洋溢着浪漫而奢华的氛围", "image/image1.png"], ["穿着晚礼服,在星光下的晚宴场景中,烛光闪闪,整个场景洋溢着浪漫而奢华的氛围", "/root/Kolors-FaceID/image/image1.png"],
["西部牛仔,牛仔帽,荒野大镖客,背景是西部小镇,仙人掌,,日落余晖, 暖色调, 使用XT4胶片拍摄, 噪点, 晕影, 柯达胶卷,复古", ["西部牛仔,牛仔帽,荒野大镖客,背景是西部小镇,仙人掌,,日落余晖, 暖色调, 使用XT4胶片拍摄, 噪点, 晕影, 柯达胶卷,复古",
"image/image2.png"] "/root/Kolors-FaceID/image/image2.png"]
] ]
css = """ css = """
...@@ -150,7 +150,7 @@ def load_description(fp): ...@@ -150,7 +150,7 @@ def load_description(fp):
with gr.Blocks(css=css) as Kolors: 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.Row():
with gr.Column(elem_id="col-left"): with gr.Column(elem_id="col-left"):
with gr.Row(): with gr.Row():
......
#!/bin/bash #!/bin/bash
cd /root/Kolors-FaceID python /root/Kolors-FaceID/app.py
python app.py
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment