Spaces:
Sleeping
Sleeping
Commit
·
d4b066d
1
Parent(s):
a1e07be
made it to accept form data
Browse files
__pycache__/main.cpython-311.pyc
CHANGED
Binary files a/__pycache__/main.cpython-311.pyc and b/__pycache__/main.cpython-311.pyc differ
|
|
main.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import io
|
2 |
-
from fastapi import FastAPI, File, UploadFile
|
3 |
from fastapi.responses import JSONResponse, StreamingResponse
|
4 |
from PIL import Image, UnidentifiedImageError
|
5 |
from routes.segmentation import segment_chess_board
|
@@ -88,7 +88,7 @@ async def get_coords(file: UploadFile = File(...)):
|
|
88 |
|
89 |
|
90 |
@app.post("/getFen")
|
91 |
-
async def get_fen(file : UploadFile = File(), perspective : str = "w", next_to_move : str = "w"):
|
92 |
|
93 |
if perspective not in ["w" , "b"]:
|
94 |
return JSONResponse(content={"error" : "Perspective should be w (white) or b (black)"}, status_code=500)
|
|
|
1 |
import io
|
2 |
+
from fastapi import FastAPI, File, UploadFile, Form
|
3 |
from fastapi.responses import JSONResponse, StreamingResponse
|
4 |
from PIL import Image, UnidentifiedImageError
|
5 |
from routes.segmentation import segment_chess_board
|
|
|
88 |
|
89 |
|
90 |
@app.post("/getFen")
|
91 |
+
async def get_fen(file : UploadFile = File(), perspective : str = Form("w"), next_to_move : str = Form("w")):
|
92 |
|
93 |
if perspective not in ["w" , "b"]:
|
94 |
return JSONResponse(content={"error" : "Perspective should be w (white) or b (black)"}, status_code=500)
|
routes/__pycache__/fen_generator.cpython-311.pyc
CHANGED
Binary files a/routes/__pycache__/fen_generator.cpython-311.pyc and b/routes/__pycache__/fen_generator.cpython-311.pyc differ
|
|