fix    超分size判断比例减少 显存不足
This commit is contained in:
zhouchengrong
2024-08-21 10:35:27 +08:00
parent 547b471745
commit c393064fa6

View File

@@ -112,7 +112,7 @@ class DesignPreprocessing:
# 判断 两边是否同时都小于512 因为此处做四倍超分
if item['obj'].shape[0] <= 512 and item['obj'].shape[1] <= 512:
# 如果任意一边小于256则超分
if item['obj'].shape[0] <= 256 or item['obj'].shape[1] <= 256:
if item['obj'].shape[0] <= 200 or item['obj'].shape[1] <= 200:
# 超分
img = item['obj'].astype(np.float32) / 255.
sample = np.transpose(img if img.shape[2] == 1 else img[:, :, [2, 1, 0]], (2, 0, 1))