vision-agent 1.1.10__py3-none-any.whl → 1.1.12__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.
@@ -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
- from pytube import YouTube # type: ignore
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
- yt = YouTube(str(video_uri))
3198
- # Download the highest resolution video
3199
- video = (
3200
- yt.streams.filter(progressive=True, file_extension="mp4")
3201
- .order_by("resolution")
3202
- .desc()
3203
- .first()
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.10
3
+ Version: 1.1.12
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=6YlqUA2OWlCh4Vqp8vZztW2xdSeQTagR5jx44JCS4-o,131052
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.10.dist-info/METADATA,sha256=kPMiMa4Nc4-OP54nToXy0qRIS_bTfPdTnoCBZDD_I3I,12670
44
- vision_agent-1.1.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
45
- vision_agent-1.1.10.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
46
- vision_agent-1.1.10.dist-info/RECORD,,
43
+ vision_agent-1.1.12.dist-info/METADATA,sha256=Yj5WJJN4ZoeZJ6o0_m7xJf8jgpaQVQ3jJGp8Tb0BsqI,12673
44
+ vision_agent-1.1.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
45
+ vision_agent-1.1.12.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
46
+ vision_agent-1.1.12.dist-info/RECORD,,