Spaces:
Running
Running
Update src/util.py
Browse files- src/util.py +2 -2
src/util.py
CHANGED
@@ -59,9 +59,9 @@ def upload_np_2_oss(input_image, name="cache.jpg"):
|
|
59 |
name = name[:-4] + ".jpg"
|
60 |
imgByteArr = io.BytesIO()
|
61 |
if name.lower().endswith(".png"):
|
62 |
-
|
63 |
else:
|
64 |
-
|
65 |
imgByteArr = imgByteArr.getvalue()
|
66 |
|
67 |
start_time = time.perf_counter()
|
|
|
59 |
name = name[:-4] + ".jpg"
|
60 |
imgByteArr = io.BytesIO()
|
61 |
if name.lower().endswith(".png"):
|
62 |
+
Image.fromarray(input_image).save(imgByteArr, format="PNG")
|
63 |
else:
|
64 |
+
Image.fromarray(input_image).save(imgByteArr, format="JPEG", quality=95)
|
65 |
imgByteArr = imgByteArr.getvalue()
|
66 |
|
67 |
start_time = time.perf_counter()
|