QVideo 4.1.0__tar.gz → 4.2.0__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.
Files changed (208) hide show
  1. {qvideo-4.1.0 → qvideo-4.2.0}/PKG-INFO +2 -1
  2. {qvideo-4.1.0 → qvideo-4.2.0}/QVideo.egg-info/PKG-INFO +2 -1
  3. {qvideo-4.1.0 → qvideo-4.2.0}/QVideo.egg-info/requires.txt +1 -0
  4. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Flir/_camera.py +1 -1
  5. {qvideo-4.1.0 → qvideo-4.2.0}/dvr/QCircularBuffer.py +4 -12
  6. {qvideo-4.1.0 → qvideo-4.2.0}/dvr/QDVRWidget.py +21 -5
  7. {qvideo-4.1.0 → qvideo-4.2.0}/lib/QFilterRack.py +1 -1
  8. {qvideo-4.1.0 → qvideo-4.2.0}/lib/QFilterStack.py +7 -3
  9. {qvideo-4.1.0 → qvideo-4.2.0}/lib/QVideoSource.py +7 -3
  10. {qvideo-4.1.0 → qvideo-4.2.0}/pyproject.toml +2 -1
  11. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_circularbuffer.py +2 -25
  12. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qdvrwidget.py +34 -0
  13. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qfilterstack.py +8 -0
  14. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qvideosource.py +12 -0
  15. {qvideo-4.1.0 → qvideo-4.2.0}/LICENSE.md +0 -0
  16. {qvideo-4.1.0 → qvideo-4.2.0}/QCamcorder.py +0 -0
  17. {qvideo-4.1.0 → qvideo-4.2.0}/QVideo.egg-info/SOURCES.txt +0 -0
  18. {qvideo-4.1.0 → qvideo-4.2.0}/QVideo.egg-info/dependency_links.txt +0 -0
  19. {qvideo-4.1.0 → qvideo-4.2.0}/QVideo.egg-info/top_level.txt +0 -0
  20. {qvideo-4.1.0 → qvideo-4.2.0}/README.md +0 -0
  21. {qvideo-4.1.0 → qvideo-4.2.0}/__init__.py +0 -0
  22. {qvideo-4.1.0 → qvideo-4.2.0}/__main__.py +0 -0
  23. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Basler/__init__.py +0 -0
  24. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Basler/_camera.py +0 -0
  25. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Basler/_tree.py +0 -0
  26. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Flir/QListFlirCameras.py +0 -0
  27. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Flir/__init__.py +0 -0
  28. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Flir/_tree.py +0 -0
  29. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Genicam/__init__.py +0 -0
  30. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Genicam/_camera.py +0 -0
  31. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Genicam/_tree.py +0 -0
  32. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/IDS/__init__.py +0 -0
  33. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/IDS/_camera.py +0 -0
  34. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/IDS/_tree.py +0 -0
  35. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/MV/__init__.py +0 -0
  36. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/MV/_camera.py +0 -0
  37. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/MV/_tree.py +0 -0
  38. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Noise/__init__.py +0 -0
  39. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Noise/_camera.py +0 -0
  40. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Noise/_tree.py +0 -0
  41. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/OpenCV/QListCVCameras.py +0 -0
  42. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/OpenCV/__init__.py +0 -0
  43. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/OpenCV/_camera.py +0 -0
  44. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/OpenCV/_devices.py +0 -0
  45. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/OpenCV/_tree.py +0 -0
  46. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Picamera/__init__.py +0 -0
  47. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Picamera/_camera.py +0 -0
  48. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Picamera/_imx500.py +0 -0
  49. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Picamera/_tree.py +0 -0
  50. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Vimbax/__init__.py +0 -0
  51. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Vimbax/_camera.py +0 -0
  52. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/Vimbax/_tree.py +0 -0
  53. {qvideo-4.1.0 → qvideo-4.2.0}/cameras/__init__.py +0 -0
  54. {qvideo-4.1.0 → qvideo-4.2.0}/demos/ROIdemo.py +0 -0
  55. {qvideo-4.1.0 → qvideo-4.2.0}/demos/__init__.py +0 -0
  56. {qvideo-4.1.0 → qvideo-4.2.0}/demos/circulardemo.py +0 -0
  57. {qvideo-4.1.0 → qvideo-4.2.0}/demos/compositedemo.py +0 -0
  58. {qvideo-4.1.0 → qvideo-4.2.0}/demos/demo.py +0 -0
  59. {qvideo-4.1.0 → qvideo-4.2.0}/demos/filterdemo.py +0 -0
  60. {qvideo-4.1.0 → qvideo-4.2.0}/demos/filterrackdemo.py +0 -0
  61. {qvideo-4.1.0 → qvideo-4.2.0}/demos/histogramdemo.py +0 -0
  62. {qvideo-4.1.0 → qvideo-4.2.0}/demos/trackpydemo.py +0 -0
  63. {qvideo-4.1.0 → qvideo-4.2.0}/demos/uniformitydemo.py +0 -0
  64. {qvideo-4.1.0 → qvideo-4.2.0}/demos/yolodemo.py +0 -0
  65. {qvideo-4.1.0 → qvideo-4.2.0}/dvr/QCircularDVRWidget.py +0 -0
  66. {qvideo-4.1.0 → qvideo-4.2.0}/dvr/QHDF5Reader.py +0 -0
  67. {qvideo-4.1.0 → qvideo-4.2.0}/dvr/QHDF5Writer.py +0 -0
  68. {qvideo-4.1.0 → qvideo-4.2.0}/dvr/QOpenCVReader.py +0 -0
  69. {qvideo-4.1.0 → qvideo-4.2.0}/dvr/QOpenCVWriter.py +0 -0
  70. {qvideo-4.1.0 → qvideo-4.2.0}/dvr/__init__.py +0 -0
  71. {qvideo-4.1.0 → qvideo-4.2.0}/dvr/icons_rc.py +0 -0
  72. {qvideo-4.1.0 → qvideo-4.2.0}/filters/_MedianBase.py +0 -0
  73. {qvideo-4.1.0 → qvideo-4.2.0}/filters/__init__.py +0 -0
  74. {qvideo-4.1.0 → qvideo-4.2.0}/filters/artistic.py +0 -0
  75. {qvideo-4.1.0 → qvideo-4.2.0}/filters/blob.py +0 -0
  76. {qvideo-4.1.0 → qvideo-4.2.0}/filters/circletransform.py +0 -0
  77. {qvideo-4.1.0 → qvideo-4.2.0}/filters/darkframe.py +0 -0
  78. {qvideo-4.1.0 → qvideo-4.2.0}/filters/dejitter.py +0 -0
  79. {qvideo-4.1.0 → qvideo-4.2.0}/filters/dog.py +0 -0
  80. {qvideo-4.1.0 → qvideo-4.2.0}/filters/edge.py +0 -0
  81. {qvideo-4.1.0 → qvideo-4.2.0}/filters/exposure.py +0 -0
  82. {qvideo-4.1.0 → qvideo-4.2.0}/filters/flatfield.py +0 -0
  83. {qvideo-4.1.0 → qvideo-4.2.0}/filters/foreground.py +0 -0
  84. {qvideo-4.1.0 → qvideo-4.2.0}/filters/gamma.py +0 -0
  85. {qvideo-4.1.0 → qvideo-4.2.0}/filters/invert.py +0 -0
  86. {qvideo-4.1.0 → qvideo-4.2.0}/filters/laplacian.py +0 -0
  87. {qvideo-4.1.0 → qvideo-4.2.0}/filters/median.py +0 -0
  88. {qvideo-4.1.0 → qvideo-4.2.0}/filters/momean.py +0 -0
  89. {qvideo-4.1.0 → qvideo-4.2.0}/filters/momedian.py +0 -0
  90. {qvideo-4.1.0 → qvideo-4.2.0}/filters/normalize.py +0 -0
  91. {qvideo-4.1.0 → qvideo-4.2.0}/filters/rgb.py +0 -0
  92. {qvideo-4.1.0 → qvideo-4.2.0}/filters/roi.py +0 -0
  93. {qvideo-4.1.0 → qvideo-4.2.0}/filters/samplehold.py +0 -0
  94. {qvideo-4.1.0 → qvideo-4.2.0}/filters/smoothing.py +0 -0
  95. {qvideo-4.1.0 → qvideo-4.2.0}/filters/sobel.py +0 -0
  96. {qvideo-4.1.0 → qvideo-4.2.0}/filters/threshold.py +0 -0
  97. {qvideo-4.1.0 → qvideo-4.2.0}/filters/unsharp.py +0 -0
  98. {qvideo-4.1.0 → qvideo-4.2.0}/lib/QCamera.py +0 -0
  99. {qvideo-4.1.0 → qvideo-4.2.0}/lib/QCameraTree.py +0 -0
  100. {qvideo-4.1.0 → qvideo-4.2.0}/lib/QFPSMeter.py +0 -0
  101. {qvideo-4.1.0 → qvideo-4.2.0}/lib/QHistogramWidget.py +0 -0
  102. {qvideo-4.1.0 → qvideo-4.2.0}/lib/QListCameras.py +0 -0
  103. {qvideo-4.1.0 → qvideo-4.2.0}/lib/QSnapshot.py +0 -0
  104. {qvideo-4.1.0 → qvideo-4.2.0}/lib/QUniformityWidget.py +0 -0
  105. {qvideo-4.1.0 → qvideo-4.2.0}/lib/QVideoFilter.py +0 -0
  106. {qvideo-4.1.0 → qvideo-4.2.0}/lib/QVideoReader.py +0 -0
  107. {qvideo-4.1.0 → qvideo-4.2.0}/lib/QVideoScreen.py +0 -0
  108. {qvideo-4.1.0 → qvideo-4.2.0}/lib/QVideoWriter.py +0 -0
  109. {qvideo-4.1.0 → qvideo-4.2.0}/lib/__init__.py +0 -0
  110. {qvideo-4.1.0 → qvideo-4.2.0}/lib/_camera.py +0 -0
  111. {qvideo-4.1.0 → qvideo-4.2.0}/lib/_jupyter.py +0 -0
  112. {qvideo-4.1.0 → qvideo-4.2.0}/lib/_qabc.py +0 -0
  113. {qvideo-4.1.0 → qvideo-4.2.0}/lib/chooser.py +0 -0
  114. {qvideo-4.1.0 → qvideo-4.2.0}/lib/clickable.py +0 -0
  115. {qvideo-4.1.0 → qvideo-4.2.0}/lib/errors.py +0 -0
  116. {qvideo-4.1.0 → qvideo-4.2.0}/lib/gentl.py +0 -0
  117. {qvideo-4.1.0 → qvideo-4.2.0}/lib/imageops.py +0 -0
  118. {qvideo-4.1.0 → qvideo-4.2.0}/lib/videotypes.py +0 -0
  119. {qvideo-4.1.0 → qvideo-4.2.0}/overlays/__init__.py +0 -0
  120. {qvideo-4.1.0 → qvideo-4.2.0}/overlays/trackpy.py +0 -0
  121. {qvideo-4.1.0 → qvideo-4.2.0}/overlays/yolo.py +0 -0
  122. {qvideo-4.1.0 → qvideo-4.2.0}/setup.cfg +0 -0
  123. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_artistic.py +0 -0
  124. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_blob.py +0 -0
  125. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_camera.py +0 -0
  126. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_chooser.py +0 -0
  127. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_circletransform.py +0 -0
  128. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_circulardemo.py +0 -0
  129. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_circulardvrwidget.py +0 -0
  130. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_clickable.py +0 -0
  131. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_compositedemo.py +0 -0
  132. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_darkframe.py +0 -0
  133. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_dejitter.py +0 -0
  134. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_demo.py +0 -0
  135. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_dog.py +0 -0
  136. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_edge.py +0 -0
  137. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_exposure.py +0 -0
  138. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_filter_export.py +0 -0
  139. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_filterdemo.py +0 -0
  140. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_filterrackdemo.py +0 -0
  141. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_filters_gray.py +0 -0
  142. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_flatfield.py +0 -0
  143. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_foreground.py +0 -0
  144. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_gamma.py +0 -0
  145. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_gentl.py +0 -0
  146. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_histogramdemo.py +0 -0
  147. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_histogramwidget.py +0 -0
  148. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_icons_rc.py +0 -0
  149. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_imageops.py +0 -0
  150. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_invert.py +0 -0
  151. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_jupyter.py +0 -0
  152. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_laplacian.py +0 -0
  153. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_median.py +0 -0
  154. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_momean.py +0 -0
  155. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_momedian.py +0 -0
  156. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_normalize.py +0 -0
  157. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_overlays_package.py +0 -0
  158. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qabc.py +0 -0
  159. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qbaslercamera.py +0 -0
  160. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qcamcorder.py +0 -0
  161. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qcamera.py +0 -0
  162. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qcameratree.py +0 -0
  163. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qfilterrack.py +0 -0
  164. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qflircamera.py +0 -0
  165. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qfpsmeter.py +0 -0
  166. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qgenicamcamera.py +0 -0
  167. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qgenicamtree.py +0 -0
  168. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qhdf5reader.py +0 -0
  169. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qhdf5writer.py +0 -0
  170. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qidscamera.py +0 -0
  171. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qimxcamera.py +0 -0
  172. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qlistcameras.py +0 -0
  173. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qlistcvcameras.py +0 -0
  174. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qlistflircameras.py +0 -0
  175. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qmvcamera.py +0 -0
  176. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qnoisecamera.py +0 -0
  177. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qnoisetree.py +0 -0
  178. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qopencvcamera.py +0 -0
  179. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qopencvdevices.py +0 -0
  180. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qopencvreader.py +0 -0
  181. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qopencvtree.py +0 -0
  182. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qopencvwriter.py +0 -0
  183. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qpicamera.py +0 -0
  184. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qpicameratree.py +0 -0
  185. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qsnapshot.py +0 -0
  186. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qt_binding.py +0 -0
  187. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qvideoreader.py +0 -0
  188. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qvideoscreen.py +0 -0
  189. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qvideowriter.py +0 -0
  190. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_qvimbaxcamera.py +0 -0
  191. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_resolutions.py +0 -0
  192. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_rgb.py +0 -0
  193. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_roi.py +0 -0
  194. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_roidemo.py +0 -0
  195. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_samplehold.py +0 -0
  196. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_smoothing.py +0 -0
  197. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_sobel.py +0 -0
  198. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_threshold.py +0 -0
  199. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_trackpy_overlay.py +0 -0
  200. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_trackpydemo.py +0 -0
  201. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_uniformitydemo.py +0 -0
  202. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_uniformitywidget.py +0 -0
  203. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_unsharp.py +0 -0
  204. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_vendor_trees.py +0 -0
  205. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_videofilter.py +0 -0
  206. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_videotypes.py +0 -0
  207. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_yolo_overlay.py +0 -0
  208. {qvideo-4.1.0 → qvideo-4.2.0}/tests/test_yolodemo.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QVideo
