vision-agent 1.1.10__py3-none-any.whl → 1.1.11__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.
- vision_agent/tools/tools.py +10 -14
- {vision_agent-1.1.10.dist-info → vision_agent-1.1.11.dist-info}/METADATA +2 -2
- {vision_agent-1.1.10.dist-info → vision_agent-1.1.11.dist-info}/RECORD +5 -5
- {vision_agent-1.1.10.dist-info → vision_agent-1.1.11.dist-info}/WHEEL +0 -0
- {vision_agent-1.1.10.dist-info → vision_agent-1.1.11.dist-info}/licenses/LICENSE +0 -0
vision_agent/tools/tools.py
CHANGED
@@ -19,7 +19,7 @@ import requests
|
|
19
19
|
from IPython.display import display
|
20
20
|
from PIL import Image, ImageDraw, ImageFont
|
21
21
|
from pillow_heif import register_heif_opener # type: ignore
|
22
|
-
|
22
|
+
import yt_dlp # type: ignore
|
23
23
|
import pymupdf # type: ignore
|
24
24
|
from google import genai # type: ignore
|
25
25
|
from google.genai import types # type: ignore
|
@@ -3174,7 +3174,6 @@ def extract_frames_and_timestamps(
|
|
3174
3174
|
[{"frame": np.ndarray, "timestamp": 0.0}, ...]
|
3175
3175
|
"""
|
3176
3176
|
if isinstance(fps, str):
|
3177
|
-
# fps could be a string when it's passed in from a web endpoint deployment
|
3178
3177
|
fps = float(fps)
|
3179
3178
|
|
3180
3179
|
def reformat(
|
@@ -3194,23 +3193,20 @@ def extract_frames_and_timestamps(
|
|
3194
3193
|
)
|
3195
3194
|
):
|
3196
3195
|
with tempfile.TemporaryDirectory() as temp_dir:
|
3197
|
-
|
3198
|
-
|
3199
|
-
|
3200
|
-
|
3201
|
-
|
3202
|
-
|
3203
|
-
.
|
3204
|
-
|
3205
|
-
if not video:
|
3206
|
-
raise Exception("No suitable video stream found")
|
3207
|
-
video_file_path = video.download(output_path=temp_dir)
|
3196
|
+
ydl_opts = {
|
3197
|
+
"outtmpl": os.path.join(temp_dir, "%(title)s.%(ext)s"),
|
3198
|
+
"format": "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best",
|
3199
|
+
"quiet": True,
|
3200
|
+
}
|
3201
|
+
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
3202
|
+
info = ydl.extract_info(str(video_uri), download=True)
|
3203
|
+
video_file_path = ydl.prepare_filename(info)
|
3208
3204
|
|
3209
3205
|
return reformat(extract_frames_from_video(video_file_path, fps))
|
3206
|
+
|
3210
3207
|
elif str(video_uri).startswith(("http", "https")):
|
3211
3208
|
_, image_suffix = os.path.splitext(video_uri)
|
3212
3209
|
with tempfile.NamedTemporaryFile(delete=False, suffix=image_suffix) as tmp_file:
|
3213
|
-
# Download the video and save it to the temporary file
|
3214
3210
|
with urllib.request.urlopen(str(video_uri)) as response:
|
3215
3211
|
tmp_file.write(response.read())
|
3216
3212
|
return reformat(extract_frames_from_video(tmp_file.name, fps))
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: vision-agent
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.11
|
4
4
|
Summary: Toolset for Vision Agent
|
5
5
|
Project-URL: Homepage, https://landing.ai
|
6
6
|
Project-URL: repository, https://github.com/landing-ai/vision-agent
|
@@ -28,7 +28,6 @@ Requires-Dist: pillow-heif<0.17,>=0.16.0
|
|
28
28
|
Requires-Dist: pillow==10.*
|
29
29
|
Requires-Dist: pydantic<3,>=2.0.0
|
30
30
|
Requires-Dist: pymupdf<2,>=1.23.0
|
31
|
-
Requires-Dist: pytube==15.0.0
|
32
31
|
Requires-Dist: requests==2.*
|
33
32
|
Requires-Dist: rich<14,>=13.7.1
|
34
33
|
Requires-Dist: scikit-learn<2,>=1.5.2
|
@@ -37,6 +36,7 @@ Requires-Dist: tabulate<0.10,>=0.9.0
|
|
37
36
|
Requires-Dist: tenacity<9,>=8.3.0
|
38
37
|
Requires-Dist: tqdm<5.0.0,>=4.64.0
|
39
38
|
Requires-Dist: typing-extensions==4.*
|
39
|
+
Requires-Dist: yt-dlp>=2025.3.31
|
40
40
|
Description-Content-Type: text/markdown
|
41
41
|
|
42
42
|
<div align="center">
|
@@ -30,7 +30,7 @@ vision_agent/tools/__init__.py,sha256=PRUka2eqHwPWJxwfpLj-O2Ab7hXG_dsE1Aov3TE6te
|
|
30
30
|
vision_agent/tools/meta_tools.py,sha256=9iJilpGYEiXW0nYPTYAWHa7l23wGN8IM5KbE7mWDOT0,6798
|
31
31
|
vision_agent/tools/planner_tools.py,sha256=iQWtTgXdomn0IWrbmvXXM-y8Q_RSEOxyP04HIRLrgWI,19576
|
32
32
|
vision_agent/tools/prompts.py,sha256=V1z4YJLXZuUl_iZ5rY0M5hHc_2tmMEUKr0WocXKGt4E,1430
|
33
|
-
vision_agent/tools/tools.py,sha256=
|
33
|
+
vision_agent/tools/tools.py,sha256=K2QW-0esNBygtlRcyUwVRRhV1FV5UaznHYhFkFZkL-I,130851
|
34
34
|
vision_agent/utils/__init__.py,sha256=mANUs_84VL-3gpZbXryvV2mWU623eWnRlJCSUHtMjuw,122
|
35
35
|
vision_agent/utils/agent.py,sha256=2ifTP5QElItnr4YHOJR6L5P1PUzV0GhChTTqVxuVyQg,15153
|
36
36
|
vision_agent/utils/exceptions.py,sha256=zis8smCbdEylBVZBTVfEUfAh7Rb7cWV3MSPambu6FsQ,1837
|
@@ -40,7 +40,7 @@ vision_agent/utils/tools.py,sha256=Days0dETPRQLSDamMKPnXFsc5g5IKX9QJcPPNmSHNdM,8
|
|
40
40
|
vision_agent/utils/tools_doc.py,sha256=PKcXXbJktiuPi9q6Q1zXzFx24Dh229SNgWBDtZ2fQSQ,2730
|
41
41
|
vision_agent/utils/video.py,sha256=rjsQ1sKKisaQ6AVjJz0zd_G4g-ovRweS_rs4JEhenoI,5340
|
42
42
|
vision_agent/utils/video_tracking.py,sha256=DZLFpNCuzuPJQzbQoVNcp-m4dKxgiKdCNM5QTh_zURE,12245
|
43
|
-
vision_agent-1.1.
|
44
|
-
vision_agent-1.1.
|
45
|
-
vision_agent-1.1.
|
46
|
-
vision_agent-1.1.
|
43
|
+
vision_agent-1.1.11.dist-info/METADATA,sha256=23g2wi-mLe8lh7zchrhAruxqsyJ1nKD8ILKO4s11Kfw,12673
|
44
|
+
vision_agent-1.1.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
45
|
+
vision_agent-1.1.11.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
46
|
+
vision_agent-1.1.11.dist-info/RECORD,,
|
File without changes
|
File without changes
|