File: _run_winpack_demo_python27.cmd

package info (click to toggle)
opencv 3.2.0%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 238,480 kB
  • sloc: xml: 901,650; cpp: 703,419; lisp: 20,142; java: 17,843; python: 17,641; ansic: 603; cs: 601; sh: 516; perl: 494; makefile: 117
file content (47 lines) | stat: -rw-r--r-- 1,062 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@echo off
if NOT exist %CD%\..\..\..\build (
  echo ERROR: OpenCV Winpack installation is required
  pause
  exit
)

:: Path to FFMPEG binary files
set PATH=%PATH%;%CD%\..\..\..\build\bin\

:: Detect Python binary
python -V
if %ERRORLEVEL% EQU 0 (
  set PYTHON=python
) else (
  if exist C:\Python27-x64\python.exe (
    set PYTHON=C:\Python27-x64\python.exe
  ) else (
    if exist C:\Python27\python.exe (
      set PYTHON=C:\Python27\python.exe
    ) else (
      echo ERROR: Python not found
      pause
      exit
    )
  )
)
echo Using python: %PYTHON%

:: Detect python architecture
%PYTHON% -c "import platform; exit(64 if platform.architecture()[0] == '64bit' else 32)"
if %ERRORLEVEL% EQU 32 (
  echo Detected: Python 32-bit
  set PYTHONPATH=%CD%\..\..\..\build\python\2.7\x86
) else (
  if %ERRORLEVEL% EQU 64 (
    echo Detected: Python 64-bit
    set PYTHONPATH=%CD%\..\..\..\build\python\2.7\x64
  ) else (
    echo ERROR: Unknown python arch
    pause
    exit
  )
)

:: Launch demo
%PYTHON% demo.py