Artem-Darius Weber 2 months ago
parent d0dd9759ce
commit 444ba619c0

@ -11,7 +11,7 @@ CORS(app)
data_processor = DataProcessor() data_processor = DataProcessor()
def decode_image_from_base64(self, image_base64: str, color: bool = True) -> np.ndarray: def decode_image_from_base64(image_base64: str, color: bool = True) -> np.ndarray:
image_data = base64.b64decode(image_base64) image_data = base64.b64decode(image_base64)
np_arr = np.frombuffer(image_data, np.uint8) np_arr = np.frombuffer(image_data, np.uint8)
image = cv2.imdecode(np_arr, cv2.IMREAD_COLOR if color else cv2.IMREAD_GRAYSCALE) image = cv2.imdecode(np_arr, cv2.IMREAD_COLOR if color else cv2.IMREAD_GRAYSCALE)

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save