本文整理汇总了Python中utilstest.getLogger函数的典型用法代码示例。如果您正苦于以下问题:Python getLogger函数的具体用法?Python getLogger怎么用?Python getLogger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getLogger函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1:
#!/usr/bin/python
import sys, os
import utilstest
logger = utilstest.getLogger()
#here = os.path.dirname(os.path.abspath(__file__))
#there = os.path.join(here, "..", "build")
#lib = [os.path.abspath(os.path.join(there, i)) for i in os.listdir(there) if "lib" in i][0]
#sys.path.insert(0, lib)
import sift_pyocl as sift
import numpy
import scipy.misc
#
try:
lena = scipy.misc.imread(sys.argv[1])
except:
try:
import fabio
lena = fabio.open(sys.argv[1]).data
except:
lena = scipy.misc.lena()
logger.info("Using image lena from scipy")
else:
logger.info("Using image %s read with FabIO"%sys.argv[1])
else:
logger.info("Using image %s read with SciPy"%sys.argv[1])
s = sift.SiftPlan(template=lena, profile=True, context=utilstest.ctx)
kp = s.keypoints(lena)
print kp[:10]
if utilstest.args and not os.path.isfile(utilstest.args[0]):
开发者ID:kif,项目名称:sift_pyocl,代码行数:31,代码来源:profile.py
示例2: getLogger
#!/usr/bin/python
from utilstest import UtilsTest, getLogger
logger = getLogger(__file__)
import sift
import numpy
import scipy.misc
from math import sin, cos
import pylab
from matplotlib.patches import ConnectionPatch
try:
import feature
except:
logger.error("Feature is not available to compare results with C++ implementation")
feature = None
res = numpy.empty(0)
img1 = scipy.misc.imread("../../test_match/wiw2.jpg")
img2 = scipy.misc.imread("../../test_match/waldo.jpg")
"""
img1 = scipy.misc.imread("../test_images/fruit_bowl.png")
tmp = scipy.misc.imread("../test_images/banana.png")
img2 = numpy.zeros_like(img1)
img2 = img2 + 255
d0 = (img1.shape[0] - tmp.shape[0])/2
d1 = (img1.shape[1] - tmp.shape[1])/2
img2[d0:-d0,d1:-d1-1] = numpy.copy(tmp)
"""
plan = sift.SiftPlan(template=img1, devicetype="gpu")
kp1 = plan.keypoints(img1)
开发者ID:boudini,项目名称:sift_pyocl,代码行数:31,代码来源:demo_match.py
示例3: cmp_kp
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
"""
import sys, os, pyopencl, time
from math import sin, cos
import utilstest
logger = utilstest.getLogger(__file__)
import sift
import numpy
import scipy.misc
import pylab
try:
import feature
except:
logger.error("Feature is not available to compare results with C++ implementation")
feature = None
res = numpy.empty(0)
def cmp_kp(a, b):
if a.scale < b.scale:
return True
elif a.scale > b.scale:
开发者ID:deschila,项目名称:sift_pyocl,代码行数:30,代码来源:demo.py
示例4:
"""
Created on Fri Mar 07 09:52:51 2014
@author: ashiotis
"""
import sys, numpy, time
import utilstest
import fabio, pyopencl
from pylab import *
print "#"*50
pyFAI = sys.modules["pyFAI"]
from pyFAI import splitBBox
from pyFAI import splitBBoxLUT
from pyFAI import splitBBoxCSR
logger = utilstest.getLogger("profile")
ai = pyFAI.load("testimages/Pilatus1M.poni")
data = fabio.open("testimages/Pilatus1M.edf").data
ref = ai.xrpd_LUT(data, 1000)[1]
obt = ai.xrpd_LUT_OCL(data, 1000)[1]
logger.debug("check LUT basics: %s"%abs(obt[1] - ref[1]).max())
assert numpy.allclose(ref,obt)
cyt_lut = pyFAI.splitBBoxLUT.HistoBBox1d(
ai._ttha,
ai._dttha,
bins=1000,
unit="2th_deg")
开发者ID:GiannisA,项目名称:pyFAI,代码行数:30,代码来源:profile_csr.py
示例5: getLogger
#
"""
Test suite for all pyFAI modules.
"""
__authors__ = ["Jérôme Kieffer"]
__contact__ = "[email protected]"
__license__ = "GPLv3+"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__data__ = "2014-03-08"
import sys
import unittest
from utilstest import UtilsTest, getLogger
logger = getLogger("test_all")
from test_geometry_refinement import test_suite_all_GeometryRefinement
from test_azimuthal_integrator import test_suite_all_AzimuthalIntegration
from test_histogram import test_suite_all_Histogram
from test_peak_picking import test_suite_all_PeakPicking
from test_geometry import test_suite_all_Geometry
from test_mask import test_suite_all_Mask
from test_openCL import test_suite_all_OpenCL
from test_export import test_suite_all_Export
from test_saxs import test_suite_all_Saxs
from test_integrate import test_suite_all_Integrate1d
from test_bilinear import test_suite_all_bilinear
from test_distortion import test_suite_all_distortion
from test_flat import test_suite_all_Flat
from test_utils import test_suite_all_Utils
开发者ID:deschila,项目名称:pyFAI,代码行数:31,代码来源:test_all.py
示例6: getLogger
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
"""
import time, os, logging
import numpy
import pyopencl, pyopencl.array
import scipy, scipy.misc, scipy.ndimage, pylab
import sys
import unittest
from utilstest import UtilsTest, getLogger, ctx
from test_image_functions import * #for Python implementation of tested functions
from test_image_setup import *
import sift_pyocl as sift
sift_pyocllogger = getLogger(__file__)
if logger.getEffectiveLevel() <= logging.INFO:
PROFILE = True
queue = pyopencl.CommandQueue(ctx, properties=pyopencl.command_queue_properties.PROFILING_ENABLE)
import pylab
else:
PROFILE = False
queue = pyopencl.CommandQueue(ctx)
SHOW_FIGURES = False
PRINT_KEYPOINTS = False
USE_CPU = False
USE_CPP_SIFT = False #use reference cplusplus implementation for descriptors comparison... not valid for (octsize,scale)!=(1,1)
开发者ID:kif,项目名称:sift_pyocl,代码行数:28,代码来源:test_keypoints_old.py
注:本文中的utilstest.getLogger函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论