fix: protect async preview lifetime and validate real canvas and spatial tools
这个提交包含在:
1 父节点
a3bd2ceb26
当前提交
1c3e294ce9
18 个文件已更改
+151
-45
没有与搜索条件相匹配的文件
+21
-1
@@ -8,7 +8,7 @@ import re
|
||||
def masked_kernel(source):
|
||||
original = re.search(r'define <4 x half> @dy_grade\(.*?\n\}', source, re.S).group()
|
||||
body = original.replace('@dy_grade(', '@dy_gradeMasked(', 1)
|
||||
args = ', '.join(f'float %dyWeight{i}' for i in range(12))
|
||||
args = ', '.join(f'float %dyWeight{i}' for i in range(12)) + ', float %dySkinVisualize'
|
||||
body = body.replace(') local_unnamed_addr #0 {', ', '+args+') local_unnamed_addr #0 {', 1)
|
||||
# Each stage mixes against its actual input. Split basic adjustment has
|
||||
# two native locations; both use the same per-module coverage.
|
||||
@@ -58,6 +58,26 @@ def masked_kernel(source):
|
||||
' %dyIncludesFinalLast = icmp uge i32 %dyStageLast, 11',
|
||||
' %dyIncludesFinal = and i1 %dyIncludesFinalFirst, %dyIncludesFinalLast',
|
||||
' %v672 = select i1 %dyIncludesFinal, <3 x float> %dyClamped672, <3 x float> %v669']), 1)
|
||||
def preview(code, reference, ranged=False):
|
||||
regular=next(line for line in code.splitlines() if line.startswith(' %v669 = tail call'))
|
||||
extra=[regular.replace('%v669 = ', '%dySkinNormal = ', 1),
|
||||
' %dySkinSelection = call float @dy_skinWeight(<3 x float> %v668, <3 x float> '+reference+', %struct.DYUniforms addrspace(2)* %v12)',
|
||||
' %dySkinPointer = getelementptr inbounds %struct.DYUniforms, %struct.DYUniforms addrspace(2)* %v12, i64 0, i32 65',
|
||||
' %dySkinVector = load <3 x float>, <3 x float> addrspace(2)* %dySkinPointer, align 16',
|
||||
' %dySkinStrength = extractelement <3 x float> %dySkinVector, i64 1',
|
||||
' %dySkinRatio = fmul float %dySkinStrength, 0x3F847AE140000000',
|
||||
' %dySkinSelected = fmul float %dySkinSelection, %dyWeight3',
|
||||
' %dySkinAmount = fmul float %dySkinSelected, %dySkinRatio',
|
||||
' %dySkinGray0 = insertelement <3 x float> undef, float %dySkinAmount, i64 0',
|
||||
' %dySkinGray = shufflevector <3 x float> %dySkinGray0, <3 x float> undef, <3 x i32> zeroinitializer',
|
||||
' %dySkinShow = fcmp ogt float %dySkinVisualize, 5.000000e-01']
|
||||
condition='%dySkinShow'
|
||||
if ranged:
|
||||
extra+=[' %dySkinShowActive = and i1 %dySkinShow, %dyStageActive669'];condition='%dySkinShowActive'
|
||||
extra+=[' %v669 = select i1 '+condition+', <3 x float> %dySkinGray, <3 x float> %dySkinNormal']
|
||||
return code.replace(regular, '\n'.join(extra), 1)
|
||||
body=preview(body,'%v411')
|
||||
segment=preview(segment,'%dySkinReference',True)
|
||||
skin='''
|
||||
define <3 x float> @dy_skinExtra(<3 x float> %color, <3 x float> %reference, %struct.DYUniforms addrspace(2)* %uniforms) {
|
||||
entry:
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Person mask regression fixture
|
||||
|
||||
`astronaut.png` is the 512×512 NASA photograph of Eileen Collins distributed by scikit-image v0.25.2. It is used solely as a local segmentation test fixture, not as a product asset or endorsement. It is not copied into the APP.
|
||||
|
||||
- Source: https://raw.githubusercontent.com/scikit-image/scikit-image/v0.25.2/skimage/data/astronaut.png
|
||||
- Attribution and rights: https://scikit-image.org/docs/0.25.x/api/skimage.data.html#skimage.data.astronaut (NASA Great Images database; released into the public domain, no known copyright restrictions).
|
||||
- SHA-256: `88431cd9653ccd539741b555fb0a46b61558b301d4110412b5bc28b5e3ea6cb5`
|
||||
|
||||
The tests derive a two-person composition, a shifted image, and an occluded image in memory. They check basic foreground/background separation and request independence; they do not establish broad segmentation accuracy or equivalence to Color Finale.
|
||||
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 773 KiB |
在新工单中引用
屏蔽一个用户