3
- Version: 4.1.0
3
+ Version: 4.2.0
4
4
  Summary: PyQt-based framework for integrating video cameras into research applications
5
5
  Author-email: "David G. Grier" <david.grier@nyu.edu>
6
6
  License: GPL-3.0-or-later
@@ -26,6 +26,7 @@ Requires-Dist: numpy
26
26
  Requires-Dist: opencv-python
27
27
  Requires-Dist: qtpy
28
28
  Requires-Dist: pyqtgraph
29
+ Requires-Dist: psutil
29
30
  Provides-Extra: pyqt5
30
31
  Requires-Dist: PyQt5; extra == "pyqt5"
31
32
  Requires-Dist: PyQt5-sip; extra == "pyqt5"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QVideo
3
- Version: 4.1.0
3
+ Version: 4.2.0
4
4
  Summary: PyQt-based framework for integrating video cameras into research applications
5
5
  Author-email: "David G. Grier" <david.grier@nyu.edu>
6
6
  License: GPL-3.0-or-later
@@ -26,6 +26,7 @@ Requires-Dist: numpy
26
26
  Requires-Dist: opencv-python
27
27
  Requires-Dist: qtpy
28
28
  Requires-Dist: pyqtgraph
29
+ Requires-Dist: psutil
29
30
  Provides-Extra: pyqt5
