vision-agent 0.0.42__py3-none-any.whl → 0.0.43__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,154 @@
1
+ [
2
+ {
3
+ "name": "image_question_answering",
4
+ "description": "answers a question about an image"
5
+ },
6
+ {
7
+ "name": "text_question_answering",
8
+ "description": "answers a question provided a context in text form"
9
+ },
10
+ {
11
+ "name": "image_captioning",
12
+ "description": "Generate a caption for the image. It can generate a brief description that can be used for image perception and image generation. For example: a) you can use this tool when you want to know what is it in the image\"; and b) when you want to generate a new image similar or resemble to input.png, you can use `image_captioning` to obtain the description about image input.png."
13
+ },
14
+ {
15
+ "name": "image_to_text",
16
+ "description": "Generate a description for the image. It can generate a detailed description that can be used for image perception and image generation. For example: a) you can use this tool when you want to know what is it in the image\"; and b) when you want to generate a new image similar or resemble to input.png, you can use `text_to_image` to obtain the description about image input.png."
17
+ },
18
+ {
19
+ "name": "image_to_edge",
20
+ "description": "get the edge map of the image."
21
+ },
22
+ {
23
+ "name": "image_to_line",
24
+ "description": "get the line map of the image."
25
+ },
26
+ {
27
+ "name": "image_to_hed",
28
+ "description": "get the HED map of the image."
29
+ },
30
+ {
31
+ "name": "image_to_scribble",
32
+ "description": "get the scribble of the image."
33
+ },
34
+ {
35
+ "name": "image_to_pose",
36
+ "description": "Get the pose of the image. It is usually used in image generation conditioned on pose map from input image."
37
+ },
38
+ {
39
+ "name": "image_to_depth",
40
+ "description": "get the depth map of the image."
41
+ },
42
+ {
43
+ "name": "image_to_normal",
44
+ "description": "get the normal map of the image."
45
+ },
46
+ {
47
+ "name": "object_detection",
48
+ "description": "detect all the objects in the image."
49
+ },
50
+ {
51
+ "name": "image_classification",
52
+ "description": "classify the objects in the image."
53
+ },
54
+ {
55
+ "name": "closed_set_image_classification",
56
+ "description": "Given a set of classes as a text prompt, classify the objects in the image based on the given classes."
57
+ },
58
+ {
59
+ "name": "panoptic_segmentation",
60
+ "description": "segment the common objects in the given image."
61
+ },
62
+ {
63
+ "name": "visual_grounding",
64
+ "description": "Visual Grounding (VG) aims to locate the most relevant object or region in an image, based on a natural language query. The query can be a phrase, a sentence or even a multi-round dialogue."
65
+ },
66
+ {
67
+ "name": "visual_grounding_segment",
68
+ "description": "Visual Grounding (VG) aims to locate the most relevant object or region in an image, based on a natural language query. The query can be a phrase, a sentence or even a multi-round dialogue."
69
+ },
70
+ {
71
+ "name": "optical_character_recognition",
72
+ "description": "Optical Character Recognition (OCR) is the process that converts an image of text into a machine-readable text format."
73
+ },
74
+ {
75
+ "name": "select_category",
76
+ "description": "select the target classes in category list with the given condition."
77
+ },
78
+ {
79
+ "name": "select_bbox",
80
+ "description": "select the bounding boxes with the given condition."
81
+ },
82
+ {
83
+ "name": "select_mask",
84
+ "description": "select the masks with the given condition."
85
+ },
86
+ {
87
+ "name": "count_categories",
88
+ "description": "count target categories in the given list."
89
+ },
90
+ {
91
+ "name": "count_objects",
92
+ "description": "count target objects in the given list. It is useful when you want to count the number of objects in the image"
93
+ },
94
+ {
95
+ "name": "count_masks",
96
+ "description": "count target mask in the given list."
97
+ },
98
+ {
99
+ "name": "video_captioning",
100
+ "description": "Generate a caption or description for video. It can generate a detailed description that can be used for video perception and video generation. For example: a) you can use this tool when you want to know what happened in the video\"; and b) when you want to generate tags for input video, you can use translate description obtained from `image_captioning` into tags."
101
+ },
102
+ {
103
+ "name": "video_classification",
104
+ "description": "Classify the video and detect the actions in the video."
105
+ },
106
+ {
107
+ "name": "frame_captioning",
108
+ "description": "Generate a caption or description for video every n seconds. It can generate a detailed description that can be used for video perception and video generation. For example: a) you can use this tool when you want to know what happened in the video\"; and b) when you want to generate tags for input video, you can use translate description obtained from `image_captioning` into tags."
109
+ },
110
+ {
111
+ "name": "frame_classification",
112
+ "description": "Classify the video and detect the actions in the every n seconds."
113
+ },
114
+ {
115
+ "name": "text_to_text_generation",
116
+ "description": "Text to text generation. It can be used for sentence acceptability judgment, Sentiment analysis, Paraphrasing/sentence similarity, Natural language inference, Sentence completion, Word sense disambiguation, Question answering."
117
+ },
118
+ {
119
+ "name": "openai_chat_model",
120
+ "description": "Answer the question by Large Language Model. It is useful for tasks such as generating content, answering questions, engaging in conversations and providing explanations. However, it still has some limitations. For example, it can not directly access the up-to-date information like time, weather, etc."
121
+ },
122
+ {
123
+ "name": "summarization",
124
+ "description": "Summarize sentences, long narratives, articles, papers, textbooks."
125
+ },
126
+ {
127
+ "name": "text_to_tags",
128
+ "description": "Predict the tags of text, article and papers by using the their textual content as input"
129
+ },
130
+ {
131
+ "name": "sentiment_analysis",
132
+ "description": "Sentiment analysis is the process of analyzing digital text to determine if the emotional tone of the message is positive, negative, or neutral."
133
+ }
134
+ ]
135
+
136
+ input_keys: [
137
+ { "image": "image file"},
138
+ { "prompt": "text"},
139
+ { "video": "video file"},
140
+ { "context": "context for text qa"},
141
+ { "tool": "tool name mentioned above"},
142
+ ]
143
+
144
+ output_keys: [
145
+ { "labels": "list of labels for image tasks"},
146
+ { "scores": "list of scores for image and text tasks"},
147
+ { "bboxes": "list of bounding boxes for detection tasks"},
148
+ { "masks": "list of masks for segmentation tasks"},
149
+ { "text": "list of text for text tasks"},
150
+ { "frames": "list of frame numbers for video tasks"},
151
+ ]
152
+
153
+
154
+
@@ -1,5 +1,6 @@
1
1
  import logging
