feat
fix 超分size判断比例减少 显存不足
This commit is contained in:
@@ -112,7 +112,7 @@ class DesignPreprocessing:
|
|||||||
# 判断 两边是否同时都小于512 因为此处做四倍超分
|
# 判断 两边是否同时都小于512 因为此处做四倍超分
|
||||||
if item['obj'].shape[0] <= 512 and item['obj'].shape[1] <= 512:
|
if item['obj'].shape[0] <= 512 and item['obj'].shape[1] <= 512:
|
||||||
# 如果任意一边小于256则超分
|
# 如果任意一边小于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.
|
img = item['obj'].astype(np.float32) / 255.
|
||||||
sample = np.transpose(img if img.shape[2] == 1 else img[:, :, [2, 1, 0]], (2, 0, 1))
|
sample = np.transpose(img if img.shape[2] == 1 else img[:, :, [2, 1, 0]], (2, 0, 1))
|
||||||
|
|||||||
Reference in New Issue
Block a user