vision-agent 0.2.210__py3-none-any.whl → 0.2.211__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.
@@ -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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vision-agent
3
- Version: 0.2.210
3
+ Version: 0.2.211
4
4
  Summary: Toolset for Vision Agent
5
5
  Author: Landing AI
6
6
  Author-email: dev@landing.ai
@@ -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=tnTaM8b8AdqR98M_jiDC_CbQ2dwdLU6B4YnxqDQORwc,2979
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=6JkAZxQb0cBInl0D6Bfsi1saf9UYiMc0X1FKmkFwi9A,10144
34
- vision_agent/tools/tools.py,sha256=jkMwt-d8639Nlg7sayWLZCjurPZLIAzS67A6uy-kpjU,94982
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
38
  vision_agent/utils/execute.py,sha256=ktJX1gWBk4D_tXeWV5olGUMC4dU_Z6m5oSv-6Yu1O0w,28292
39
- vision_agent/utils/image_utils.py,sha256=_6Xy4WwTF-sdKhjsmqKzcpv9LpjA6k4CIjuT6LdYwOg,11679
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.210.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
44
- vision_agent-0.2.210.dist-info/METADATA,sha256=iwv0R2BvW3CLmCMscBm6mFUVsexoX-x8WINHiEuzrzA,19071
45
- vision_agent-0.2.210.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
46
- vision_agent-0.2.210.dist-info/RECORD,,
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,,