2
2
  import tempfile
3
+ import os
3
4
  from abc import ABC
4
5
  from collections import Counter as CounterClass
5
6
  from pathlib import Path
@@ -139,7 +140,7 @@ class GroundingDINO(Tool):
139
140
  'scores': [0.98, 0.02]}]
140
141
  """
141
142
 
142
- _ENDPOINT = "https://chnicr4kes5ku77niv2zoytggq0qyqlp.lambda-url.us-east-2.on.aws"
143
+ _ENDPOINT = "https://soi4ewr6fjqqdf5vuss6rrilee0kumxq.lambda-url.us-east-2.on.aws"
143
144
 
144
145
  name = "grounding_dino_"
145
146
  description = "'grounding_dino_' is a tool that can detect arbitrary objects with inputs such as category names or referring expressions."
@@ -182,11 +183,15 @@ class GroundingDINO(Tool):
182
183
  image_b64 = convert_to_b64(image)
183
184
  data = {
184
185
  "prompt": prompt,
185
- "images": [image_b64],
186
+ "images": image_b64,
187
+ "tool": "visual_grounding",
186
188
  }
187
189
  res = requests.post(
188
190
  self._ENDPOINT,
189
- headers={"Content-Type": "application/json"},
191
+ headers={
192
+ "Content-Type": "application/json",
193
+ "Authorization": f"Api-Key {os.environ['BASETEN_API_KEY']}",
194
+ },
190
195
  json=data,
191
196
  )
192
197
  resp_json: Dict[str, Any] = res.json()
@@ -230,7 +235,7 @@ class GroundingSAM(Tool):
230
235
  [1, 1, 1, ..., 1, 1, 1]], dtype=uint8)]}]
231
236
  """
