vidformer 1.0.0__py3-none-any.whl → 1.1.0__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.
vidformer/__init__.py CHANGED
@@ -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.0"
12
+ __version__ = "1.1.0"
13
13
 
14
14
 
15
15
  import base64
vidformer/cv2/__init__.py CHANGED
@@ -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()
@@ -549,7 +556,7 @@ def imwrite(path, img, *args):
549
556
  server.export_spec(spec.id(), path, encoder=encoder)
550
557
 
551
558
 
552
- def vidplay(video, method=None):
559
+ def vidplay(video, method="html"):
553
560
  """
554
561
  Play a vidformer video specification.
555
562
  """
@@ -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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vidformer
3
- Version: 1.0.0
3
+ Version: 1.1.0
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
@@ -0,0 +1,6 @@
1
+ vidformer/__init__.py,sha256=hFRhfcfKzS7ZMbAOkS8buKX85aXm7r1RvAiAZcp6jeM,29972
2
+ vidformer/cv2/__init__.py,sha256=CJ2XTwWEKKs-2Mk6rNqLWkxVawvbI2w4XD05orgx9PM,26991
3
+ vidformer/supervision/__init__.py,sha256=dRHAcHiZN68gUH_2m3o7Ohsv3NBGxF4XGPeI0pn2_K4,20346
4
+ vidformer-1.1.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
5
+ vidformer-1.1.0.dist-info/METADATA,sha256=yON6fgO2kRKCQfYobBhsQ8cQ0oh6ZePqYM6XALO-6MA,1776
6
+ vidformer-1.1.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: flit 3.11.0
2
+ Generator: flit 3.12.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,6 +0,0 @@
1
- vidformer/__init__.py,sha256=kL_qU6iIV-XOrw4yk2SwCYA2YJIck3fS6Nqonnj55uA,29972
2
- vidformer/cv2/__init__.py,sha256=yBlWAQpbIbL4RgIDN6T_p-7JLERuKOs_m_8mqC55jak,26827
3
- vidformer/supervision/__init__.py,sha256=dRHAcHiZN68gUH_2m3o7Ohsv3NBGxF4XGPeI0pn2_K4,20346
4
- vidformer-1.0.0.dist-info/WHEEL,sha256=_2ozNFCLWc93bK4WKHCO-eDUENDlo-dgc9cU3qokYO4,82
5
- vidformer-1.0.0.dist-info/METADATA,sha256=zSQ1w9B6S4cToRYM3cpVQ3MG8dY7oop09YtS9aI-Z2E,1776
6
- vidformer-1.0.0.dist-info/RECORD,,