Skip to content

Commit

Permalink
update:code
Browse files Browse the repository at this point in the history
  • Loading branch information
SAKURA-CAT committed Sep 5, 2024
1 parent 14fc919 commit c864c8e
Show file tree
Hide file tree
Showing 71 changed files with 264 additions and 7,572 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ build
*.pth
*.pt
*.onnx
test/temp/*
!test/temp/.gitkeep
2 changes: 1 addition & 1 deletion app/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import gradio as gr
import onnxruntime
from hivision.creator.face_judgement_align import IDphotos_create
from hivisionai.hycv.vision import add_background
from hivision.creator.vision import add_background
from hivision.creator.layoutCreate import generate_layout_photo, generate_layout_image
import pathlib
import numpy as np
Expand Down
51 changes: 0 additions & 51 deletions hivision/creator/EulerZ.py

This file was deleted.

9 changes: 5 additions & 4 deletions hivision/creator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from typing import Tuple
import hivision.creator.utils as U
from .context import Context, ContextHandler, Params, Result
from .human_matting import extract_human
from .face_detector import detect_face
from .photo_adjuster import adjust_photo

Expand Down Expand Up @@ -44,8 +45,8 @@ def __init__(self):
"""

# 处理者
self.matting_handler: ContextHandler = None
self.detection_handler: ContextHandler = None
self.matting_handler: ContextHandler = extract_human
self.detection_handler: ContextHandler = detect_face
# 上下文
self.ctx = None

Expand Down Expand Up @@ -83,13 +84,13 @@ def __call__(
ctx.processing_image = U.resize_image_esp(
ctx.processing_image, 2000
) # 将输入图片 resize 到最大边长为 2000
ctx.origin_image = ctx.processing_image.copy()
self.before_all and self.before_all(ctx)
# 1. 人像抠图
self.matting_handler(ctx)
ctx.matting_image = ctx.processing_image.copy()
self.after_matting and self.after_matting(ctx)
# 2. 人脸检测
ctx.face = detect_face(ctx)
self.detection_handler(ctx)
self.after_detect and self.after_detect(ctx)
# 3. 图像调整
result_image_hd, result_image_standard, clothing_params, typography_params = (
Expand Down
Loading

0 comments on commit c864c8e

Please sign in to comment.