usama1355 commited on
Commit
69c19ec
·
verified ·
1 Parent(s): 8ead842

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -374,11 +374,11 @@ async def predict_rice(file: UploadFile = File(...)):
374
  # --- PREPROCESS IMAGE ---
375
  image_data = await file.read()
376
  image = Image.open(io.BytesIO(image_data)).convert("RGB")
377
- if not is_leaf(image):
378
- return JSONResponse(status_code=400, content={
379
- "error": "Not a leaf",
380
- "message": "Please upload a clear image of a PLANT leaf."
381
- })
382
  image = image.resize((224, 224))
383
 
384
  input_data = np.array(image).astype(np.float32)/255.0
 
374
  # --- PREPROCESS IMAGE ---
375
  image_data = await file.read()
376
  image = Image.open(io.BytesIO(image_data)).convert("RGB")
377
+ #if not is_leaf(image):
378
+ #return JSONResponse(status_code=400, content={
379
+ #"error": "Not a leaf",
380
+ #"message": "Please upload a clear image of a PLANT leaf."
381
+ # })
382
  image = image.resize((224, 224))
383
 
384
  input_data = np.array(image).astype(np.float32)/255.0