Spaces:
Sleeping
Sleeping
file convert nparray
Browse files
main.py
CHANGED
@@ -126,9 +126,10 @@ async def analyze_image(image_paths: list[UploadFile]):
|
|
126 |
# bytearray(f.read()), dtype=np.uint8
|
127 |
# )
|
128 |
# NumPy配列(メモリ上のデータ)から画像をデコード
|
129 |
-
|
130 |
-
print(file)
|
131 |
-
|
|
|
132 |
# image = image_path.file
|
133 |
|
134 |
if image is None:
|
|
|
126 |
# bytearray(f.read()), dtype=np.uint8
|
127 |
# )
|
128 |
# NumPy配列(メモリ上のデータ)から画像をデコード
|
129 |
+
file_bytes = await image_path.read()
|
130 |
+
print("file", file_bytes)
|
131 |
+
file_array = np.asarray(bytearray(file_bytes), dtype=np.uint8)
|
132 |
+
image = cv2.imdecode(file_array, cv2.IMREAD_COLOR)
|
133 |
# image = image_path.file
|
134 |
|
135 |
if image is None:
|