30
31
  Requires-Dist: PyQt5; extra == "pyqt5"
31
32
  Requires-Dist: PyQt5-sip; extra == "pyqt5"
@@ -2,6 +2,7 @@ numpy
2
2
  opencv-python
3
3
  qtpy
4
4
  pyqtgraph
5
+ psutil
5
6
 
6
7
  [circletransform]
7
8
  scipy
@@ -34,7 +34,7 @@ class QFlirCamera(QGenicamCamera):
34
34
  _producer_filenames = ('Spinnaker_GenTL.cti',)
35
35
  _producerHint = ('Install the Spinnaker SDK and set GENICAM_GENTL64_PATH '
36
36
  'to the directory containing Spinnaker_GenTL.cti '
37
- '(typically /opt/spinnaker/lib/spinnaker-gentl).')
37
+ '(on Linux, typically /opt/spinnaker/lib/spinnaker-gentl).')
38
38
 
39
39
 
40
40
  class QFlirSource(QGenicamSource):
@@ -1,10 +1,10 @@
1
1
  '''Ring buffer that accumulates timestamped frames for later saving.'''
2
- import os
3
2
  from collections import deque
4
3
  from pathlib import Path
5
4
  from time import time
6
5
  from qtpy import QtCore
7
6
  import numpy as np
