vision-agent 0.2.186__tar.gz → 0.2.187__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {vision_agent-0.2.186 → vision_agent-0.2.187}/PKG-INFO +1 -1
- {vision_agent-0.2.186 → vision_agent-0.2.187}/pyproject.toml +1 -1
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/tools/tools.py +10 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/utils/video.py +9 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/LICENSE +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/README.md +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/__init__.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/agent/__init__.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/agent/agent.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/agent/agent_utils.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/agent/vision_agent.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/agent/vision_agent_coder.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/agent/vision_agent_coder_prompts.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/agent/vision_agent_planner.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/agent/vision_agent_planner_prompts.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/agent/vision_agent_prompts.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/clients/__init__.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/clients/http.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/clients/landing_public_api.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/fonts/__init__.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/fonts/default_font_ch_en.ttf +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/lmm/__init__.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/lmm/lmm.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/lmm/types.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/tools/__init__.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/tools/meta_tools.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/tools/prompts.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/tools/tool_utils.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/tools/tools_types.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/utils/__init__.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/utils/exceptions.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/utils/execute.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/utils/image_utils.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/utils/sim.py +0 -0
- {vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/utils/type_defs.py +0 -0
@@ -1871,6 +1871,9 @@ def extract_frames_and_timestamps(
|
|
1871
1871
|
>>> extract_frames("path/to/video.mp4")
|
1872
1872
|
[{"frame": np.ndarray, "timestamp": 0.0}, ...]
|
1873
1873
|
"""
|
1874
|
+
if isinstance(fps, str):
|
1875
|
+
# fps could be a string when it's passed in from a web endpoint deployment
|
1876
|
+
fps = float(fps)
|
1874
1877
|
|
1875
1878
|
def reformat(
|
1876
1879
|
frames_and_timestamps: List[Tuple[np.ndarray, float]],
|
@@ -1934,6 +1937,7 @@ def save_json(data: Any, file_path: str) -> None:
|
|
1934
1937
|
return bool(obj)
|
1935
1938
|
return json.JSONEncoder.default(self, obj)
|
1936
1939
|
|
1940
|
+
Path(file_path).parent.mkdir(parents=True, exist_ok=True)
|
1937
1941
|
with open(file_path, "w") as f:
|
1938
1942
|
json.dump(data, f, cls=NumpyEncoder)
|
1939
1943
|
|
@@ -1976,6 +1980,7 @@ def save_image(image: np.ndarray, file_path: str) -> None:
|
|
1976
1980
|
-------
|
1977
1981
|
>>> save_image(image)
|
1978
1982
|
"""
|
1983
|
+
Path(file_path).parent.mkdir(parents=True, exist_ok=True)
|
1979
1984
|
from IPython.display import display
|
1980
1985
|
|
1981
1986
|
if not isinstance(image, np.ndarray) or (
|
@@ -2006,6 +2011,9 @@ def save_video(
|
|
2006
2011
|
>>> save_video(frames)
|
2007
2012
|
"/tmp/tmpvideo123.mp4"
|
2008
2013
|
"""
|
2014
|
+
if isinstance(fps, str):
|
2015
|
+
# fps could be a string when it's passed in from a web endpoint deployment
|
2016
|
+
fps = float(fps)
|
2009
2017
|
if fps <= 0:
|
2010
2018
|
raise ValueError(f"fps must be greater than 0 got {fps}")
|
2011
2019
|
|
@@ -2022,6 +2030,8 @@ def save_video(
|
|
2022
2030
|
output_video_path = tempfile.NamedTemporaryFile(
|
2023
2031
|
delete=False, suffix=".mp4"
|
2024
2032
|
).name
|
2033
|
+
else:
|
2034
|
+
Path(output_video_path).parent.mkdir(parents=True, exist_ok=True)
|
2025
2035
|
|
2026
2036
|
output_video_path = video_writer(frames, fps, output_video_path)
|
2027
2037
|
_save_video_to_result(output_video_path)
|
@@ -58,6 +58,9 @@ def video_writer(
|
|
58
58
|
fps: float = _DEFAULT_INPUT_FPS,
|
59
59
|
filename: Optional[str] = None,
|
60
60
|
) -> str:
|
61
|
+
if isinstance(fps, str):
|
62
|
+
# fps could be a string when it's passed in from a web endpoint deployment
|
63
|
+
fps = float(fps)
|
61
64
|
if filename is None:
|
62
65
|
filename = tempfile.NamedTemporaryFile(delete=False, suffix=".mp4").name
|
63
66
|
container = av.open(filename, mode="w")
|
@@ -92,6 +95,9 @@ def frames_to_bytes(
|
|
92
95
|
fps: the frames per second of the video
|
93
96
|
file_ext: the file extension of the video file
|
94
97
|
"""
|
98
|
+
if isinstance(fps, str):
|
99
|
+
# fps could be a string when it's passed in from a web endpoint deployment
|
100
|
+
fps = float(fps)
|
95
101
|
with tempfile.NamedTemporaryFile(delete=True, suffix=file_ext) as temp_file:
|
96
102
|
video_writer(frames, fps, temp_file.name)
|
97
103
|
|
@@ -120,6 +126,9 @@ def extract_frames_from_video(
|
|
120
126
|
from the start of the video. E.g. 12.125 means 12.125 seconds from the start of
|
121
127
|
the video. The frames are sorted by the timestamp in ascending order.
|
122
128
|
"""
|
129
|
+
if isinstance(fps, str):
|
130
|
+
# fps could be a string when it's passed in from a web endpoint deployment
|
131
|
+
fps = float(fps)
|
123
132
|
|
124
133
|
cap = cv2.VideoCapture(video_uri)
|
125
134
|
orig_fps = cap.get(cv2.CAP_PROP_FPS)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/agent/vision_agent_coder_prompts.py
RENAMED
File without changes
|
File without changes
|
{vision_agent-0.2.186 → vision_agent-0.2.187}/vision_agent/agent/vision_agent_planner_prompts.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|