232
237
 
233
- _ENDPOINT = "https://cou5lfmus33jbddl6hoqdfbw7e0qidrw.lambda-url.us-east-2.on.aws"
238
+ _ENDPOINT = "https://model-owp50nlq.api.baseten.co/production/predict"
234
239
 
235
240
  name = "grounding_sam_"
236
241
  description = "'grounding_sam_' is a tool that can detect and segment arbitrary objects with inputs such as category names or referring expressions."
@@ -274,10 +279,14 @@ class GroundingSAM(Tool):
274
279
  data = {
275
280
  "classes": prompt,
276
281
  "image": image_b64,
282
+ "tool": "visual_grounding_segment",
277
283
  }
278
284
  res = requests.post(
279
285
  self._ENDPOINT,
280
- headers={"Content-Type": "application/json"},
286
+ headers={
287
+ "Content-Type": "application/json",
288
+ "Authorization": f"Api-Key {os.environ['BASETEN_API_KEY']}",
289
+ },
281
290
  json=data,
282
291
  )
283
292
  resp_json: Dict[str, Any] = res.json()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vision-agent
3
- Version: 0.0.42
3
+ Version: 0.0.43
4
4
  Summary: Toolset for Vision Agent
5
5
  Author: Landing AI
6
6
  Author-email: dev@landing.ai
@@ -18,9 +18,10 @@ vision_agent/lmm/__init__.py,sha256=I8mbeNUajTfWVNqLsuFQVOaNBDlkIhYp9DFU8H4kB7g,
18
18
  vision_agent/lmm/lmm.py,sha256=s_A3SKCoWm2biOt-gS9PXOsa9l-zrmR6mInLjAqam-A,8438
19
19
  vision_agent/tools/__init__.py,sha256=AKN-T659HpwVearRnkCd6wWNoJ6K5kW9gAZwb8IQSLE,235
20
20
  vision_agent/tools/prompts.py,sha256=9RBbyqlNlExsGKlJ89Jkph83DAEJ8PCVGaHoNbyN7TM,1416
21
- vision_agent/tools/tools.py,sha256=aMTBxxaXQp33HwplOS8xrgfbsTJ8e1pwO6byR7HcTJI,23447
21
+ vision_agent/tools/tools.json,sha256=gsXN_Oggp4K-D8qEb7Ws1p7bb7IW8t6wT5hR23-Ovho,6938
22
+ vision_agent/tools/tools.py,sha256=Ov5YpenR0z4yli_UsHm1tpYnOpkqMCMEiEek1ixVh4Y,23747
22
23
  vision_agent/tools/video.py,sha256=40rscP8YvKN3lhZ4PDcOK4XbdFX2duCRpHY_krmBYKU,7476
23
- vision_agent-0.0.42.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
24
- vision_agent-0.0.42.dist-info/METADATA,sha256=r523uVvu-DsNoA-H-18O2JXF4J9G2nZ2cDSmjXUFq_M,5324
25
- vision_agent-0.0.42.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
26
- vision_agent-0.0.42.dist-info/RECORD,,
24
+ vision_agent-0.0.43.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
25
+ vision_agent-0.0.43.dist-info/METADATA,sha256=dVUYPBn6FMIx0Qc58BKFdjCbhHMbO27e52rzKY8dYeI,5324
26
+ vision_agent-0.0.43.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
27
+ vision_agent-0.0.43.dist-info/RECORD,,