增加角度显示计算,优化CNN架构

This commit is contained in:
jiao77
2025-03-26 22:33:36 +08:00
parent 88ca482d5d
commit 79cec17a50
6 changed files with 27 additions and 23 deletions

View File

@@ -19,10 +19,10 @@ def layout_to_tensor(layout_path, target_size=(256, 256)):
img = img.resize(target_size, resample=Image.BILINEAR)
return np.array(img) / 255.0 # 归一化到[0,1]
def tile_layout(large_layout, block_size=64):
def tile_layout(large_layout, block_size=64, overlap_ratio=0.5):
"""将大版图分割为小块(滑动窗口方式)"""
height, width = large_layout.shape
stride = block_size // 2 # 步长设置重叠区域
stride = int(block_size * (1 - overlap_ratio)) # 步长设置重叠区域
tiles = []
for y in range(0, height - block_size +1, stride):
for x in range(0, width - block_size +1, stride):