Example #1
0
def get_library_linked():
    '''Print out info about scipy'''

    # capture into a variable show_config output
    capture = io.StringIO()
    with contextlib.redirect_stdout(capture):
        sp.show_config()
    output = capture.getvalue()

    # look for library in use
    lines = output.split('\n')
    print('scipy is using: ')
    for line in lines:
        if 'libraries' in line:
            print('{}'.format(line))
    print('you get the gist ;-)\n')
Example #2
0
    def cache_info(cls):
        try:
            # scipy is not mandatory requirement
            import scipy
        except ImportError:
            cls._CACHE = 'SciPy is not installed'
            return

        f = io.StringIO()
        with contextlib.redirect_stdout(f):
            try:
                scipy.show_config()
            except Exception as e:
                msg = ('Unable to collect scipy related information, '
                       'scipy.show_config raises {}({})')
                logger.error(msg.format(e.__class__.__name__, e))

        cls._CACHE = f.getvalue()
Example #3
0
def main():
    print('numpy config (python 3.7 image):')
    print(numpy.__version__)
    print(numpy.show_config())
    print('')

    print('scipy config:')
    print(scipy.__version__)
    print(scipy.show_config())
    print('')

    return 0
Example #4
0
def main():
    print('numpy config (miniconda:4.6.14 image):')
    print(numpy.__version__)
    print(numpy.show_config())
    print('')

    print('scipy config:')
    print(scipy.__version__)
    print(scipy.show_config())
    print('')

    return 0
Example #5
0
#!/usr/bin/env python
__author__ = u"james.morris"
import scipy

if __name__ == u"__main__":

    scipy.show_config()
Example #6
0
        config.PREPROCESS_REFERENCE_VIDEO_ONLY = True;
    elif sys.argv[3] == "--process-query-and-align-videos":
        config.PREPROCESS_REFERENCE_VIDEO_ONLY = False;
    else:
        config.PREPROCESS_REFERENCE_VIDEO_ONLY = "do_all";

    print("config.PREPROCESS_REFERENCE_VIDEO_ONLY = %s" % str(config.PREPROCESS_REFERENCE_VIDEO_ONLY));

    AskFirst();

    # Inspired from https://stackoverflow.com/questions/1520234/how-to-check-which-version-of-numpy-im-using
    print("numpy.version.version = %s" % str(np.version.version));
    print("scipy.version.version = %s" % str(scipy.version.version));
    #scipy.version.version
    np.show_config();
    scipy.show_config();


    # See http://docs.scipy.org/doc/numpy/reference/generated/numpy.set_printoptions.html
    # We use 7 digits precision and suppress using scientific notation.
    np.set_printoptions(precision=7, suppress=True, \
                        threshold=70000, linewidth=4000);
                        #threshold=7000000, linewidth=4000);
                        #threshold=7000, linewidth=300);
                        #threshold=1000000, linewidth=3000);


    # Inspired from \OpenCV2-Python-Tutorials-master\source\py_tutorials\py_core\py_optimization

    # normally returns True - relates to using the SIMD extensions of x86: SSX, AVX
    common.DebugPrint("cv2.useOptimized() is %s" % str(cv2.useOptimized()));
Example #7
0
def show_scipy_config():
    import scipy
    return scipy.show_config()
