Compare commits
36 Commits
develop
...
d5452098f3
| Author | SHA1 | Date | |
|---|---|---|---|
| d5452098f3 | |||
| 315e298ba8 | |||
| ec26c8b507 | |||
| ddef6af1cf | |||
| fdffb1e724 | |||
| 63a2f5e007 | |||
| aeb67f366a | |||
| c244e313ae | |||
| 1a1fd46f81 | |||
| dcd8e26f0f | |||
| fd94a3b4f0 | |||
| 3f9309235a | |||
| ebd665b241 | |||
| 833e1bc924 | |||
| 2b7e4013ee | |||
| 5b2bb3ce7c | |||
| 6739a92d28 | |||
| f23b99d326 | |||
| 10d41cd32f | |||
| bb7b85bfb8 | |||
| 6ecb6be59c | |||
| 64285cd5f3 | |||
| fe6a5fb029 | |||
| 5217847d49 | |||
| 0a9fc51310 | |||
| cf052f9632 | |||
| 19a8ea9a93 | |||
| 09ff2f1ab7 | |||
| 109a23197a | |||
|
|
2135a180be | ||
|
|
09032c0564 | ||
|
|
167faa10c8 | ||
|
|
0a048bf37f | ||
|
|
05045dda76 | ||
|
|
30f9a99df2 | ||
|
|
3932b8359a |
@@ -35,6 +35,4 @@ jobs:
|
|||||||
cd ${{ env.REMOTE_DEPLOY_PATH }}
|
cd ${{ env.REMOTE_DEPLOY_PATH }}
|
||||||
|
|
||||||
docker-compose down 2>&1
|
docker-compose down 2>&1
|
||||||
docker-compose up -d --build --remove-orphans 2>&1
|
docker-compose up -d 2>&1
|
||||||
|
|
||||||
docker image prune -f 2>&1
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
name: 定时 AiDA python develop 分支构建部署
|
name: 定时 AiDA python develop 分支构建部署
|
||||||
on:
|
on:
|
||||||
# 使用 schedule 触发器,遵循标准的 Cron 格式 (分钟 小时-8 日期 月份 星期)
|
# 使用 schedule 触发器,遵循标准的 Cron 格式 (分钟 小时-8 日期 月份 星期)
|
||||||
schedule:
|
# schedule:
|
||||||
- cron: '30 9 * * *'
|
# - cron: '30 9 * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
scheduled_deploy:
|
scheduled_deploy:
|
||||||
|
|||||||
40
.gitea/workflows/ltx_develop_build_manual.yaml
Normal file
40
.gitea/workflows/ltx_develop_build_manual.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: 手动 AiDA python develop 分支构建部署
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
scheduled_deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
REMOTE_DEPLOY_PATH: /workspace/Trinity/Fastapi_AiDA_Trinity_Dev
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: 1.检出代码
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: 'dev-ltx'
|
||||||
|
|
||||||
|
- name: 2.复制文件到服务器
|
||||||
|
uses: appleboy/scp-action@v0.1.7
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SERVER_HOST }}
|
||||||
|
username: ${{ secrets.SERVER_USER }}
|
||||||
|
password: ${{ secrets.SERVER_PASSWORD }}
|
||||||
|
source: "."
|
||||||
|
target: ${{ env.REMOTE_DEPLOY_PATH }}
|
||||||
|
|
||||||
|
- name: 3.重启docker-compose
|
||||||
|
uses: appleboy/ssh-action@v0.1.10
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SERVER_HOST }}
|
||||||
|
username: ${{ secrets.SERVER_USER }}
|
||||||
|
password: ${{ secrets.SERVER_PASSWORD }}
|
||||||
|
script: |
|
||||||
|
# 进入项目目录
|
||||||
|
cd ${{ env.REMOTE_DEPLOY_PATH }}
|
||||||
|
|
||||||
|
docker-compose down 2>&1
|
||||||
|
docker-compose up -d --build --remove-orphans 2>&1
|
||||||
|
|
||||||
|
docker image prune -f 2>&1
|
||||||
40
.gitea/workflows/prod_build_manual.yaml
Normal file
40
.gitea/workflows/prod_build_manual.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: 定时 AiDA python prod 分支构建部署
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
scheduled_deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
REMOTE_DEPLOY_PATH: /workspace/Trinity/Fastapi_AiDA_Trinity_Prod
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: 1.检出代码
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: 'master'
|
||||||
|
|
||||||
|
- name: 2.复制文件到服务器
|
||||||
|
uses: appleboy/scp-action@v0.1.7
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SERVER_HOST }}
|
||||||
|
username: ${{ secrets.SERVER_USER }}
|
||||||
|
password: ${{ secrets.SERVER_PASSWORD }}
|
||||||
|
source: "."
|
||||||
|
target: ${{ env.REMOTE_DEPLOY_PATH }}
|
||||||
|
|
||||||
|
- name: Restart Docker containers
|
||||||
|
uses: appleboy/ssh-action@v0.1.10
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SERVER_HOST }}
|
||||||
|
username: ${{ secrets.SERVER_USER }}
|
||||||
|
password: ${{ secrets.SERVER_PASSWORD }}
|
||||||
|
script: |
|
||||||
|
# 进入项目目录
|
||||||
|
cd ${{ env.REMOTE_DEPLOY_PATH }}
|
||||||
|
|
||||||
|
docker-compose down 2>&1
|
||||||
|
docker-compose up -d 2>&1
|
||||||
|
|
||||||
|
docker image prune -f 2>&1
|
||||||
42
.gitea/workflows/prod_build_scheduled.yaml
Normal file
42
.gitea/workflows/prod_build_scheduled.yaml
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
name: 定时 AiDA python prod 分支构建部署
|
||||||
|
on:
|
||||||
|
# 使用 schedule 触发器,遵循标准的 Cron 格式 (分钟 小时-8 日期 月份 星期)
|
||||||
|
schedule:
|
||||||
|
- cron: '07 13 23 1 *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
scheduled_deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
REMOTE_DEPLOY_PATH: /workspace/Trinity/Fastapi_AiDA_Trinity_Prod
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: 1.检出代码
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: 'master'
|
||||||
|
|
||||||
|
- name: 2.复制文件到服务器
|
||||||
|
uses: appleboy/scp-action@v0.1.7
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SERVER_HOST }}
|
||||||
|
username: ${{ secrets.SERVER_USER }}
|
||||||
|
password: ${{ secrets.SERVER_PASSWORD }}
|
||||||
|
source: "."
|
||||||
|
target: ${{ env.REMOTE_DEPLOY_PATH }}
|
||||||
|
|
||||||
|
- name: Restart Docker containers
|
||||||
|
uses: appleboy/ssh-action@v0.1.10
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SERVER_HOST }}
|
||||||
|
username: ${{ secrets.SERVER_USER }}
|
||||||
|
password: ${{ secrets.SERVER_PASSWORD }}
|
||||||
|
script: |
|
||||||
|
# 进入项目目录
|
||||||
|
cd ${{ env.REMOTE_DEPLOY_PATH }}
|
||||||
|
|
||||||
|
docker-compose down 2>&1
|
||||||
|
docker-compose up -d 2>&1
|
||||||
|
|
||||||
|
docker image prune -f 2>&1
|
||||||
@@ -128,6 +128,8 @@ OLLAMA_URL = f"http://{settings.A6000_SERVICE_HOST}:11434/api/embeddings"
|
|||||||
# Design
|
# Design
|
||||||
DESIGN_MODEL_URL = f'{settings.A6000_SERVICE_HOST}:10000'
|
DESIGN_MODEL_URL = f'{settings.A6000_SERVICE_HOST}:10000'
|
||||||
DESIGN_MODEL_NAME = 'seg_knet'
|
DESIGN_MODEL_NAME = 'seg_knet'
|
||||||
|
# Seg Product
|
||||||
|
SEG_PRODUCT_MODEL_URL = f'{settings.B_4_X_4090_SERVICE_HOST}:3000'
|
||||||
# Generate Image
|
# Generate Image
|
||||||
GI_MODEL_URL = f'{settings.A6000_SERVICE_HOST}:10061'
|
GI_MODEL_URL = f'{settings.A6000_SERVICE_HOST}:10061'
|
||||||
GI_MODEL_NAME = 'flux'
|
GI_MODEL_NAME = 'flux'
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import torch.nn.functional as F
|
|||||||
import tritonclient.http as httpclient
|
import tritonclient.http as httpclient
|
||||||
from minio import Minio
|
from minio import Minio
|
||||||
|
|
||||||
from app.core.config import DESIGN_MODEL_URL
|
from app.core.config import DESIGN_MODEL_URL, SEG_PRODUCT_MODEL_URL
|
||||||
from app.core.config import settings
|
from app.core.config import settings
|
||||||
from app.schemas.brand_dna import BrandDnaModel
|
from app.schemas.brand_dna import BrandDnaModel
|
||||||
from app.service.attribute.config import const
|
from app.service.attribute.config import const
|
||||||
@@ -29,7 +29,7 @@ class BrandDna:
|
|||||||
self.attr_type = pd.read_csv(settings.CATEGORY_PATH)
|
self.attr_type = pd.read_csv(settings.CATEGORY_PATH)
|
||||||
# self.attr_type = pd.read_csv(r"E:\workspace\trinity_client_aida\app\service\attribute\config\descriptor\category\category_dis.csv")
|
# self.attr_type = pd.read_csv(r"E:\workspace\trinity_client_aida\app\service\attribute\config\descriptor\category\category_dis.csv")
|
||||||
self.att_client = httpclient.InferenceServerClient(url=DESIGN_MODEL_URL)
|
self.att_client = httpclient.InferenceServerClient(url=DESIGN_MODEL_URL)
|
||||||
self.seg_client = httpclient.InferenceServerClient(url='10.1.1.243:30000')
|
self.seg_client = httpclient.InferenceServerClient(url=SEG_PRODUCT_MODEL_URL)
|
||||||
self.const = const
|
self.const = const
|
||||||
# self.const = local_debug_const
|
# self.const = local_debug_const
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class ClothingSeg:
|
|||||||
def __init__(self, request_data):
|
def __init__(self, request_data):
|
||||||
self.image_data = request_data.image_data
|
self.image_data = request_data.image_data
|
||||||
self.user_id = request_data.user_id
|
self.user_id = request_data.user_id
|
||||||
self.triton_client = grpcclient.InferenceServerClient(url="10.1.1.243:10071")
|
self.triton_client = grpcclient.InferenceServerClient(url=f"{settings.B_4_X_4090_SERVICE_HOST}:10071")
|
||||||
|
|
||||||
@RunTime
|
@RunTime
|
||||||
def get_result(self):
|
def get_result(self):
|
||||||
@@ -139,7 +139,7 @@ def get_bounding_box(mask):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
test_data = ClothingSegModel(
|
test_data = ClothingSegModel(
|
||||||
user_id=89,
|
user_id="89",
|
||||||
image_data=[
|
image_data=[
|
||||||
# {
|
# {
|
||||||
# "image_url": "test/clothing_seg/dress.jpg",
|
# "image_url": "test/clothing_seg/dress.jpg",
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ class NoSegPrintPainting:
|
|||||||
canvas_h=painting_dict['dim_image_h'],
|
canvas_h=painting_dict['dim_image_h'],
|
||||||
canvas_w=painting_dict['dim_image_w'],
|
canvas_w=painting_dict['dim_image_w'],
|
||||||
location=painting_dict['location'],
|
location=painting_dict['location'],
|
||||||
angle=45)
|
angle=int(print_.get('print_angle_list', [0])[0]))
|
||||||
painting_dict['mask_inv_print'] = np.zeros(painting_dict['tile_print'].shape[:2], dtype=np.uint8)
|
painting_dict['mask_inv_print'] = np.zeros(painting_dict['tile_print'].shape[:2], dtype=np.uint8)
|
||||||
return painting_dict
|
return painting_dict
|
||||||
|
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ class PrintPainting:
|
|||||||
canvas_h=painting_dict['dim_image_h'],
|
canvas_h=painting_dict['dim_image_h'],
|
||||||
canvas_w=painting_dict['dim_image_w'],
|
canvas_w=painting_dict['dim_image_w'],
|
||||||
location=painting_dict['location'],
|
location=painting_dict['location'],
|
||||||
angle=45)
|
angle=int(print_.get('print_angle_list', [0])[0]))
|
||||||
painting_dict['mask_inv_print'] = np.zeros(painting_dict['tile_print'].shape[:2], dtype=np.uint8)
|
painting_dict['mask_inv_print'] = np.zeros(painting_dict['tile_print'].shape[:2], dtype=np.uint8)
|
||||||
return painting_dict
|
return painting_dict
|
||||||
|
|
||||||
|
|||||||
@@ -367,7 +367,6 @@ def transpose_rotate(layer, image):
|
|||||||
# ------------------- 核心修改:计算实际旋转角度 -------------------
|
# ------------------- 核心修改:计算实际旋转角度 -------------------
|
||||||
# 结合镜像状态,计算需要实际执行的旋转角度
|
# 结合镜像状态,计算需要实际执行的旋转角度
|
||||||
actual_rotate = calculate_actual_rotate(original_rotate, is_mirrored_x, is_mirrored_y)
|
actual_rotate = calculate_actual_rotate(original_rotate, is_mirrored_x, is_mirrored_y)
|
||||||
print(f"actual_rotate:{actual_rotate}")
|
|
||||||
# ------------------- 执行镜像变换 -------------------
|
# ------------------- 执行镜像变换 -------------------
|
||||||
# 左右镜像(transpose[0] != 1 即-1,表示镜像)
|
# 左右镜像(transpose[0] != 1 即-1,表示镜像)
|
||||||
if is_mirrored_x != 1:
|
if is_mirrored_x != 1:
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ def get_translation_from_llama3(text):
|
|||||||
def get_prompt_from_image(image_path, text):
|
def get_prompt_from_image(image_path, text):
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
# url = "http://localhost:11434/api/generate"
|
# url = "http://localhost:11434/api/generate"
|
||||||
url = "http://10.1.1.243:11434/api/generate"
|
url = f"http://{settings.B_4_X_4090_SERVICE_HOST}:11434/api/generate"
|
||||||
|
|
||||||
image_base64 = minio_util.minio_url_to_base64(image_path.img)
|
image_base64 = minio_util.minio_url_to_base64(image_path.img)
|
||||||
# image_base64 = minio_url_to_base64(image_path)
|
# image_base64 = minio_url_to_base64(image_path)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
aida_server:
|
aida_server:
|
||||||
|
container_name: "AiDA_${SERVE_ENV}_Server"
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
|||||||
Reference in New Issue
Block a user