Skip to content

Commit

Permalink
Revert "get endpoint ready for demo (#33)"
Browse files Browse the repository at this point in the history
This reverts commit 80e8d2e.
  • Loading branch information
dillonalaird authored Apr 1, 2024
1 parent 80e8d2e commit b282b98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 168 deletions.
154 changes: 0 additions & 154 deletions vision_agent/tools/tools.json

This file was deleted.

19 changes: 5 additions & 14 deletions vision_agent/tools/tools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
import tempfile
import os
from abc import ABC
from collections import Counter as CounterClass
from pathlib import Path
Expand Down Expand Up @@ -140,7 +139,7 @@ class GroundingDINO(Tool):
'scores': [0.98, 0.02]}]
"""

_ENDPOINT = "https://soi4ewr6fjqqdf5vuss6rrilee0kumxq.lambda-url.us-east-2.on.aws"
_ENDPOINT = "https://chnicr4kes5ku77niv2zoytggq0qyqlp.lambda-url.us-east-2.on.aws"

name = "grounding_dino_"
description = "'grounding_dino_' is a tool that can detect arbitrary objects with inputs such as category names or referring expressions."
Expand Down Expand Up @@ -183,15 +182,11 @@ def __call__(self, prompt: str, image: Union[str, Path, ImageType]) -> Dict:
image_b64 = convert_to_b64(image)
data = {
"prompt": prompt,
"images": image_b64,
"tool": "visual_grounding",
"images": [image_b64],
}
res = requests.post(
self._ENDPOINT,
headers={
"Content-Type": "application/json",
"Authorization": f"Api-Key {os.environ['BASETEN_API_KEY']}",
},
headers={"Content-Type": "application/json"},
json=data,
)
resp_json: Dict[str, Any] = res.json()
Expand Down Expand Up @@ -235,7 +230,7 @@ class GroundingSAM(Tool):
[1, 1, 1, ..., 1, 1, 1]], dtype=uint8)]}]
"""

_ENDPOINT = "https://model-owp50nlq.api.baseten.co/production/predict"
_ENDPOINT = "https://cou5lfmus33jbddl6hoqdfbw7e0qidrw.lambda-url.us-east-2.on.aws"

name = "grounding_sam_"
description = "'grounding_sam_' is a tool that can detect and segment arbitrary objects with inputs such as category names or referring expressions."
Expand Down Expand Up @@ -279,14 +274,10 @@ def __call__(self, prompt: List[str], image: Union[str, ImageType]) -> Dict:
data = {
"classes": prompt,
"image": image_b64,
"tool": "visual_grounding_segment",
}
res = requests.post(
self._ENDPOINT,
headers={
"Content-Type": "application/json",
"Authorization": f"Api-Key {os.environ['BASETEN_API_KEY']}",
},
headers={"Content-Type": "application/json"},
json=data,
)
resp_json: Dict[str, Any] = res.json()
Expand Down

0 comments on commit b282b98

Please sign in to comment.