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