LiamKhoaLe commited on
Commit
6a3e20a
·
1 Parent(s): e3fe9bf

Update API handler

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -302,7 +302,7 @@ def stream(uid:str):
302
 
303
  # ─── Detect animal/wildlife ─────────────────────────────────────────────────
304
  # Init clients
305
- # https://universe.roboflow.com/team-hope-mmcyy/hydroquest
306
  import base64, requests
307
  def roboflow_infer(image_path, api_url, api_key):
308
  with open(image_path, "rb") as f:
@@ -346,7 +346,7 @@ async def detect_animals(file: UploadFile = File(...)):
346
  fish_response = roboflow_infer(
347
  img_path,
348
  "https://detect.roboflow.com/hydroquest/1",
349
- api_url=os.getenv("ROBOFLOW_KEY", "")
350
  )
351
  for pred in fish_response.get("predictions", []):
352
  if pred["confidence"] >= 0.70:
@@ -365,7 +365,7 @@ async def detect_animals(file: UploadFile = File(...)):
365
  bird_response = roboflow_infer(
366
  img_path,
367
  "https://detect.roboflow.com/bird_only-pt0bm/1",
368
- api_url=os.getenv("ROBOFLOW_KEY", "")
369
  )
370
  for pred in bird_response.get("predictions", []):
371
  if pred["confidence"] >= 0.70:
 
302
 
303
  # ─── Detect animal/wildlife ─────────────────────────────────────────────────
304
  # Init clients
305
+ # https://universe.roboflow.com/team-hope-mmcyy/hydroquest | https://universe.roboflow.com/sky-sd2zq/bird_only-pt0bm/model/1
306
  import base64, requests
307
  def roboflow_infer(image_path, api_url, api_key):
308
  with open(image_path, "rb") as f:
 
346
  fish_response = roboflow_infer(
347
  img_path,
348
  "https://detect.roboflow.com/hydroquest/1",
349
+ api_key=os.getenv("ROBOFLOW_KEY", "")
350
  )
351
  for pred in fish_response.get("predictions", []):
352
  if pred["confidence"] >= 0.70:
 
365
  bird_response = roboflow_infer(
366
  img_path,
367
  "https://detect.roboflow.com/bird_only-pt0bm/1",
368
+ api_key=os.getenv("ROBOFLOW_KEY", "")
369
  )
370
  for pred in bird_response.get("predictions", []):
371
  if pred["confidence"] >= 0.70: