Spaces:
Runtime error
Runtime error
Soham Chandratre
commited on
Commit
·
aafa470
1
Parent(s):
94c7394
minor changes
Browse files
__pycache__/main.cpython-311.pyc
ADDED
|
Binary file (738 Bytes). View file
|
|
|
model/__pycache__/pothole_model.cpython-311.pyc
CHANGED
|
Binary files a/model/__pycache__/pothole_model.cpython-311.pyc and b/model/__pycache__/pothole_model.cpython-311.pyc differ
|
|
|
requirements.txt
CHANGED
|
@@ -6,6 +6,6 @@ passlib[bcrypt]
|
|
| 6 |
python-jose[cryptography]
|
| 7 |
python-multipart
|
| 8 |
certifi
|
| 9 |
-
|
| 10 |
pillow
|
| 11 |
tensorflow==2.13.1
|
|
|
|
| 6 |
python-jose[cryptography]
|
| 7 |
python-multipart
|
| 8 |
certifi
|
| 9 |
+
firebase_admin
|
| 10 |
pillow
|
| 11 |
tensorflow==2.13.1
|
routes/__pycache__/route.cpython-311.pyc
CHANGED
|
Binary files a/routes/__pycache__/route.cpython-311.pyc and b/routes/__pycache__/route.cpython-311.pyc differ
|
|
|
routes/route.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from fastapi import APIRouter, HTTPException,Depends,File, UploadFile
|
| 2 |
from fastapi.responses import JSONResponse
|
| 3 |
from config.database import admin_collection, user_collection,notification_collection,pothole_image_collection
|
| 4 |
-
from model.pothole_model import
|
| 5 |
from utils.auth import create_access_token, hash_password, verify_password, verify_token
|
| 6 |
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
| 7 |
from schema.model import Admin, PoholeInfo, PotInfoById, PotholeFilters, PotholeModel, UpdatePotholeInfo, User, UserLogin, VerifyOtp
|
|
@@ -262,12 +262,13 @@ async def verify_pothole(potholeModel: PotholeModel, token: HTTPAuthorizationCre
|
|
| 262 |
image_bytes = response.content
|
| 263 |
|
| 264 |
# Pass image bytes to your model function
|
| 265 |
-
results =
|
| 266 |
|
| 267 |
-
if results == 1:
|
| 268 |
-
|
| 269 |
-
else:
|
| 270 |
-
|
|
|
|
| 271 |
except Exception as e:
|
| 272 |
return JSONResponse(content={"response": f"{e}"})
|
| 273 |
|
|
|
|
| 1 |
from fastapi import APIRouter, HTTPException,Depends,File, UploadFile
|
| 2 |
from fastapi.responses import JSONResponse
|
| 3 |
from config.database import admin_collection, user_collection,notification_collection,pothole_image_collection
|
| 4 |
+
from model.pothole_model import load_image_model
|
| 5 |
from utils.auth import create_access_token, hash_password, verify_password, verify_token
|
| 6 |
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
| 7 |
from schema.model import Admin, PoholeInfo, PotInfoById, PotholeFilters, PotholeModel, UpdatePotholeInfo, User, UserLogin, VerifyOtp
|
|
|
|
| 262 |
image_bytes = response.content
|
| 263 |
|
| 264 |
# Pass image bytes to your model function
|
| 265 |
+
results = load_image_model(image_bytes)
|
| 266 |
|
| 267 |
+
# if results == 1:
|
| 268 |
+
# return JSONResponse(content={"response": "Pothole"})
|
| 269 |
+
# else:
|
| 270 |
+
# return JSONResponse(content={"response": "notPothole"})
|
| 271 |
+
return JSONResponse(content={"response": "Pothole"})
|
| 272 |
except Exception as e:
|
| 273 |
return JSONResponse(content={"response": f"{e}"})
|
| 274 |
|