7
+ import psutil
8
8
  import logging
9
9
 
10
10
  from QVideo.lib.videotypes import Image, FrameInfo
@@ -99,22 +99,14 @@ class QCircularBuffer(QtCore.QObject):
99
99
 
100
100
  @staticmethod
101
101
  def _totalRAM() -> int:
102
- '''Return total physical RAM in bytes, or 0 if undetermined.'''
103
- try:
104
- import psutil
105
- return psutil.virtual_memory().total
106
- except ImportError:
107
- pass
108
- try:
109
- return os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
110
- except (AttributeError, ValueError):
111
- return 0
102
+ '''Return total physical RAM in bytes.'''
103
+ return psutil.virtual_memory().total
112
104
 
113
105
  def _checkMemory(self) -> None:
114
106
  self._warned = True
115
107
  estimated = self._buffer.maxlen * self._frameBytes
116
108
  total = self._totalRAM()
117
- if total > 0 and estimated > _MEMORY_WARN_FRACTION * total:
109
+ if estimated > _MEMORY_WARN_FRACTION * total:
118
110
  est_mb = estimated / 1024 ** 2
119
111
  pct = 100 * estimated / total
120
112
  total_gb = total / 1024 ** 3
@@ -3,6 +3,7 @@ from collections.abc import Callable
3
3
  from qtpy import QtCore, QtGui, QtWidgets
