python: 'cv2.' -> 'cv.' via 'import cv2 as cv'
This commit is contained in:
@@ -8,11 +8,11 @@ Utility for measuring python opencv API coverage by samples.
|
||||
from __future__ import print_function
|
||||
|
||||
from glob import glob
|
||||
import cv2
|
||||
import cv2 as cv
|
||||
import re
|
||||
|
||||
if __name__ == '__main__':
|
||||
cv2_callable = set(['cv2.'+name for name in dir(cv2) if callable( getattr(cv2, name) )])
|
||||
cv2_callable = set(['cv.'+name for name in dir(cv) if callable( getattr(cv, name) )])
|
||||
|
||||
found = set()
|
||||
for fn in glob('*.py'):
|
||||
@@ -26,4 +26,4 @@ if __name__ == '__main__':
|
||||
f.write('\n'.join(sorted(cv2_unused)))
|
||||
|
||||
r = 1.0 * len(cv2_used) / len(cv2_callable)
|
||||
print('\ncv2 api coverage: %d / %d (%.1f%%)' % ( len(cv2_used), len(cv2_callable), r*100 ))
|
||||
print('\ncv api coverage: %d / %d (%.1f%%)' % ( len(cv2_used), len(cv2_callable), r*100 ))
|
||||
|
||||
Reference in New Issue
Block a user