Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
新增 BlendFaceBgPartTwo 图像算子,支持 Ascend950(arch35 / RegBase / DAV_3510),完成人脸融合背景第二阶段的归一化 + Alpha 合成计算。
计算逻辑(逐元素,无广播):
fusion_face = acc_face / (acc_mask + epsilon) bg_weight = 1 - max_mask fused_img = fusion_face * max_mask + bg_img * bg_weight
算子规格:
acc_face
acc_mask
max_mask
bg_img
fused_img
epsilon
1e-12
实现要点:
KEY_FP32
KEY_UINT8
dim0 = H*W*C
GetCoreMemSize
op_host
op_graph
to_absolute_b_box
Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
Backgroud(背景信息)
新增 BlendFaceBgPartTwo 图像算子,支持 Ascend950(arch35 / RegBase / DAV_3510),完成人脸融合背景第二阶段的归一化 + Alpha 合成计算。
计算逻辑(逐元素,无广播):
Origin(信息来源)
Benefit / Necessity (价值/作用)
Design(设计方案)
算子规格:
acc_face/acc_mask/max_mask(均 DT_FLOAT),bg_img(DT_FLOAT 或 DT_UINT8)fused_img(DT_FLOAT,固定)epsilon(Float,默认1e-12,归一化防除零)实现要点:
bg_imgdtype 选择资源参数:KEY_FP32(bg=float32):bufferDivisor=40、minDtypeBits=32,DIST_NORM 直接载入直算KEY_UINT8(bg=uint8):bufferDivisor=34、minDtypeBits=8,DIST_UNPACK4_B8 载入 + uint8→half→float 两级无损 Castdim0 = H*W*C,多核按 512 元素对齐切分(每核 ≥ 4KB),UB 按 256B 对齐分块,首/尾 block 尾块独立处理;核数取 VectorCore、UB 取运行时GetCoreMemSize,无硬编码。op_host,数据类型推导落在op_graph,符合to_absolute_b_box参考架构。