Update app.py
Browse files
app.py
CHANGED
@@ -83,8 +83,7 @@ def detect_combined(image):
|
|
83 |
nestle_boxes.append((pred['x'], pred['y'], pred['width'], pred['height']))
|
84 |
|
85 |
# ===== CountGD Detection =====
|
86 |
-
url = "https://api.landing.ai/v1/tools/
|
87 |
-
|
88 |
headers = {"Authorization": f"Basic {COUNTGD_API_KEY}"}
|
89 |
competitor_boxes = []
|
90 |
COUNTGD_PROMPTS = ["cans", "bottle", "boxed milk", "milk"]
|
@@ -92,7 +91,7 @@ def detect_combined(image):
|
|
92 |
for prompt in COUNTGD_PROMPTS:
|
93 |
with open(temp_path, "rb") as f:
|
94 |
files = {"image": f}
|
95 |
-
data = {"prompts": [prompt], "model": "
|
96 |
response = requests.post(url, files=files, data=data, headers=headers)
|
97 |
result = response.json()
|
98 |
|
|
|
83 |
nestle_boxes.append((pred['x'], pred['y'], pred['width'], pred['height']))
|
84 |
|
85 |
# ===== CountGD Detection =====
|
86 |
+
url = "https://api.landing.ai/v1/tools/text-to-object-detection"
|
|
|
87 |
headers = {"Authorization": f"Basic {COUNTGD_API_KEY}"}
|
88 |
competitor_boxes = []
|
89 |
COUNTGD_PROMPTS = ["cans", "bottle", "boxed milk", "milk"]
|
|
|
91 |
for prompt in COUNTGD_PROMPTS:
|
92 |
with open(temp_path, "rb") as f:
|
93 |
files = {"image": f}
|
94 |
+
data = {"prompts": [prompt], "model": "owlv2"}
|
95 |
response = requests.post(url, files=files, data=data, headers=headers)
|
96 |
result = response.json()
|
97 |
|