skanderovitch
commited on
Commit
•
a99a830
1
Parent(s):
d739aa1
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ def read_root():
|
|
27 |
async def extract_features(file: UploadFile = File(...)):
|
28 |
try:
|
29 |
# Validate file format
|
30 |
-
if
|
31 |
raise HTTPException(status_code=400, detail=f"Unsupported file format. Upload a JPEG or PNG image. Received {file.content_type}")
|
32 |
|
33 |
# Read image
|
|
|
27 |
async def extract_features(file: UploadFile = File(...)):
|
28 |
try:
|
29 |
# Validate file format
|
30 |
+
if file.content_type not in ["image/jpeg", "image/png", "image/jpg"]:
|
31 |
raise HTTPException(status_code=400, detail=f"Unsupported file format. Upload a JPEG or PNG image. Received {file.content_type}")
|
32 |
|
33 |
# Read image
|