vidformer 1.0.1__tar.gz → 1.1.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vidformer
3
- Version: 1.0.1
3
+ Version: 1.1.1
4
4
  Summary: vidformer-py is a Python 🐍 interface for [vidformer](https://github.com/ixlab/vidformer).
5
5
  Author-email: Dominik Winecki <dominikwinecki@gmail.com>
6
6
  Requires-Python: >=3.8
@@ -9,7 +9,7 @@ vidformer-py is a Python 🐍 interface for [vidformer](https://github.com/ixlab
9
9
  * [🧑‍💻 Source Code](https://github.com/ixlab/vidformer/tree/main/vidformer-py/)
10
10
  """
11
11
 
12
- __version__ = "1.0.1"
12
+ __version__ = "1.1.1"
13
13
 
14
14
 
15
15
  import base64
@@ -88,7 +88,7 @@ def _server():
88
88
  _global_cv2_server = vf.Server(server_endpoint, api_key)
89
89
  else:
90
90
  raise Exception(
91
- "No server set for the cv2 frontend. Set VF_IGNI_ENDPOINT and VF_IGNI_API_KEY environment variables or use cv2.set_server() before use."
91
+ "No server set for the cv2 frontend (https://ixlab.github.io/vidformer/install.html). Set VF_IGNI_ENDPOINT and VF_IGNI_API_KEY environment variables or use cv2.set_server() before use."
92
92
  )
93
93
  return _global_cv2_server
94
94
 
@@ -315,6 +315,13 @@ def _inline_frame(arr):
315
315
  return Frame(f, fmt)
316
316
 
317
317
 
318
+ def _check_opencv2(method_name):
319
+ if _opencv2 is None:
320
+ raise NotImplementedError(
321
+ f"{method_name} requires python OpenCV cv2. Either it's not installed or the import failed (such as a mission libGL.so.1)."
322
+ )
323
+
324
+
318
325
  class VideoCapture:
319
326
  def __init__(self, path: str):
320
327
  server = _server()
@@ -779,8 +786,7 @@ def getFontScaleFromHeight(*args, **kwargs):
779
786
  """
780
787
  cv.getFontScaleFromHeight( fontFace, pixelHeight[, thickness] )
781
788
  """
782
- if _opencv2 is None:
783
- raise NotImplementedError("getFontScaleFromHeight requires the cv2 module")
789
+ _check_opencv2("getFontScaleFromHeight")
784
790
  return _opencv2.getFontScaleFromHeight(*args, **kwargs)
785
791
 
786
792
 
@@ -788,8 +794,7 @@ def getTextSize(*args, **kwargs):
788
794
  """
789
795
  cv.getTextSize( text, fontFace, fontScale, thickness )
790
796
  """
791
- if _opencv2 is None:
792
- raise NotImplementedError("getTextSize requires the cv2 module")
797
+ _check_opencv2("getTextSize")
793
798
  return _opencv2.getTextSize(*args, **kwargs)
794
799
 
795
800
 
@@ -9,7 +9,13 @@ import supervision as _sv
9
9
  from supervision import Color, ColorLookup, ColorPalette, Detections
10
10
  from supervision.annotators.utils import resolve_color, resolve_text_background_xyxy
11
11
  from supervision.config import CLASS_NAME_DATA_FIELD
12
- from supervision.detection.utils import spread_out_boxes
12
+
13
+ # supervision moved this between two versions, so we need to handle both cases
14
+ try:
15
+ from supervision.detection.utils import spread_out_boxes
16
+ except ImportError:
17
+ from supervision.detection.utils.boxes import spread_out_boxes
18
+
13
19
  from supervision.geometry.core import Position
14
20
 
15
21
  import vidformer.cv2 as vf_cv2
File without changes
File without changes
File without changes