Spaces:
Runtime error
Runtime error
Commit
•
0890b20
1
Parent(s):
c912c92
throw status
Browse files- app/constants.py +1 -1
- app/routers/friend_request.py +1 -1
- app/routers/image.py +5 -1
app/constants.py
CHANGED
@@ -167,4 +167,4 @@ classNames = [
|
|
167 |
"toothbrush",
|
168 |
]
|
169 |
|
170 |
-
test_uid = "VAbtgG1IrWSOqoJgxe7u2yEqpIg2"
|
|
|
167 |
"toothbrush",
|
168 |
]
|
169 |
|
170 |
+
test_uid = "VAbtgG1IrWSOqoJgxe7u2yEqpIg2"
|
app/routers/friend_request.py
CHANGED
@@ -86,7 +86,7 @@ def acceptRequest(RequestId: str, user=Depends(get_current_user)):
|
|
86 |
|
87 |
|
88 |
async def sendNotificationToInviter(inviterId: str, invitee):
|
89 |
-
|
90 |
|
91 |
|
92 |
async def makeFriend(inviteeId: str, inviterId: str):
|
|
|
86 |
|
87 |
|
88 |
async def sendNotificationToInviter(inviterId: str, invitee):
|
89 |
+
return HTTPException(status_code=501, detail="Not implemented yet")
|
90 |
|
91 |
|
92 |
async def makeFriend(inviteeId: str, inviterId: str):
|
app/routers/image.py
CHANGED
@@ -16,7 +16,11 @@ async def handleImageRequest(
|
|
16 |
threshold: float = 0.3,
|
17 |
raw: bool = False,
|
18 |
):
|
19 |
-
|
|
|
|
|
|
|
|
|
20 |
if raw:
|
21 |
bboxes, labels = inferenceImage(img, threshold, raw)
|
22 |
return {"bboxes": bboxes.tolist(), "labels": labels.tolist()}
|
|
|
16 |
threshold: float = 0.3,
|
17 |
raw: bool = False,
|
18 |
):
|
19 |
+
try:
|
20 |
+
img = imfrombytes(file, cv2.IMREAD_COLOR)
|
21 |
+
except:
|
22 |
+
return Response(content="Failed to read image", status_code=400)
|
23 |
+
|
24 |
if raw:
|
25 |
bboxes, labels = inferenceImage(img, threshold, raw)
|
26 |
return {"bboxes": bboxes.tolist(), "labels": labels.tolist()}
|