Skip to content

Commit 1fc1a4f

Browse files
committed
udpate obj detection
1 parent 95e95ea commit 1fc1a4f

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

jigsawstack/__init__.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from .embedding import Embedding, AsyncEmbedding
1616
from .exceptions import JigsawStackError
1717
from .image_generation import ImageGeneration, AsyncImageGeneration
18-
from .object_detection import ObjectDetection, AsyncObjectDetection
1918

2019

2120
class JigsawStack:
@@ -119,11 +118,6 @@ def __init__(
119118
disable_request_logging=disable_request_logging,
120119
).image_generation
121120

122-
self.object_detection = ObjectDetection(
123-
api_key=api_key,
124-
api_url=api_url,
125-
disable_request_logging=disable_request_logging,
126-
)
127121

128122

129123
class AsyncJigsawStack:
@@ -235,11 +229,6 @@ def __init__(
235229
disable_request_logging=disable_request_logging,
236230
).image_generation
237231

238-
self.object_detection = AsyncObjectDetection(
239-
api_key=api_key,
240-
api_url=api_url,
241-
disable_request_logging=disable_request_logging,
242-
)
243232

244233

245234
# Create a global instance of the Web class

jigsawstack/vision.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ async def vocr(self, params: VOCRParams) -> OCRResponse:
212212

213213
async def object_detection(self, params: ObjectDetectionParams) -> ObjectDetectionResponse:
214214
path = "/ai/object_detection"
215-
resp = AsyncRequest(
215+
resp = await AsyncRequest(
216216
config=self.config,
217217
path=path,
218218
params=cast(Dict[Any, Any], params),

tests/test_object_detection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
def test_object_detection_response():
1717
try:
18-
result = jigsaw.object_detection.detect({"url": "https://rogilvkqloanxtvjfrkm.supabase.co/storage/v1/object/public/demo/Collabo%201080x842.jpg"})
18+
result = jigsaw.vision.object_detection({"url": "https://rogilvkqloanxtvjfrkm.supabase.co/storage/v1/object/public/demo/Collabo%201080x842.jpg"})
1919
print(result)
2020
assert result["success"] == True
2121
except JigsawStackError as e:
@@ -26,7 +26,7 @@ def test_object_detection_response_async():
2626
async def _test():
2727
client = jigsawstack.AsyncJigsawStack()
2828
try:
29-
result = await client.object_detection.detect({"url": "https://rogilvkqloanxtvjfrkm.supabase.co/storage/v1/object/public/demo/Collabo%201080x842.jpg"})
29+
result = await client.vision.object_detection({"url": "https://rogilvkqloanxtvjfrkm.supabase.co/storage/v1/object/public/demo/Collabo%201080x842.jpg"})
3030
print(result)
3131
assert result["success"] == True
3232
except JigsawStackError as e:

0 commit comments

Comments
 (0)