4
4
  from pathlib import Path
5
5
  import numpy as np
6
+ import psutil
6
7
  from QVideo.lib import clickable, QVideoSource
7
8
  from QVideo.lib.videotypes import Image, FrameInfo
8
9
  from .QOpenCVWriter import QOpenCVWriter
@@ -64,6 +65,11 @@ class QDVRWidget(QtWidgets.QFrame):
64
65
  lagLimit : float
65
66
  How far [seconds] the writer may fall behind the newest captured
66
67
  frame. Default: ``1.``.
68
+ maxMemory : float or None
69
+ Memory [bytes] that frames waiting for the writer may occupy.
70
+ The recording is treated as behind as soon as the backlog would
71
+ exceed it, whatever *lagLimit* says. ``None`` means 80% of the
72
+ memory available when recording starts. Default: ``None``.
67
73
  *args :
68
74
  Forwarded to :class:`~qtpy.QtWidgets.QFrame`.
69
75
  **kwargs :
@@ -78,8 +84,9 @@ class QDVRWidget(QtWidgets.QFrame):
78
84
  playing(bool)
79
85
  Emitted when playback starts (``True``) or stops (``False``).
80
86
  behind(float)
81
- Emitted once each time the recording falls more than *lagLimit*
82
- seconds behind the camera, with the lag in seconds.
87
+ Emitted once each time the recording falls behind the camera by
88
+ more than *lagLimit* seconds or *maxMemory* bytes, with the lag
89
+ in seconds.
83
90
  stopped(str)
