Update app.py
Browse files
app.py
CHANGED
|
@@ -49,7 +49,10 @@ def process_images(params):
|
|
| 49 |
return {"error": f"Invalid JSON input: {e.msg} at line {e.lineno} column {e.colno}"}
|
| 50 |
|
| 51 |
image_urls = params.get("urls", [])
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
| 53 |
# api = params.get("api", "")
|
| 54 |
# job_id = params.get("job_id", "")
|
| 55 |
|
|
@@ -65,7 +68,7 @@ def process_images(params):
|
|
| 65 |
return {"error": f"Error loading images: {str(e)}"}
|
| 66 |
|
| 67 |
names = detect_objects(images) # Perform object detection
|
| 68 |
-
solutions = create_solutions(image_urls, names,
|
| 69 |
|
| 70 |
# result_url = f"{api}/{job_id}"
|
| 71 |
# send_results_to_api(solutions, result_url)
|
|
|
|
| 49 |
return {"error": f"Invalid JSON input: {e.msg} at line {e.lineno} column {e.colno}"}
|
| 50 |
|
| 51 |
image_urls = params.get("urls", [])
|
| 52 |
+
if not params.get("normalfileID",[]):
|
| 53 |
+
file_ids = [None]*len(image_urls)
|
| 54 |
+
else:
|
| 55 |
+
file_ids = params.get("normalfileID",[])
|
| 56 |
# api = params.get("api", "")
|
| 57 |
# job_id = params.get("job_id", "")
|
| 58 |
|
|
|
|
| 68 |
return {"error": f"Error loading images: {str(e)}"}
|
| 69 |
|
| 70 |
names = detect_objects(images) # Perform object detection
|
| 71 |
+
solutions = create_solutions(image_urls, names, file_ids) # Create solutions with image URLs and bounding boxes
|
| 72 |
|
| 73 |
# result_url = f"{api}/{job_id}"
|
| 74 |
# send_results_to_api(solutions, result_url)
|