Spaces:
Sleeping
Sleeping
Commit
·
0278799
1
Parent(s):
bf06020
main.py
CHANGED
@@ -71,10 +71,10 @@ async def root():
|
|
71 |
|
72 |
@app.post("/segmentation")
|
73 |
async def segmentation(file: UploadFile = File(...)):
|
|
|
74 |
image_dataset = []
|
75 |
for file in os.listdir("./images"):
|
76 |
image_dataset.append(cv2.resize(cv2.imread('./images/' + file), (160, 544)))
|
77 |
-
contents = await file.read()
|
78 |
image = Image.open(BytesIO(contents))
|
79 |
open_cv_image = np.array(image)
|
80 |
open_cv_image = cv2.resize(open_cv_image, (160, 544))
|
|
|
71 |
|
72 |
@app.post("/segmentation")
|
73 |
async def segmentation(file: UploadFile = File(...)):
|
74 |
+
contents = await file.read()
|
75 |
image_dataset = []
|
76 |
for file in os.listdir("./images"):
|
77 |
image_dataset.append(cv2.resize(cv2.imread('./images/' + file), (160, 544)))
|
|
|
78 |
image = Image.open(BytesIO(contents))
|
79 |
open_cv_image = np.array(image)
|
80 |
open_cv_image = cv2.resize(open_cv_image, (160, 544))
|