Example #8
0
def main(argv):
    assert len(sys.argv) >= 3
    if FLAGS.preprocess_ref:
        config.PREPROCESS_REFERENCE_VIDEO_ONLY = True
    elif FLAGS.process_query_and_align_videos:
        config.PREPROCESS_REFERENCE_VIDEO_ONLY = False
    else:
        config.PREPROCESS_REFERENCE_VIDEO_ONLY = False

    print("config.PREPROCESS_REFERENCE_VIDEO_ONLY = %s" % str(
        config.PREPROCESS_REFERENCE_VIDEO_ONLY))

    ask_first()

    # Inspired from https://stackoverflow.com/questions/1520234/how-to-check-which-version-of-numpy-im-using
    print("numpy.version.version = %s" % str(np.version.version))
    print("scipy.version.version = %s" % str(scipy.version.version))
    np.show_config()
    scipy.show_config()

    # See http://docs.scipy.org/doc/numpy/reference/generated/numpy.set_printoptions.html
    # We use 7 digits precision and suppress using scientific notation.
    np.set_printoptions(precision=7, suppress=True,
                        threshold=70000, linewidth=4000)

    # Inspired from \OpenCV2-Python-Tutorials-master\source\py_tutorials\py_core\py_optimization
    # normally returns True - relates to using the SIMD extensions of x86:
    # SSX, AVX
    common.DebugPrint("cv2.useOptimized() is %s" % str(cv2.useOptimized()))

    """
    From http://docs.opencv.org/modules/core/doc/utility_and_system_functions_and_macros.html#checkhardwaresupport
        CV_CPU_MMX - MMX
        CV_CPU_SSE - SSE
        CV_CPU_SSE2 - SSE 2
        CV_CPU_SSE3 - SSE 3
        CV_CPU_SSSE3 - SSSE 3
        CV_CPU_SSE4_1 - SSE 4.1
        CV_CPU_SSE4_2 - SSE 4.2
        CV_CPU_POPCNT - POPCOUNT
        CV_CPU_AVX - AVX
    """
    # TODO: Figure out the correct way to reference these in OpenCV 3.x
    """
    # Need to setUseOptimized before calling checkHardwareSupport
    cv2.setUseOptimized(True)
    if config.OCV_OLD_PY_BINDINGS == False:
        featDict = {cv2.CpuFeatures.CV_CPU_AVX: "AVX",
                cv2.CPU_MMX: "MMX",
                cv2.CPU_NEON: "NEON",
                cv2.CPU_POPCNT: "POPCNT",
                cv2.CPU_SSE: "SSE",
                cv2.CPU_SSE2: "SSE2",
                cv2.CPU_SSE3: "SSE3",
                cv2.CPU_SSE4_1: "SSE4.1",
                cv2.CPU_SSE4_2: "SSE4.2",
                cv2.CPU_SSSE3: "SSSE3"}

        for feat in featDict:
            res = cv2.checkHardwareSupport(feat)
            print("%s = %d" % (featDict[feat], res))
    """

    # "Returns the number of logical CPUs available for the process."
    common.DebugPrint("cv2.getNumberOfCPUs() (#logical CPUs) is %s" % str(
        cv2.getNumberOfCPUs()))
    common.DebugPrint(
        "cv2.getTickFrequency() is %s" % str(cv2.getTickFrequency()))

    video_file_q = sys.argv[1]  # input/current video
    video_file_r = sys.argv[2]  # reference video

    # TODO: use getopt() to run Evangelidis' or "Alex's" algorithm, etc

    ReadVideo.main(video_file_q, video_file_r)
Example #9
0
def run_scipy_tests(*args, **kwargs):
    import scipy

    scipy.show_config()
    scipy.test()
Example #10
0
        config.PREPROCESS_REFERENCE_VIDEO_ONLY = True;
    elif sys.argv[3] == "--process-query-and-align-videos":
        config.PREPROCESS_REFERENCE_VIDEO_ONLY = False;
    else:
        config.PREPROCESS_REFERENCE_VIDEO_ONLY = "do_all";

    print("config.PREPROCESS_REFERENCE_VIDEO_ONLY = %s" % str(config.PREPROCESS_REFERENCE_VIDEO_ONLY));

    AskFirst();

    # Inspired from https://stackoverflow.com/questions/1520234/how-to-check-which-version-of-numpy-im-using
    print("numpy.version.version = %s" % str(np.version.version));
    print("scipy.version.version = %s" % str(scipy.version.version));
    #scipy.version.version
    np.show_config();
    scipy.show_config();


    # See http://docs.scipy.org/doc/numpy/reference/generated/numpy.set_printoptions.html
    # We use 7 digits precision and suppress using scientific notation.
    np.set_printoptions(precision=7, suppress=True, \
                        threshold=70000, linewidth=4000);
                        #threshold=7000000, linewidth=4000);
                        #threshold=7000, linewidth=300);
                        #threshold=1000000, linewidth=3000);


    # Inspired from \OpenCV2-Python-Tutorials-master\source\py_tutorials\py_core\py_optimization

    # normally returns True - relates to using the SIMD extensions of x86: SSX, AVX
    common.DebugPrint("cv2.useOptimized() is %s" % str(cv2.useOptimized()));