D3V1L1810 commited on
Commit
2967851
·
verified ·
1 Parent(s): 8ab58e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -45,7 +45,10 @@ def process_images(params):
45
  return {"error": f"Invalid JSON input: {e.msg} at line {e.lineno} column {e.colno}"}
46
 
47
  image_urls = params.get("urls", [])
48
- file_id = params.get("normalfileID", [])
 
 
 
49
  # api = params.get("api", "")
50
  # job_id = params.get("job_id", "")
51
 
@@ -59,7 +62,7 @@ def process_images(params):
59
  return {"error": f"Error loading images: {str(e)}"}
60
 
61
  names = detect_objects(images) # Perform object detection
62
- solutions = create_solutions(image_urls, names, file_id) # Create solutions with image URLs and bounding boxes
63
 
64
  # result_url = f"{api}/{job_id}"
65
  # send_results_to_api(solutions, result_url)
 
45
  return {"error": f"Invalid JSON input: {e.msg} at line {e.lineno} column {e.colno}"}
46
 
47
  image_urls = params.get("urls", [])
48
+ if not params.get("normalfileID",[]):
49
+ file_ids = [None]*len(image_urls)
50
+ else:
51
+ file_ids = params.get("normalfileID",[])
52
  # api = params.get("api", "")
53
  # job_id = params.get("job_id", "")
54
 
 
62
  return {"error": f"Error loading images: {str(e)}"}
63
 
64
  names = detect_objects(images) # Perform object detection
65
+ solutions = create_solutions(image_urls, names, file_ids) # Create solutions with image URLs and bounding boxes
66
 
67
  # result_url = f"{api}/{job_id}"
68
  # send_results_to_api(solutions, result_url)