84
91
  Emitted with the reason when the widget stops a recording by
85
92
  itself, just before ``recording(False)``.
@@ -88,7 +95,8 @@ class QDVRWidget(QtWidgets.QFrame):
88
95
  -----
89
96
  Stopping waits for the writer to finish the frames already captured,
90
97
  so no recorded frame is lost. With *stopWhenBehind* the wait is
91
- bounded by *lagLimit* seconds of data.
98
+ bounded by the smaller of *lagLimit* seconds and *maxMemory* bytes of
99
+ data.
92
100
  '''
93
101
 
94
102
  #: Emitted for each frame during playback.
@@ -159,10 +167,13 @@ class QDVRWidget(QtWidgets.QFrame):
159
167
  filename: str = '',
160
168
  stopWhenBehind: bool = True,
161
169
  lagLimit: float = 1.,
170
+ maxMemory: float | None = None,
162
171
  **kwargs) -> None:
163
172
  super().__init__(*args, **kwargs)
164
173
  self.stopWhenBehind = stopWhenBehind
165
174
  self.lagLimit = lagLimit
175
+ self.maxMemory = maxMemory
176
+ self._budget = float('inf')
166
177
  self._source: QVideoSource | None = None
167
178
  self._writer: object | None = None
168
179
  self._player: QVideoSource | None = None
@@ -361,6 +372,8 @@ class QDVRWidget(QtWidgets.QFrame):
361
372
  nframes=self.nframes.value(),
362
373
  nskip=self.nskip.value())
363
374
  self._late = False
375
+ self._budget = (self.maxMemory
376
+ or 0.8 * psutil.virtual_memory().available)
364
377
  self._writer.frameNumber.connect(self.setFrameNumber)
365
378
  self._writer.finished.connect(self.stop)
366
379
  self._thread = QtCore.QThread()
@@ -460,13 +473,16 @@ class QDVRWidget(QtWidgets.QFrame):
460
473
 
461
474
  The comparison uses the capture times, so it measures the backlog
462
475
  even while the writer is stuck inside a single write, and it
463
- ignores sources that capture slowly.
476
+ ignores sources that capture slowly. The memory budget is
477
+ converted to the time it takes the camera to fill it, so one
478
+ limit serves both.
464
479
  '''
465
480
  taken = self._writer and self._writer.received
466
481
  if info is None or not taken:
467
482
  return
468
483
  lag = info.timestamp - taken.timestamp
469
- late = lag > self.lagLimit
484
+ fill = self._budget / (self.source.fps * frame.nbytes)
485
+ late = lag > min(self.lagLimit, fill)
470
486
  if late and not self._late:
471
487
  self.behind.emit(lag)
472
488
  if self.stopWhenBehind:
@@ -447,7 +447,7 @@ class QFilterRack(QtWidgets.QWidget):
447
447
  path, _ = QtWidgets.QFileDialog.getSaveFileName(
448
448
  self, 'Export Pipeline', 'filter.py', 'Python files (*.py)')
449
449
  if path:
450
- with open(path, 'w') as fh:
450
+ with open(path, 'w', encoding='utf-8') as fh:
451
451
  fh.write(self.exportPipeline())
452
452
 
453
453
  def _removeSlot(self, slot: '_FilterSlot') -> None:
@@ -213,9 +213,13 @@ class QFilterStack(QtCore.QThread):
213
213
  return frame
214
214
 
215
215
  def __del__(self) -> None:
216
- # Python state only: the flag is absent if construction failed and
217
- # False once stopped, when Qt may already have deleted the object.
218
- if vars(self).get('_running'):
216
+ # The garbage collector may get here after Qt has deleted the C++
217
+ # object (or before it was built): then there is no thread to stop.
218
+ try:
219
+ running = self.isRunning()
220
+ except RuntimeError:
221
+ return
222
+ if running:
219
223
  self.stop()
