optimize preprocessor

This commit is contained in:
hofee
2024-10-05 12:24:53 -05:00
parent ee7537c315
commit d098c9f951
4 changed files with 104 additions and 84 deletions

View File

@@ -204,7 +204,9 @@ class DataLoadUtil:
os.path.dirname(path), "normal", os.path.basename(path) + "_R.png"
)
normal_image_R = cv2.imread(normal_path_R, cv2.IMREAD_COLOR)
return normal_image_L[:3,:3], normal_image_R[:3,:3]
normalized_normal_image_L = normal_image_L / 255.0 * 2.0 - 1.0
normalized_normal_image_R = normal_image_R / 255.0 * 2.0 - 1.0
return normalized_normal_image_L, normalized_normal_image_R
else:
if binocular and left_only:
normal_path = os.path.join(
@@ -215,7 +217,8 @@ class DataLoadUtil:
os.path.dirname(path), "normal", os.path.basename(path) + ".png"
)
normal_image = cv2.imread(normal_path, cv2.IMREAD_COLOR)
return normal_image
normalized_normal_image = normal_image / 255.0 * 2.0 - 1.0
return normalized_normal_image
@staticmethod
def load_label(path):