vision-agent 0.2.209__py3-none-any.whl → 0.2.211__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vision_agent/tools/__init__.py +1 -14
- vision_agent/tools/tool_utils.py +2 -2
- vision_agent/tools/tools.py +526 -757
- vision_agent/utils/execute.py +1 -1
- vision_agent/utils/image_utils.py +16 -0
- {vision_agent-0.2.209.dist-info → vision_agent-0.2.211.dist-info}/METADATA +1 -1
- {vision_agent-0.2.209.dist-info → vision_agent-0.2.211.dist-info}/RECORD +9 -9
- {vision_agent-0.2.209.dist-info → vision_agent-0.2.211.dist-info}/LICENSE +0 -0
- {vision_agent-0.2.209.dist-info → vision_agent-0.2.211.dist-info}/WHEEL +0 -0
vision_agent/utils/execute.py
CHANGED
@@ -88,6 +88,22 @@ def rle_decode_array(rle: Dict[str, List[int]]) -> np.ndarray:
|
|
88
88
|
return binary_mask
|
89
89
|
|
90
90
|
|
91
|
+
def rle_encode_array(mask: np.ndarray) -> Dict[str, List[int]]:
|
92
|
+
r"""Run-length encode a binary mask.
|
93
|
+
|
94
|
+
Parameters:
|
95
|
+
mask: The binary mask to encode.
|
96
|
+
"""
|
97
|
+
size = mask.shape[:2]
|
98
|
+
flattened = mask.ravel(order="F")
|
99
|
+
|
100
|
+
# Find where values change and compute run lengths
|
101
|
+
diffs = np.diff(np.concatenate([[1], flattened, [1]]))
|
102
|
+
start_idx = np.where(diffs != 0)[0]
|
103
|
+
run_lengths = np.diff(start_idx)
|
104
|
+
return {"size": size, "counts": run_lengths.tolist()} # type: ignore
|
105
|
+
|
106
|
+
|
91
107
|
def b64_to_pil(b64_str: str) -> ImageType:
|
92
108
|
r"""Convert a base64 string to a PIL Image.
|
93
109
|
|
@@ -26,21 +26,21 @@ vision_agent/fonts/default_font_ch_en.ttf,sha256=1YM0Z3XqLDjSNbF7ihQFSAIUdjF9m1r
|
|
26
26
|
vision_agent/lmm/__init__.py,sha256=jyY1sJb_tYKg5-Wzs3p1lvwFkc-aUNZfMcLy3TOC4Zg,100
|
27
27
|
vision_agent/lmm/lmm.py,sha256=x_nIyDNDZwq4-pfjnJTmcyyJZ2_B7TjkA5jZp88YVO8,17103
|
28
28
|
vision_agent/lmm/types.py,sha256=ZEXR_ptBL0ZwDMTDYkgxUCmSZFmBYPQd2jreNzr_8UY,221
|
29
|
-
vision_agent/tools/__init__.py,sha256
|
29
|
+
vision_agent/tools/__init__.py,sha256=-49o3X7bWG7sMxk0pMifO7BmN_cwDFcuGfzll48qAV4,2678
|
30
30
|
vision_agent/tools/meta_tools.py,sha256=TPeS7QWnc_PmmU_ndiDT03dXbQ5yDSP33E7U8cSj7Ls,28660
|
31
31
|
vision_agent/tools/planner_tools.py,sha256=k7PPu-HhwDwusQgFSPTCWKRVVHBzPMeYB6h2xSEjdUo,13273
|
32
32
|
vision_agent/tools/prompts.py,sha256=V1z4YJLXZuUl_iZ5rY0M5hHc_2tmMEUKr0WocXKGt4E,1430
|
33
|
-
vision_agent/tools/tool_utils.py,sha256=
|
34
|
-
vision_agent/tools/tools.py,sha256=
|
33
|
+
vision_agent/tools/tool_utils.py,sha256=LAnrb_nY6PNVamqJahRN-J0cuOy4gsKvCtSuXJf0RsI,10075
|
34
|
+
vision_agent/tools/tools.py,sha256=SZVKbPwNRbjul5BBKEZcrzcPJKdnWQXjet4tC5Zkkfw,83797
|
35
35
|
vision_agent/tools/tools_types.py,sha256=8hYf2OZhI58gvf65KGaeGkt4EQ56nwLFqIQDPHioOBc,2339
|
36
36
|
vision_agent/utils/__init__.py,sha256=7fMgbZiEwbNS0fBOS_hJI5PuEYBblw36zLi_UjUzvj4,244
|
37
37
|
vision_agent/utils/exceptions.py,sha256=booSPSuoULF7OXRr_YbC4dtKt6gM_HyiFQHBuaW86C4,2052
|
38
|
-
vision_agent/utils/execute.py,sha256=
|
39
|
-
vision_agent/utils/image_utils.py,sha256=
|
38
|
+
vision_agent/utils/execute.py,sha256=ktJX1gWBk4D_tXeWV5olGUMC4dU_Z6m5oSv-6Yu1O0w,28292
|
39
|
+
vision_agent/utils/image_utils.py,sha256=5uoYgXa6E0-lVrXR7K2XE7fe6r_n7pvK64HYQ50vG3w,12182
|
40
40
|
vision_agent/utils/sim.py,sha256=f1emBQM8SmyVKSrhj0NHItnfMHSeTw-Nk2pw-0eBZ5c,7462
|
41
41
|
vision_agent/utils/type_defs.py,sha256=BE12s3JNQy36QvauXHjwyeffVh5enfcvd4vTzSwvEZI,1384
|
42
42
|
vision_agent/utils/video.py,sha256=tRcGp4vEnaDycigL1hBO9k0FBPtDH35fCQciVr9GqYI,6013
|
43
|
-
vision_agent-0.2.
|
44
|
-
vision_agent-0.2.
|
45
|
-
vision_agent-0.2.
|
46
|
-
vision_agent-0.2.
|
43
|
+
vision_agent-0.2.211.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
44
|
+
vision_agent-0.2.211.dist-info/METADATA,sha256=zbTzutwYFj7D_r8zNm92DmlXZkn4VuEeNDAPoFMq4Ks,19071
|
45
|
+
vision_agent-0.2.211.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
46
|
+
vision_agent-0.2.211.dist-info/RECORD,,
|
File without changes
|
File without changes
|