220
224
 
221
225
  @QtCore.Slot()
@@ -144,9 +144,13 @@ class QVideoSource(QtCore.QThread):
144
144
  logger.debug('streaming finished')
145
145
 
146
146
  def __del__(self) -> None:
147
- # Python state only: the flag is absent if construction failed and
148
- # False once stopped, when Qt may already have deleted the object.
149
- if vars(self).get('_running'):
147
+ # The garbage collector may get here after Qt has deleted the C++
148
+ # object (or before it was built): then there is no thread to stop.
149
+ try:
150
+ running = self.isRunning()
151
+ except RuntimeError:
152
+ return
153
+ if running:
150
154
  self.stop()
151
155
  self.wait()
152
156
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "QVideo"
7
- version = "4.1.0"
7
+ version = "4.2.0"
8
8
  description = "PyQt-based framework for integrating video cameras into research applications"
9
9
  readme = "README.md"
10
10
  license = { text = "GPL-3.0-or-later" }
@@ -34,6 +34,7 @@ dependencies = [
34
34
  "opencv-python",
35
35
  "qtpy",
36
36
  "pyqtgraph",
37
+ "psutil",
37
38
  ]
38
39
 
39
40
  [project.urls]
@@ -253,25 +253,13 @@ class TestTotalRAM(unittest.TestCase):
253
253
  result = QCircularBuffer._totalRAM()
254
254
  self.assertIsInstance(result, int)
255
255
 
256
- def test_uses_psutil_when_available(self):
256
+ def test_reads_total_from_psutil(self):
257
257
  mock_psutil = MagicMock()
258
258
  mock_psutil.virtual_memory.return_value.total = 16 * 1024 ** 3
259
- with patch.dict('sys.modules', {'psutil': mock_psutil}):
259
+ with patch.object(_module, 'psutil', mock_psutil):
260
260
  result = QCircularBuffer._totalRAM()
261
261
  self.assertEqual(result, 16 * 1024 ** 3)
262
262
 
263
- def test_falls_back_to_sysconf(self):
264
- with patch.dict('sys.modules', {'psutil': None}):
265
- with patch.object(_module.os, 'sysconf', side_effect=[4096, 1024]):
266
- result = QCircularBuffer._totalRAM()
267
- self.assertEqual(result, 4096 * 1024)
268
-
269
- def test_returns_zero_on_failure(self):
270
- with patch.dict('sys.modules', {'psutil': None}):
271
- with patch.object(_module.os, 'sysconf', side_effect=ValueError):
272
- result = QCircularBuffer._totalRAM()
273
- self.assertEqual(result, 0)
274
-
275
263
 
276
264
  class TestMemoryWarning(unittest.TestCase):
277
265
 
@@ -317,17 +305,6 @@ class TestMemoryWarning(unittest.TestCase):
317
305
  buf.duration = 2 # triggers _resize, resets _warned
318
306
  self.assertFalse(buf._warned)
319
307
 
320
- def test_no_warning_when_total_ram_unknown(self):
321
- buf = QCircularBuffer(fps=10., duration=1)
322
- with patch.object(buf, '_totalRAM', return_value=0):
323
- try:
324
- with self.assertLogs('QVideo.dvr.QCircularBuffer', level='WARNING'):
325
- buf.append(self._big_frame())
326
- warned = True
327
- except AssertionError:
328
- warned = False
329
- self.assertFalse(warned)
330
-
331
308
 
332
309
  if __name__ == '__main__':
333
310
  unittest.main()
@@ -1,5 +1,6 @@
1
1
  '''Unit tests for QDVRWidget.'''
2
2
  import unittest
3
+ from types import SimpleNamespace
3
4
  import numpy as np
4
5
  from unittest.mock import patch, MagicMock
5
6
  from QVideo.lib.videotypes import FrameInfo
@@ -259,6 +260,7 @@ class TestQDVRWidgetRecord(unittest.TestCase):
259
260
  widget = make_widget()
260
261
  self.assertTrue(widget.stopWhenBehind)
261
262
  self.assertEqual(widget.lagLimit, 1.)
