Spaces:
Sleeping
Sleeping
Commit
·
4b19cc8
1
Parent(s):
af4e793
building
Browse files- .gradio/flagged/dataset1.csv +2 -0
- __pycache__/main.cpython-313.pyc +0 -0
- main.py +9 -0
- requirements.txt +1 -1
.gradio/flagged/dataset1.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
output,timestamp
|
2 |
+
,2025-02-20 21:08:54.132491
|
__pycache__/main.cpython-313.pyc
CHANGED
Binary files a/__pycache__/main.cpython-313.pyc and b/__pycache__/main.cpython-313.pyc differ
|
|
main.py
CHANGED
@@ -4,6 +4,7 @@ import tempfile
|
|
4 |
from fastapi import FastAPI, File, UploadFile, Form
|
5 |
from fastapi.responses import JSONResponse, StreamingResponse
|
6 |
from PIL import Image, UnidentifiedImageError
|
|
|
7 |
from routes.segmentation import segment_chess_board
|
8 |
from routes.detection import detect_pieces
|
9 |
from routes.fen_generator import gen_fen
|
@@ -13,6 +14,9 @@ from pydantic import BaseModel
|
|
13 |
import asyncio
|
14 |
import sys
|
15 |
import tracemalloc
|
|
|
|
|
|
|
16 |
tracemalloc.start()
|
17 |
|
18 |
|
@@ -27,6 +31,7 @@ class DetectionResults(BaseModel):
|
|
27 |
confidences: list
|
28 |
classes: list
|
29 |
|
|
|
30 |
@app.get("/test")
|
31 |
async def read_root():
|
32 |
return {
|
@@ -101,3 +106,7 @@ async def getReview(file: UploadFile = File(...)):
|
|
101 |
|
102 |
except Exception as e:
|
103 |
return JSONResponse(content={"error": "Unexpected error occurred", "details": str(e)}, status_code=500)
|
|
|
|
|
|
|
|
|
|
4 |
from fastapi import FastAPI, File, UploadFile, Form
|
5 |
from fastapi.responses import JSONResponse, StreamingResponse
|
6 |
from PIL import Image, UnidentifiedImageError
|
7 |
+
import uvicorn
|
8 |
from routes.segmentation import segment_chess_board
|
9 |
from routes.detection import detect_pieces
|
10 |
from routes.fen_generator import gen_fen
|
|
|
14 |
import asyncio
|
15 |
import sys
|
16 |
import tracemalloc
|
17 |
+
from fastapi import requests
|
18 |
+
import gradio as gr
|
19 |
+
|
20 |
tracemalloc.start()
|
21 |
|
22 |
|
|
|
31 |
confidences: list
|
32 |
classes: list
|
33 |
|
34 |
+
|
35 |
@app.get("/test")
|
36 |
async def read_root():
|
37 |
return {
|
|
|
106 |
|
107 |
except Exception as e:
|
108 |
return JSONResponse(content={"error": "Unexpected error occurred", "details": str(e)}, status_code=500)
|
109 |
+
|
110 |
+
|
111 |
+
if __name__ == "__main__":
|
112 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|
requirements.txt
CHANGED
@@ -66,4 +66,4 @@ urllib3==2.3.0
|
|
66 |
uvicorn==0.34.0
|
67 |
watchfiles==1.0.4
|
68 |
websockets==15.0
|
69 |
-
opencv-python-headless
|
|
|
66 |
uvicorn==0.34.0
|
67 |
watchfiles==1.0.4
|
68 |
websockets==15.0
|
69 |
+
opencv-python-headless
|