263
+ self.assertIsNone(widget.maxMemory)
262
264
 
263
265
  def test_a_writer_keeping_up_is_left_alone(self):
264
266
  widget, _ = self.watching()
@@ -319,6 +321,38 @@ class TestQDVRWidgetRecord(unittest.TestCase):
319
321
  self.capture(widget, 12.)
320
322
  self.assertTrue(widget.isRecording())
321
323
 
324
+ def test_a_small_memory_budget_stops_the_recording(self):
325
+ # 0.5 s of a 30 Hz source of 16-byte frames
326
+ widget, _ = self.watching(_budget=0.5 * 30 * _FRAME.nbytes)
327
+ with self.assertLogs('QVideo.dvr.QDVRWidget', 'ERROR'):
328
+ self.capture(widget, 10.6)
329
+ self.assertFalse(widget.isRecording())
330
+
331
+ def test_a_large_memory_budget_leaves_the_time_limit_in_charge(self):
332
+ widget, _ = self.watching(_budget=1e12)
333
+ self.capture(widget, 10.9)
334
+ self.assertTrue(widget.isRecording())
335
+ with self.assertLogs('QVideo.dvr.QDVRWidget', 'ERROR'):
336
+ self.capture(widget, 12.)
337
+ self.assertFalse(widget.isRecording())
338
+
339
+ def test_the_budget_defaults_to_most_of_the_available_memory(self):
340
+ widget, source = make_widget_with_source()
341
+ free = SimpleNamespace(available=1000)
342
+ with patch.dict(QDVRWidget.Writer, {'.avi': MockWriter}), \
343
+ patch.object(QtCore, 'QThread', return_value=MockThread()), \
344
+ patch('psutil.virtual_memory', return_value=free):
345
+ widget.record()
346
+ self.assertEqual(widget._budget, 800)
347
+
348
+ def test_max_memory_overrides_the_default_budget(self):
349
+ widget, source = make_widget_with_source()
350
+ widget.maxMemory = 123
351
+ with patch.dict(QDVRWidget.Writer, {'.avi': MockWriter}), \
352
+ patch.object(QtCore, 'QThread', return_value=MockThread()):
353
+ widget.record()
354
+ self.assertEqual(widget._budget, 123)
355
+
322
356
  def test_a_writer_that_has_seen_nothing_is_not_late(self):
323
357
  widget, writer = self.watching()
324
358
  writer.received = None
@@ -5,6 +5,7 @@ import sys
5
5
  import threading
6
6
  import time
7
7
  import unittest
8
+ from unittest.mock import patch
8
9
  import numpy as np
9
10
  from qtpy import QtCore, QtTest, QtWidgets
10
11
  from QVideo.lib.QFilterStack import QFilterStack
@@ -406,6 +407,13 @@ print('survived')
406
407
 
407
408
  class TestLifecycle(StackTestCase):
408
409
 
410
+ def test_finalizer_ignores_a_deleted_thread(self):
411
+ stack = self.make()
412
+ with patch.object(QFilterStack, 'isRunning',
413
+ side_effect=RuntimeError):
414
+ stack.__del__()
415
+ self.assertTrue(stack.isRunning())
416
+
409
417
  def test_thread_is_running_after_creation(self):
410
418
  self.make()
411
419
  self.assertTrue(self.stack.isRunning())
@@ -367,6 +367,18 @@ print('survived')
367
367
  self.assertIn('survived', result.stdout)
368
368
  self.assertNotIn('Destroyed while thread', result.stderr)
369
369
 
370
+ def test_finalizer_leaves_an_unstarted_source_alone(self):
371
+ vs = make_vs()
372
+ with patch.object(vs, 'stop') as stop:
373
+ vs.__del__()
374
+ stop.assert_not_called()
375
+
376
+ def test_finalizer_ignores_a_deleted_thread(self):
377
+ vs = make_vs()
378
+ with patch.object(QVideoSource, 'isRunning',
379
+ side_effect=RuntimeError):
380
+ vs.__del__()
381
+
370
382
 
371
383
  if __name__ == '__main__':
372
384
  unittest.main()
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
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
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
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
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
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
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
File without changes