패키지를 삭제했는데 바로 재설치가 되서

캐시되었다는 말을 검색해보니 cache purge를 통해 완전히 날리고 설치할수 있다고 한다.

 

해보니 확실히 처음부터 하긴 한다.

$ time CMAKE_BUILD_PARALLEL_LEVEL=3 pip3 uninstall --break-system-packages -v dlibFound existing installation: dlib 20.0.0
Uninstalling dlib-20.0.0:
  Would remove:
    /home/minimonk/.local/lib/python3.12/site-packages/_dlib_pybind11.cpython-312-aarch64-linux-gnu.so
    /home/minimonk/.local/lib/python3.12/site-packages/dlib-20.0.0.dist-info/INSTALLER
    /home/minimonk/.local/lib/python3.12/site-packages/dlib-20.0.0.dist-info/METADATA
    /home/minimonk/.local/lib/python3.12/site-packages/dlib-20.0.0.dist-info/RECORD
    /home/minimonk/.local/lib/python3.12/site-packages/dlib-20.0.0.dist-info/WHEEL
    /home/minimonk/.local/lib/python3.12/site-packages/dlib-20.0.0.dist-info/licenses/LICENSE.txt
    /home/minimonk/.local/lib/python3.12/site-packages/dlib-20.0.0.dist-info/top_level.txt
    /home/minimonk/.local/lib/python3.12/site-packages/dlib/__init__.py
    /home/minimonk/.local/lib/python3.12/site-packages/dlib/__pycache__/__init__.cpython-312.pyc
  Will actually move:
    /home/minimonk/.local/lib/python3.12/site-packages/_dlib_pybind11.cpython-312-aarch64-linux-gnu.so
    /home/minimonk/.local/lib/python3.12/site-packages/dlib-20.0.0.dist-info/
    /home/minimonk/.local/lib/python3.12/site-packages/dlib/
Proceed (Y/n)? y
  Removing file or directory /home/minimonk/.local/lib/python3.12/site-packages/_dlib_pybind11.cpython-312-aarch64-linux-gnu.so
  Removing file or directory /home/minimonk/.local/lib/python3.12/site-packages/dlib-20.0.0.dist-info/
  Removing file or directory /home/minimonk/.local/lib/python3.12/site-packages/dlib/
  Successfully uninstalled dlib-20.0.0

real    0m4.584s
user    0m2.585s
sys     0m0.381s

$ time CMAKE_BUILD_PARALLEL_LEVEL=3 pip3 install --break-system-packages -v dlib
Using pip 24.0 from /usr/lib/python3/dist-packages/pip (python 3.12)
Defaulting to user installation because normal site-packages is not writeable
Collecting dlib
  Using cached dlib-20.0.0-cp312-cp312-linux_aarch64.whl
Installing collected packages: dlib
Successfully installed dlib-20.0.0

real    0m4.876s
user    0m4.363s
sys     0m0.347s


pip3 cache purge
Files removed: 54

 

[링크 : https://ufris.tistory.com/61]

'Programming > python(파이썬)' 카테고리의 다른 글

pip install cmake build multi core support  (0) 2025.08.13
python 빌드 정보  (0) 2025.08.04
python용 얼굴탐지, 인식  (0) 2025.08.04
python struct  (0) 2024.12.13
python matplotlib 동시 여러개 띄우기  (0) 2024.05.29
Posted by 구차니

pip로 설치되는 녀석중 빌드가 필요한 녀석이 있는데

dlib가 원인을 알수 없으나(?) odroid-c2 / armbian 에서 1코어만 빌드하지만

nxp imx8mp evk 에서는 3코어로 빌드해서 어떤 옵션을 주어야 되는지

웬만한건 다 검색하고 해봐도 안되서 cmake 환경변수로 찾아보니 먼가 나왔고 시도하니 된다!

 

$ pip3 install  --break-system-packages -v dlib
  Invoking CMake build: 'cmake --build . --config Release -- -j1'
  [  1%] Building CXX object dlib_build/CMakeFiles/dlib.dir/base64/base64_kernel_1.cpp.o

 

CMAKE_BUILD_PARALLEL_LEVEL=4 pip3 install  --break-system-packages -v dlib
  Invoking CMake build: 'cmake --build . --config Release -- -j4'
  [  3%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bit_stream/bit_stream_kernel_1.cpp.o
  [  3%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_2.cpp.o
  [  2%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o

[링크 : https://cmake.org/cmake/help/latest/envvar/CMAKE_BUILD_PARALLEL_LEVEL.html#cmake-build-parallel-level]

'Programming > python(파이썬)' 카테고리의 다른 글

pip 패키지 완전 삭제하기  (0) 2025.08.13
python 빌드 정보  (0) 2025.08.04
python용 얼굴탐지, 인식  (0) 2025.08.04
python struct  (0) 2024.12.13
python matplotlib 동시 여러개 띄우기  (0) 2024.05.29
Posted by 구차니
Programming/C++ STL2025. 8. 12. 17:30

c의 runtime 줄여서 crt0.o에 대응하는게 libstdc++.a 이려나?

 

/opt/st/stm32cubeide_1.16.0/plugins/cohttp://m.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/arm-none-eabi/lib/arm/v5te/hard$ ls -al
합계 21968
drwxrwxr-x 3 root root    4096  9월  6  2024 .
drwxrwxr-x 4 root root    4096  9월  6  2024 ..
-rw-rw-r-- 1 root root     573  6월 29  2024 aprofile-validation-v2m.specs
-rw-rw-r-- 1 root root     557  6월 29  2024 aprofile-validation.specs
-rw-rw-r-- 1 root root     555  6월 29  2024 aprofile-ve-v2m.specs
-rw-rw-r-- 1 root root     539  6월 29  2024 aprofile-ve.specs
drwxrwxr-x 2 root root    4096  9월  6  2024 cpu-init
-rw-rw-r-- 1 root root    1580  6월 29  2024 crt0.o
-rw-rw-r-- 1 root root     195  6월 29  2024 iq80310.specs
-rw-rw-r-- 1 root root 1086406  6월 29  2024 libc.a
-rw-rw-r-- 1 root root  976432  6월 29  2024 libc_nano.a
-rw-rw-r-- 1 root root 5084062  6월 29  2024 libg.a
-rw-rw-r-- 1 root root 4641052  6월 29  2024 libg_nano.a
-rw-rw-r-- 1 root root    8432  6월 29  2024 libgloss-linux.a
-rw-rw-r-- 1 root root  477808  6월 29  2024 libm.a
-rw-rw-r-- 1 root root   26770  6월 29  2024 libnosys.a
-rw-rw-r-- 1 root root   19298  6월 29  2024 librdimon-v2m.a
-rw-rw-r-- 1 root root   19298  6월 29  2024 librdimon-v2m_nano.a
-rw-rw-r-- 1 root root   19270  6월 29  2024 librdimon.a
-rw-rw-r-- 1 root root   19270  6월 29  2024 librdimon_nano.a
-rw-rw-r-- 1 root root   17354  6월 29  2024 librdpmon.a
-rw-rw-r-- 1 root root 5670032  6월 29  2024 libstdc++.a
-rw-rw-r-- 1 root root    2527  6월 29  2024 libstdc++.a-gdb.py
-rw-rw-r-- 1 root root 3727838  6월 29  2024 libstdc++_nano.a
-rw-rw-r-- 1 root root  303506  6월 29  2024 libsupc++.a
-rw-rw-r-- 1 root root  239794  6월 29  2024 libsupc++_nano.a
-rw-rw-r-- 1 root root     960  6월 29  2024 linux-crt0.o
-rw-rw-r-- 1 root root     121  6월 29  2024 linux.specs
-rw-rw-r-- 1 root root     740  6월 29  2024 nano.specs
-rw-rw-r-- 1 root root     626  6월 29  2024 nano_c_standard_cpp.specs
-rw-rw-r-- 1 root root     277  6월 29  2024 nosys.specs
-rw-rw-r-- 1 root root     192  6월 29  2024 pid.specs
-rw-rw-r-- 1 root root    2348  6월 29  2024 rdimon-crt0-v2m.o
-rw-rw-r-- 1 root root    2372  6월 29  2024 rdimon-crt0.o
-rw-rw-r-- 1 root root     730  6월 29  2024 rdimon-v2m.specs
-rw-rw-r-- 1 root root     628  6월 29  2024 rdimon.specs
-rw-rw-r-- 1 root root    1624  6월 29  2024 rdpmon-crt0.o
-rw-rw-r-- 1 root root     147  6월 29  2024 rdpmon.specs
-rw-rw-r-- 1 root root     976  6월 29  2024 redboot-crt0.o
-rw-rw-r-- 1 root root    5868  6월 29  2024 redboot-syscalls.o
-rw-rw-r-- 1 root root    6119  6월 29  2024 redboot.ld
-rw-rw-r-- 1 root root     192  6월 29  2024 redboot.specs
-rw-rw-r-- 1 root root     426  6월 29  2024 standard_c_nano_cpp.specs

'Programming > C++ STL' 카테고리의 다른 글

cpp 그래픽 라이브러리  (0) 2025.04.22
cpp 기본 인자 prototype  (0) 2025.03.28
cpp std::to_string(int)  (0) 2025.02.20
cpp string 끝에 한글자 지우기  (0) 2025.02.06
cpp stoi (atoi)  (0) 2025.02.06
Posted by 구차니
Programming/openCV2025. 8. 4. 16:17

getBuildInformation() 을 이용하면 빌드시 옵션을 볼 수 있다.

python 에서 안보이더니 openCV 에서 가속여부를 결정하는건가..

암튼 여기에는 -O3 가 보인다.

 

>>> import cv2
>>> print(cv2.getBuildInformation())

General configuration for OpenCV 4.9.0 =====================================
  Version control:               4.9.0-dirty

  Extra modules:
    Location (extra):            /io/opencv_contrib/modules
    Version control (extra):     4.9.0

  Platform:
    Timestamp:                   2023-12-31T11:19:02Z
    Host:                        Linux 5.15.0-1053-azure x86_64
    CMake:                       3.28.1
    CMake generator:             Unix Makefiles
    CMake build tool:            /bin/gmake
    Configuration:               Release

  CPU/HW features:
    Baseline:                    SSE SSE2 SSE3
      requested:                 SSE3
    Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
      requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
      SSE4_1 (16 files):         + SSSE3 SSE4_1
      SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
      FP16 (0 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
      AVX (8 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
      AVX2 (36 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
      AVX512_SKX (5 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX

  C/C++:
    Built as dynamic libs?:      NO
    C++ standard:                11
    C++ Compiler:                /opt/rh/devtoolset-10/root/usr/bin/c++  (ver 10.2.1)
    C++ flags (Release):         -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /opt/rh/devtoolset-10/root/usr/bin/cc
    C flags (Release):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a -L/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    Linker flags (Debug):        -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a -L/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    ccache:                      YES
    Precompiled headers:         NO
    Extra dependencies:          /lib64/libopenblas.so Qt5::Test Qt5::Concurrent /usr/local/lib/libpng.so /lib64/libz.so Qt5::Core Qt5::Gui Qt5::Widgets Iconv::Iconv dl m pthread rt
    3rdparty dependencies:       libprotobuf ade ittnotify libjpeg-turbo libwebp libtiff libopenjp2 IlmImf ippiw ippicv

  OpenCV modules:
    To be built:                 aruco bgsegm bioinspired calib3d ccalib core cvv datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 alphamat cannops cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev freetype hdf java julia matlab ovis python2 sfm ts viz
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         NO

  GUI:                           QT5
    QT:                          YES (ver 5.15.0 )
      QT OpenGL support:         NO
    GTK+:                        NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                        /lib64/libz.so (ver 1.2.7)
    JPEG:                        libjpeg-turbo (ver 2.1.3-62)
    WEBP:                        build (ver encoder: 0x020f)
    PNG:                         /usr/local/lib/libpng.so (ver 1.6.40)
    TIFF:                        build (ver 42 - 4.2.0)
    JPEG 2000:                   build (ver 2.5.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES
      avcodec:                   YES (59.37.100)
      avformat:                  YES (59.27.100)
      avutil:                    YES (57.28.100)
      swscale:                   YES (6.7.100)
      avresample:                NO
    GStreamer:                   NO
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Intel IPP:                   2021.10.0 [2021.10.0]
           at:                   /io/_skbuild/linux-x86_64-3.7/cmake-build/3rdparty/ippicv/ippicv_lnx/icv
    Intel IPP IW:                sources (2021.10.0)
              at:                /io/_skbuild/linux-x86_64-3.7/cmake-build/3rdparty/ippicv/ippicv_lnx/iw
    VA:                          NO
    Lapack:                      YES (/lib64/libopenblas.so)
    Eigen:                       NO
    Custom HAL:                  NO
    Protobuf:                    build (3.19.1)
    Flatbuffers:                 builtin/3rdparty (23.5.9)

  OpenCL:                        YES (no extra features)
    Include path:                /io/opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /opt/python/cp37-cp37m/bin/python3.7 (ver 3.7.17)
    Libraries:                   libpython3.7m.a (ver 3.7.17)
    numpy:                       /home/ci/.local/lib/python3.7/site-packages/numpy/core/include (ver 1.17.0)
    install path:                python/cv2/python-3

  Python (for build):            /opt/python/cp37-cp37m/bin/python3.7

  Java:                          
    ant:                         NO
    Java:                        NO
    JNI:                         NO
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /io/_skbuild/linux-x86_64-3.7/cmake-install
-----------------------------------------------------------------


[링크 : https://answers.opencv.org/question/224485/simd-optimizations-get-no-performance-gains-on-arm-neon/]

 

+

2025.08.11

armbian / Python 3.12.3 / openCV 4.12.0

오.. neon 가속이 있다!

>>> print(cv2.getBuildInformation())

General configuration for OpenCV 4.12.0 =====================================
  Version control:               4.12.0-dirty

  Platform:
    Timestamp:                   2025-07-04T16:42:37Z
    Host:                        Linux 6.8.0-51-generic aarch64
    CMake:                       4.0.3
    CMake generator:             Unix Makefiles
    CMake build tool:            /bin/gmake
    Configuration:               Release
    Algorithm Hint:              ALGO_HINT_ACCURATE

  CPU/HW features:
    Baseline:                    NEON FP16
      requested:                 DETECT
    Dispatched code generation:  NEON_DOTPROD NEON_FP16 NEON_BF16
      requested:                 NEON_FP16 NEON_BF16 NEON_DOTPROD
      NEON_DOTPROD (2 files):    + NEON_DOTPROD
      NEON_FP16 (2 files):       + NEON_FP16
      NEON_BF16 (0 files):       + NEON_BF16

  C/C++:
    Built as dynamic libs?:      NO
    C++ standard:                11
    C++ Compiler:                /opt/rh/devtoolset-10/root/usr/bin/c++  (ver 10.2.1)
    C++ flags (Release):         -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /opt/rh/devtoolset-10/root/usr/bin/cc
    C flags (Release):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -L/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined
    Linker flags (Debug):        -L/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined
    ccache:                      YES
    Precompiled headers:         NO
    Extra dependencies:          /usr/lib64/libopenblas.so Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test Qt5::Concurrent avif /usr/local/lib/libpng.so /usr/lib64/libz.so dl m pthread rt
    3rdparty dependencies:       libprotobuf ade ittnotify libjpeg-turbo libwebp libtiff libopenjp2 IlmImf tegra_hal

  OpenCV modules:
    To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video videoio
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 java python2 ts
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         NO

  GUI:                           QT5
    QT:                          YES (ver 5.15.16 )
      QT OpenGL support:         NO
    GTK+:                        NO
    VTK support:                 NO

  Media I/O:
    ZLib:                        /usr/lib64/libz.so (ver 1.2.7)
    JPEG:                        build-libjpeg-turbo (ver 3.1.0-70)
      SIMD Support Request:      YES
      SIMD Support:              YES
    WEBP:                        build (ver decoder: 0x0209, encoder: 0x020f, demux: 0x0107)
    AVIF:                        avif (ver 1.3.0)
    PNG:                         /usr/local/lib/libpng.so (ver 1.6.48)
    TIFF:                        build (ver 42 - 4.6.0)
    JPEG 2000:                   build (ver 2.5.3)
    OpenEXR:                     build (ver 2.3.0)
    GIF:                         YES
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    FFMPEG:                      YES
      avcodec:                   YES (59.37.100)
      avformat:                  YES (59.27.100)
      avutil:                    YES (57.28.100)
      swscale:                   YES (6.7.100)
      avresample:                NO
    GStreamer:                   NO
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT(3.25.4))

  Other third-party libraries:
    Lapack:                      YES (/usr/lib64/libopenblas.so)
    Eigen:                       NO
    Custom HAL:                  YES (carotene (ver 0.0.1))
    Protobuf:                    build (3.19.1)
    Flatbuffers:                 builtin/3rdparty (23.5.9)

  OpenCL:                        YES (no extra features)
    Include path:                /io/opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /opt/python/cp39-cp39/bin/python3.9 (ver 3.9.23)
    Libraries:                   libpython3.9m.a (ver 3.9.23)
    Limited API:                 YES (ver 0x03060000)
    numpy:                       /home/ci/.local/lib/python3.9/site-packages/numpy/_core/include (ver 2.0.2)
    install path:                python/cv2/python-3

  Python (for build):            /opt/python/cp39-cp39/bin/python3.9

  Java:
    ant:                         NO
    Java:                        NO
    JNI:                         NO
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /io/_skbuild/linux-aarch64-3.9/cmake-install
-----------------------------------------------------------------
Posted by 구차니

문득 python을 빌드할때 어떤 옵션을 주고 했을까 궁금해서 찾아보는 중

import sysconfig
print(sysconfig.get_config_vars())

[링크 : https://stackoverflow.com/questions/10192758/how-to-get-the-list-of-options-that-python-was-compiled-with]

 

online python object beautifier로 이쁘게~

ubuntu 22.04 LTS desktop 64bit / Python 3.10.12

{
    "prefix": "/usr",
    "exec_prefix": "/usr",
    "py_version": "3.10.12",
    "py_version_short": "3.10",
    "py_version_nodot": "310",
    "installed_base": "/usr",
    "base": "/usr",
    "installed_platbase": "/usr",
    "platbase": "/usr",
    "projectbase": "/usr/bin",
    "platlibdir": "lib",
    "abiflags": "",
    "py_version_nodot_plat": "",
    "ABIFLAGS": "",
    "AC_APPLE_UNIVERSAL_BUILD": 0,
    "AIX_BUILDDATE": 0,
    "AIX_GENUINE_CPLUSPLUS": 0,
    "ALIGNOF_LONG": 8,
    "ALIGNOF_SIZE_T": 8,
    "ALT_SOABI": 0,
    "ANDROID_API_LEVEL": 0,
    "AR": "x86_64-linux-gnu-gcc-ar",
    "ARFLAGS": "rcs",
    "BASECFLAGS": "-Wno-unused-result -Wsign-compare",
    "BASECPPFLAGS": "-IObjects -IInclude -IPython",
    "BASEMODLIBS": "",
    "BINDIR": "/usr/bin",
    "BINLIBDEST": "/usr/lib/x86_64-linux-gnu/python3.10",
    "BLDLIBRARY": "-lpython3.10",
    "BLDSHARED": "x86_64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions      -g -fwrapv -O2   ",
    "BUILDEXE": "",
    "BUILDPYTHON": "python",
    "BUILD_GNU_TYPE": "x86_64-pc-linux-gnu",
    "BYTESTR_DEPS": "\\",
    "CC": "x86_64-linux-gnu-gcc",
    "CCSHARED": "-fPIC",
    "CFLAGS": "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g       -fstack-protector-strong -Wformat -Werror=format-security  -g -fwrapv -O2   ",
    "CFLAGSFORSHARED": "-fPIC",
    "CFLAGS_ALIASING": "",
    "CFLAGS_NODIST": "",
    "CONFIGFILES": "configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in",
    "CONFIGURE_CFLAGS": "-g       -fstack-protector-strong -Wformat -Werror=format-security",
    "CONFIGURE_CFLAGS_NODIST": "-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden",
    "CONFIGURE_CPPFLAGS": "-Wdate-time -D_FORTIFY_SOURCE=2",
    "CONFIGURE_LDFLAGS": "-Wl,-Bsymbolic-functions      -g -fwrapv -O2   ",
    "CONFIGURE_LDFLAGS_NODIST": "",
    "CONFIG_ARGS": "'--enable-shared' '--prefix=/usr' '--libdir=/usr/lib/x86_64-linux-gnu' '--enable-ipv6' '--enable-loadable-sqlite-extensions' '--with-dbmliborder=bdb:gdbm' '--with-computed-gotos' '--without-ensurepip' '--with-system-expat' '--with-dtrace' '--with-system-libmpdec' '--with-wheel-pkg-dir=/usr/share/python-wheels/' 'MKDIR_P=/bin/mkdir -p' '--with-system-ffi' 'CC=x86_64-linux-gnu-gcc' 'CFLAGS=-g       -fstack-protector-strong -Wformat -Werror=format-security ' 'LDFLAGS=-Wl,-Bsymbolic-functions      -g -fwrapv -O2   ' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'",
    "CONFINCLUDEDIR": "/usr/include",
    "CONFINCLUDEPY": "/usr/include/python3.10",
    "COREPYTHONPATH": "",
    "COVERAGE_INFO": "/build/python3.10-rtDYKr/python3.10-3.10.12/build-shared/coverage.info",
    "COVERAGE_REPORT": "/build/python3.10-rtDYKr/python3.10-3.10.12/build-shared/lcov-report",
    "COVERAGE_REPORT_OPTIONS": '--no-branch-coverage --title "CPython lcov report"',
    "CPPFLAGS": "-IObjects -IInclude -IPython -I. -I../Include -Wdate-time -D_FORTIFY_SOURCE=2",
    "CXX": "x86_64-linux-gnu-g++",
    "DESTDIRS": "/usr /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/python3.10 /usr/lib/python3.10/lib-dynload",
    "DESTLIB": "/usr/lib/python3.10",
    "DESTPATH": "",
    "DESTSHARED": "/usr/lib/python3.10/lib-dynload",
    "DFLAGS": "",
    "DIRMODE": 755,
    "DIST": "README.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummy",
    "DISTDIRS": "Include Lib Misc Ext-dummy",
    "DISTFILES": "README.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in",
    "DLINCLDIR": ".",
    "DLLLIBRARY": "",
    "DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754": 0,
    "DOUBLE_IS_BIG_ENDIAN_IEEE754": 0,
    "DOUBLE_IS_LITTLE_ENDIAN_IEEE754": 1,
    "DTRACE": "/usr/bin/dtrace",
    "DTRACE_DEPS": "\\",
    "DTRACE_HEADERS": "Include/pydtrace_probes.h",
    "DTRACE_OBJS": "Python/pydtrace.o",
    "DYNLOADFILE": "dynload_shlib.o",
    "ENABLE_IPV6": 1,
    "ENSUREPIP": "no",
    "EXE": "",
    "EXEMODE": 755,
    "EXPERIMENTAL_ISOLATED_SUBINTERPRETERS": 0,
    "EXPORTSFROM": "",
    "EXPORTSYMS": "",
    "EXTRATESTOPTS": "",
    "EXT_SUFFIX": ".cpython-310-x86_64-linux-gnu.so",
    "FILEMODE": 644,
    "FLOAT_WORDS_BIGENDIAN": 0,
    "FLOCK_NEEDS_LIBBSD": 0,
    "GETPGRP_HAVE_ARG": 0,
    "GITBRANCH": "",
    "GITTAG": "",
    "GITVERSION": "",
    "GNULD": "yes",
    "HAVE_ACCEPT4": 1,
    "HAVE_ACOSH": 1,
    "HAVE_ADDRINFO": 1,
    "HAVE_ALARM": 1,
    "HAVE_ALIGNED_REQUIRED": 0,
    "HAVE_ALLOCA_H": 1,
    "HAVE_ALTZONE": 0,
    "HAVE_ASINH": 1,
    "HAVE_ASM_TYPES_H": 1,
    "HAVE_ATANH": 1,
    "HAVE_BIND_TEXTDOMAIN_CODESET": 1,
    "HAVE_BLUETOOTH_BLUETOOTH_H": 1,
    "HAVE_BLUETOOTH_H": 0,
    "HAVE_BROKEN_MBSTOWCS": 0,
    "HAVE_BROKEN_NICE": 0,
    "HAVE_BROKEN_PIPE_BUF": 0,
    "HAVE_BROKEN_POLL": 0,
    "HAVE_BROKEN_POSIX_SEMAPHORES": 0,
    "HAVE_BROKEN_PTHREAD_SIGMASK": 0,
    "HAVE_BROKEN_SEM_GETVALUE": 0,
    "HAVE_BROKEN_UNSETENV": 0,
    "HAVE_BUILTIN_ATOMIC": 1,
    "HAVE_CHFLAGS": 0,
    "HAVE_CHOWN": 1,
    "HAVE_CHROOT": 1,
    "HAVE_CLOCK": 1,
    "HAVE_CLOCK_GETRES": 1,
    "HAVE_CLOCK_GETTIME": 1,
    "HAVE_CLOCK_SETTIME": 1,
    "HAVE_CLOSE_RANGE": 1,
    "HAVE_COMPUTED_GOTOS": 1,
    "HAVE_CONFSTR": 1,
    "HAVE_CONIO_H": 0,
    "HAVE_COPYSIGN": 1,
    "HAVE_COPY_FILE_RANGE": 1,
    "HAVE_CRYPT_H": 1,
    "HAVE_CRYPT_R": 1,
    "HAVE_CTERMID": 1,
    "HAVE_CTERMID_R": 0,
    "HAVE_CURSES_FILTER": 1,
    "HAVE_CURSES_H": 1,
    "HAVE_CURSES_HAS_KEY": 1,
    "HAVE_CURSES_IMMEDOK": 1,
    "HAVE_CURSES_IS_PAD": 1,
    "HAVE_CURSES_IS_TERM_RESIZED": 1,
    "HAVE_CURSES_RESIZETERM": 1,
    "HAVE_CURSES_RESIZE_TERM": 1,
    "HAVE_CURSES_SYNCOK": 1,
    "HAVE_CURSES_TYPEAHEAD": 1,
    "HAVE_CURSES_USE_ENV": 1,
    "HAVE_CURSES_WCHGAT": 1,
    "HAVE_DECL_ISFINITE": 1,
    "HAVE_DECL_ISINF": 1,
    "HAVE_DECL_ISNAN": 1,
    "HAVE_DECL_RTLD_DEEPBIND": 1,
    "HAVE_DECL_RTLD_GLOBAL": 1,
    "HAVE_DECL_RTLD_LAZY": 1,
    "HAVE_DECL_RTLD_LOCAL": 1,
    "HAVE_DECL_RTLD_MEMBER": 0,
    "HAVE_DECL_RTLD_NODELETE": 1,
    "HAVE_DECL_RTLD_NOLOAD": 1,
    "HAVE_DECL_RTLD_NOW": 1,
    "HAVE_DECL_TZNAME": 0,
    "HAVE_DEVICE_MACROS": 1,
    "HAVE_DEV_PTC": 0,
    "HAVE_DEV_PTMX": 1,
    "HAVE_DIRECT_H": 0,
    "HAVE_DIRENT_D_TYPE": 1,
    "HAVE_DIRENT_H": 1,
    "HAVE_DIRFD": 1,
    "HAVE_DLFCN_H": 1,
    "HAVE_DLOPEN": 1,
    "HAVE_DUP2": 1,
    "HAVE_DUP3": 1,
    "HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH": 0,
    "HAVE_DYNAMIC_LOADING": 1,
    "HAVE_ENDIAN_H": 1,
    "HAVE_EPOLL": 1,
    "HAVE_EPOLL_CREATE1": 1,
    "HAVE_ERF": 1,
    "HAVE_ERFC": 1,
    "HAVE_ERRNO_H": 1,
    "HAVE_EVENTFD": 1,
    "HAVE_EXECV": 1,
    "HAVE_EXPLICIT_BZERO": 1,
    "HAVE_EXPLICIT_MEMSET": 0,
    "HAVE_EXPM1": 1,
    "HAVE_FACCESSAT": 1,
    "HAVE_FCHDIR": 1,
    "HAVE_FCHMOD": 1,
    "HAVE_FCHMODAT": 1,
    "HAVE_FCHOWN": 1,
    "HAVE_FCHOWNAT": 1,
    "HAVE_FCNTL_H": 1,
    "HAVE_FDATASYNC": 1,
    "HAVE_FDOPENDIR": 1,
    "HAVE_FDWALK": 0,
    "HAVE_FEXECVE": 1,
    "HAVE_FINITE": 1,
    "HAVE_FLOCK": 1,
    "HAVE_FORK": 1,
    "HAVE_FORKPTY": 1,
    "HAVE_FPATHCONF": 1,
    "HAVE_FSEEK64": 0,
    "HAVE_FSEEKO": 1,
    "HAVE_FSTATAT": 1,
    "HAVE_FSTATVFS": 1,
    "HAVE_FSYNC": 1,
    "HAVE_FTELL64": 0,
    "HAVE_FTELLO": 1,
    "HAVE_FTIME": 1,
    "HAVE_FTRUNCATE": 1,
    "HAVE_FUTIMENS": 1,
    "HAVE_FUTIMES": 1,
    "HAVE_FUTIMESAT": 1,
    "HAVE_GAI_STRERROR": 1,
    "HAVE_GAMMA": 1,
    "HAVE_GCC_ASM_FOR_MC68881": 0,
    "HAVE_GCC_ASM_FOR_X64": 1,
    "HAVE_GCC_ASM_FOR_X87": 1,
    "HAVE_GCC_UINT128_T": 1,
    "HAVE_GETADDRINFO": 1,
    "HAVE_GETC_UNLOCKED": 1,
    "HAVE_GETENTROPY": 1,
    "HAVE_GETGRGID_R": 1,
    "HAVE_GETGRNAM_R": 1,
    "HAVE_GETGROUPLIST": 1,
    "HAVE_GETGROUPS": 1,
    "HAVE_GETHOSTBYNAME": 0,
    "HAVE_GETHOSTBYNAME_R": 1,
    "HAVE_GETHOSTBYNAME_R_3_ARG": 0,
    "HAVE_GETHOSTBYNAME_R_5_ARG": 0,
    "HAVE_GETHOSTBYNAME_R_6_ARG": 1,
    "HAVE_GETITIMER": 1,
    "HAVE_GETLOADAVG": 1,
    "HAVE_GETLOGIN": 1,
    "HAVE_GETNAMEINFO": 1,
    "HAVE_GETPAGESIZE": 1,
    "HAVE_GETPEERNAME": 1,
    "HAVE_GETPGID": 1,
    "HAVE_GETPGRP": 1,
    "HAVE_GETPID": 1,
    "HAVE_GETPRIORITY": 1,
    "HAVE_GETPWENT": 1,
    "HAVE_GETPWNAM_R": 1,
    "HAVE_GETPWUID_R": 1,
    "HAVE_GETRANDOM": 1,
    "HAVE_GETRANDOM_SYSCALL": 1,
    "HAVE_GETRESGID": 1,
    "HAVE_GETRESUID": 1,
    "HAVE_GETSID": 1,
    "HAVE_GETSPENT": 1,
    "HAVE_GETSPNAM": 1,
    "HAVE_GETWD": 1,
    "HAVE_GLIBC_MEMMOVE_BUG": 0,
    "HAVE_GRP_H": 1,
    "HAVE_HSTRERROR": 1,
    "HAVE_HTOLE64": 1,
    "HAVE_HYPOT": 1,
    "HAVE_IEEEFP_H": 0,
    "HAVE_IF_NAMEINDEX": 1,
    "HAVE_INET_ATON": 1,
    "HAVE_INET_PTON": 1,
    "HAVE_INITGROUPS": 1,
    "HAVE_INTTYPES_H": 1,
    "HAVE_IO_H": 0,
    "HAVE_IPA_PURE_CONST_BUG": 0,
    "HAVE_KILL": 1,
    "HAVE_KILLPG": 1,
    "HAVE_KQUEUE": 0,
    "HAVE_LANGINFO_H": 1,
    "HAVE_LARGEFILE_SUPPORT": 0,
    "HAVE_LCHFLAGS": 0,
    "HAVE_LCHMOD": 0,
    "HAVE_LCHOWN": 1,
    "HAVE_LGAMMA": 1,
    "HAVE_LIBDL": 1,
    "HAVE_LIBDLD": 0,
    "HAVE_LIBIEEE": 0,
    "HAVE_LIBINTL_H": 1,
    "HAVE_LIBREADLINE": 1,
    "HAVE_LIBRESOLV": 0,
    "HAVE_LIBSENDFILE": 0,
    "HAVE_LIBUTIL_H": 0,
    "HAVE_LIBUUID": 1,
    "HAVE_LINK": 1,
    "HAVE_LINKAT": 1,
    "HAVE_LINUX_AUXVEC_H": 1,
    "HAVE_LINUX_CAN_BCM_H": 1,
    "HAVE_LINUX_CAN_H": 1,
    "HAVE_LINUX_CAN_J1939_H": 1,
    "HAVE_LINUX_CAN_RAW_FD_FRAMES": 1,
    "HAVE_LINUX_CAN_RAW_H": 1,
    "HAVE_LINUX_CAN_RAW_JOIN_FILTERS": 1,
    "HAVE_LINUX_MEMFD_H": 1,
    "HAVE_LINUX_NETLINK_H": 1,
    "HAVE_LINUX_QRTR_H": 1,
    "HAVE_LINUX_RANDOM_H": 1,
    "HAVE_LINUX_TIPC_H": 1,
    "HAVE_LINUX_VM_SOCKETS_H": 1,
    "HAVE_LINUX_WAIT_H": 1,
    "HAVE_LOCKF": 1,
    "HAVE_LOG1P": 1,
    "HAVE_LOG2": 1,
    "HAVE_LONG_DOUBLE": 1,
    "HAVE_LSTAT": 1,
    "HAVE_LUTIMES": 1,
    "HAVE_MADVISE": 1,
    "HAVE_MAKEDEV": 1,
    "HAVE_MBRTOWC": 1,
    "HAVE_MEMFD_CREATE": 1,
    "HAVE_MEMORY_H": 0,
    "HAVE_MEMRCHR": 1,
    "HAVE_MKDIRAT": 1,
    "HAVE_MKFIFO": 1,
    "HAVE_MKFIFOAT": 1,
    "HAVE_MKNOD": 1,
    "HAVE_MKNODAT": 1,
    "HAVE_MKTIME": 1,
    "HAVE_MMAP": 1,
    "HAVE_MREMAP": 1,
    "HAVE_NCURSES_H": 1,
    "HAVE_NDIR_H": 0,
    "HAVE_NETPACKET_PACKET_H": 1,
    "HAVE_NET_IF_H": 1,
    "HAVE_NICE": 1,
    "HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION": 0,
    "HAVE_OPENAT": 1,
    "HAVE_OPENPTY": 1,
    "HAVE_PATHCONF": 1,
    "HAVE_PAUSE": 1,
    "HAVE_PIPE2": 1,
    "HAVE_PLOCK": 0,
    "HAVE_POLL": 1,
    "HAVE_POLL_H": 1,
    "HAVE_POSIX_FADVISE": 1,
    "HAVE_POSIX_FALLOCATE": 1,
    "HAVE_POSIX_SPAWN": 1,
    "HAVE_POSIX_SPAWNP": 1,
    "HAVE_PREAD": 1,
    "HAVE_PREADV": 1,
    "HAVE_PREADV2": 1,
    "HAVE_PRLIMIT": 1,
    "HAVE_PROCESS_H": 0,
    "HAVE_PROTOTYPES": 1,
    "HAVE_PTHREAD_CONDATTR_SETCLOCK": 1,
    "HAVE_PTHREAD_DESTRUCTOR": 0,
    "HAVE_PTHREAD_GETCPUCLOCKID": 1,
    "HAVE_PTHREAD_H": 1,
    "HAVE_PTHREAD_INIT": 0,
    "HAVE_PTHREAD_KILL": 1,
    "HAVE_PTHREAD_SIGMASK": 1,
    "HAVE_PTY_H": 1,
    "HAVE_PWRITE": 1,
    "HAVE_PWRITEV": 1,
    "HAVE_PWRITEV2": 1,
    "HAVE_READLINK": 1,
    "HAVE_READLINKAT": 1,
    "HAVE_READV": 1,
    "HAVE_REALPATH": 1,
    "HAVE_RENAMEAT": 1,
    "HAVE_RL_APPEND_HISTORY": 1,
    "HAVE_RL_CATCH_SIGNAL": 1,
    "HAVE_RL_COMPLETION_APPEND_CHARACTER": 1,
    "HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK": 1,
    "HAVE_RL_COMPLETION_MATCHES": 1,
    "HAVE_RL_COMPLETION_SUPPRESS_APPEND": 1,
    "HAVE_RL_PRE_INPUT_HOOK": 1,
    "HAVE_RL_RESIZE_TERMINAL": 1,
    "HAVE_ROUND": 1,
    "HAVE_RTPSPAWN": 0,
    "HAVE_SCHED_GET_PRIORITY_MAX": 1,
    "HAVE_SCHED_H": 1,
    "HAVE_SCHED_RR_GET_INTERVAL": 1,
    "HAVE_SCHED_SETAFFINITY": 1,
    "HAVE_SCHED_SETPARAM": 1,
    "HAVE_SCHED_SETSCHEDULER": 1,
    "HAVE_SEM_CLOCKWAIT": 1,
    "HAVE_SEM_GETVALUE": 1,
    "HAVE_SEM_OPEN": 1,
    "HAVE_SEM_TIMEDWAIT": 1,
    "HAVE_SEM_UNLINK": 1,
    "HAVE_SENDFILE": 1,
    "HAVE_SETEGID": 1,
    "HAVE_SETEUID": 1,
    "HAVE_SETGID": 1,
    "HAVE_SETGROUPS": 1,
    "HAVE_SETHOSTNAME": 1,
    "HAVE_SETITIMER": 1,
    "HAVE_SETLOCALE": 1,
    "HAVE_SETPGID": 1,
    "HAVE_SETPGRP": 1,
    "HAVE_SETPRIORITY": 1,
    "HAVE_SETREGID": 1,
    "HAVE_SETRESGID": 1,
    "HAVE_SETRESUID": 1,
    "HAVE_SETREUID": 1,
    "HAVE_SETSID": 1,
    "HAVE_SETUID": 1,
    "HAVE_SETVBUF": 1,
    "HAVE_SHADOW_H": 1,
    "HAVE_SHM_OPEN": 1,
    "HAVE_SHM_UNLINK": 1,
    "HAVE_SIGACTION": 1,
    "HAVE_SIGALTSTACK": 1,
    "HAVE_SIGFILLSET": 1,
    "HAVE_SIGINFO_T_SI_BAND": 1,
    "HAVE_SIGINTERRUPT": 1,
    "HAVE_SIGNAL_H": 1,
    "HAVE_SIGPENDING": 1,
    "HAVE_SIGRELSE": 1,
    "HAVE_SIGTIMEDWAIT": 1,
    "HAVE_SIGWAIT": 1,
    "HAVE_SIGWAITINFO": 1,
    "HAVE_SNPRINTF": 1,
    "HAVE_SOCKADDR_ALG": 1,
    "HAVE_SOCKADDR_SA_LEN": 0,
    "HAVE_SOCKADDR_STORAGE": 1,
    "HAVE_SOCKETPAIR": 1,
    "HAVE_SPAWN_H": 1,
    "HAVE_SPLICE": 1,
    "HAVE_SSIZE_T": 1,
    "HAVE_STATVFS": 1,
    "HAVE_STAT_TV_NSEC": 1,
    "HAVE_STAT_TV_NSEC2": 0,
    "HAVE_STDARG_PROTOTYPES": 1,
    "HAVE_STDINT_H": 1,
    "HAVE_STDLIB_H": 1,
    "HAVE_STD_ATOMIC": 1,
    "HAVE_STRFTIME": 1,
    "HAVE_STRINGS_H": 1,
    "HAVE_STRING_H": 1,
    "HAVE_STRLCPY": 0,
    "HAVE_STROPTS_H": 0,
    "HAVE_STRSIGNAL": 1,
    "HAVE_STRUCT_PASSWD_PW_GECOS": 1,
    "HAVE_STRUCT_PASSWD_PW_PASSWD": 1,
    "HAVE_STRUCT_STAT_ST_BIRTHTIME": 0,
    "HAVE_STRUCT_STAT_ST_BLKSIZE": 1,
    "HAVE_STRUCT_STAT_ST_BLOCKS": 1,
    "HAVE_STRUCT_STAT_ST_FLAGS": 0,
    "HAVE_STRUCT_STAT_ST_GEN": 0,
    "HAVE_STRUCT_STAT_ST_RDEV": 1,
    "HAVE_STRUCT_TM_TM_ZONE": 1,
    "HAVE_SYMLINK": 1,
    "HAVE_SYMLINKAT": 1,
    "HAVE_SYNC": 1,
    "HAVE_SYSCONF": 1,
    "HAVE_SYSEXITS_H": 1,
    "HAVE_SYS_AUDIOIO_H": 0,
    "HAVE_SYS_AUXV_H": 1,
    "HAVE_SYS_BSDTTY_H": 0,
    "HAVE_SYS_DEVPOLL_H": 0,
    "HAVE_SYS_DIR_H": 0,
    "HAVE_SYS_ENDIAN_H": 0,
    "HAVE_SYS_EPOLL_H": 1,
    "HAVE_SYS_EVENTFD_H": 1,
    "HAVE_SYS_EVENT_H": 0,
    "HAVE_SYS_FILE_H": 1,
    "HAVE_SYS_IOCTL_H": 1,
    "HAVE_SYS_KERN_CONTROL_H": 0,
    "HAVE_SYS_LOADAVG_H": 0,
    "HAVE_SYS_LOCK_H": 0,
    "HAVE_SYS_MEMFD_H": 0,
    "HAVE_SYS_MKDEV_H": 0,
    "HAVE_SYS_MMAN_H": 1,
    "HAVE_SYS_MODEM_H": 0,
    "HAVE_SYS_NDIR_H": 0,
    "HAVE_SYS_PARAM_H": 1,
    "HAVE_SYS_POLL_H": 1,
    "HAVE_SYS_RANDOM_H": 1,
    "HAVE_SYS_RESOURCE_H": 1,
    "HAVE_SYS_SELECT_H": 1,
    "HAVE_SYS_SENDFILE_H": 1,
    "HAVE_SYS_SOCKET_H": 1,
    "HAVE_SYS_STATVFS_H": 1,
    "HAVE_SYS_STAT_H": 1,
    "HAVE_SYS_SYSCALL_H": 1,
    "HAVE_SYS_SYSMACROS_H": 1,
    "HAVE_SYS_SYS_DOMAIN_H": 0,
    "HAVE_SYS_TERMIO_H": 0,
    "HAVE_SYS_TIMES_H": 1,
    "HAVE_SYS_TIME_H": 1,
    "HAVE_SYS_TYPES_H": 1,
    "HAVE_SYS_UIO_H": 1,
    "HAVE_SYS_UN_H": 1,
    "HAVE_SYS_UTSNAME_H": 1,
    "HAVE_SYS_WAIT_H": 1,
    "HAVE_SYS_XATTR_H": 1,
    "HAVE_TCGETPGRP": 1,
    "HAVE_TCSETPGRP": 1,
    "HAVE_TEMPNAM": 1,
    "HAVE_TERMIOS_H": 1,
    "HAVE_TERM_H": 1,
    "HAVE_TGAMMA": 1,
    "HAVE_TIMEGM": 1,
    "HAVE_TIMES": 1,
    "HAVE_TMPFILE": 1,
    "HAVE_TMPNAM": 1,
    "HAVE_TMPNAM_R": 1,
    "HAVE_TM_ZONE": 1,
    "HAVE_TRUNCATE": 1,
    "HAVE_TZNAME": 0,
    "HAVE_UCS4_TCL": 0,
    "HAVE_UNAME": 1,
    "HAVE_UNISTD_H": 1,
    "HAVE_UNLINKAT": 1,
    "HAVE_USABLE_WCHAR_T": 0,
    "HAVE_UTIL_H": 0,
    "HAVE_UTIMENSAT": 1,
    "HAVE_UTIMES": 1,
    "HAVE_UTIME_H": 1,
    "HAVE_UUID_CREATE": 0,
    "HAVE_UUID_ENC_BE": 0,
    "HAVE_UUID_GENERATE_TIME_SAFE": 1,
    "HAVE_UUID_H": 0,
    "HAVE_UUID_UUID_H": 1,
    "HAVE_VFORK": 1,
    "HAVE_WAIT3": 1,
    "HAVE_WAIT4": 1,
    "HAVE_WAITID": 1,
    "HAVE_WAITPID": 1,
    "HAVE_WCHAR_H": 1,
    "HAVE_WCSCOLL": 1,
    "HAVE_WCSFTIME": 1,
    "HAVE_WCSXFRM": 1,
    "HAVE_WMEMCMP": 1,
    "HAVE_WORKING_TZSET": 1,
    "HAVE_WRITEV": 1,
    "HAVE_ZLIB_COPY": 1,
    "HAVE__GETPTY": 0,
    "HOST_GNU_TYPE": "x86_64-pc-linux-gnu",
    "INCLDIRSTOMAKE": "/usr/include /usr/include /usr/include/python3.10 /usr/include/python3.10",
    "INCLUDEDIR": "/usr/include",
    "INCLUDEPY": "/usr/include/python3.10",
    "INSTALL": "/usr/bin/install -c",
    "INSTALL_DATA": "/usr/bin/install -c -m 644",
    "INSTALL_PROGRAM": "/usr/bin/install -c",
    "INSTALL_SCRIPT": "/usr/bin/install -c",
    "INSTALL_SHARED": "/usr/bin/install -c -m 755",
    "INSTSONAME": "libpython3.10.so.1.0",
    "IO_H": "Modules/_io/_iomodule.h",
    "IO_OBJS": "\\",
    "LDCXXSHARED": "x86_64-linux-gnu-g++ -shared -Wl,-O1 -Wl,-Bsymbolic-functions",
    "LDFLAGS": "-Wl,-Bsymbolic-functions      -g -fwrapv -O2   ",
    "LDFLAGS_NODIST": "",
    "LDLIBRARY": "libpython3.10.so",
    "LDLIBRARYDIR": "",
    "LDSHARED": "x86_64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions      -g -fwrapv -O2   ",
    "LDVERSION": "3.10",
    "LIBC": "",
    "LIBDEST": "/usr/lib/python3.10",
    "LIBDIR": "/usr/lib/x86_64-linux-gnu",
    "LIBFFI_INCLUDEDIR": "",
    "LIBM": "-lm",
    "LIBOBJDIR": "Python/",
    "LIBOBJS": "",
    "LIBPC": "/usr/lib/x86_64-linux-gnu/pkgconfig",
    "LIBPL": "/usr/lib/python3.10/config-3.10-x86_64-linux-gnu",
    "LIBPYTHON": "",
    "LIBRARY": "libpython3.10.a",
    "LIBRARY_DEPS": "libpython3.10.a libpython3.10.so libpython3.so",
    "LIBRARY_OBJS": "\\",
    "LIBRARY_OBJS_OMIT_FROZEN": "\\",
    "LIBS": "-lcrypt -ldl  -lm",
    "LIBSUBDIRS": "asyncio \\",
    "LINKCC": "x86_64-linux-gnu-gcc",
    "LINKFORSHARED": "-Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions",
    "LIPO_32BIT_FLAGS": "",
    "LIPO_INTEL64_FLAGS": "",
    "LLVM_PROF_ERR": "no",
    "LLVM_PROF_FILE": "",
    "LLVM_PROF_MERGER": "true",
    "LN": "ln",
    "LOCALMODLIBS": "-lexpat                       -L/usr/lib -lz                       -lexpat",
    "MACHDEP": "linux",
    "MACHDEP_OBJS": "",
    "MACHDESTLIB": "/usr/lib/x86_64-linux-gnu/python3.10",
    "MACOSX_DEPLOYMENT_TARGET": "",
    "MAINCC": "x86_64-linux-gnu-gcc",
    "MAJOR_IN_MKDEV": 0,
    "MAJOR_IN_SYSMACROS": 1,
    "MAKESETUP": "../Modules/makesetup",
    "MANDIR": "/usr/share/man",
    "MKDIR_P": "/bin/mkdir -p",
    "MODBUILT_NAMES": "array  cmath  math  _struct  _random  _elementtree  _pickle  _datetime  _bisect  _heapq  _statistics  unicodedata  fcntl  spwd  grp  select  _csv  _socket  _posixsubprocess  _md5  _sha1  _sha256  _sha512  _sha3  _blake2  syslog  binascii  zlib  posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  pyexpat  xxsubtype",
    "MODDISABLED_NAMES": "",
    "MODLIBS": "-lexpat                       -L/usr/lib -lz                       -lexpat",
    "MODOBJS": "$(sort   Modules/arraymodule.o  Modules/cmathmodule.o Modules/_math.o  Modules/mathmodule.o Modules/_math.o  Modules/_struct.o  Modules/_randommodule.o  Modules/_elementtree.o  Modules/_pickle.o  Modules/_datetimemodule.o  Modules/_bisectmodule.o  Modules/_heapqmodule.o  Modules/_statisticsmodule.o  Modules/unicodedata.o  Modules/fcntlmodule.o  Modules/spwdmodule.o  Modules/grpmodule.o  Modules/selectmodule.o  Modules/_csv.o  Modules/socketmodule.o  Modules/_posixsubprocess.o  Modules/md5module.o  Modules/sha1module.o  Modules/sha256module.o  Modules/sha512module.o  Modules/sha3module.o  Modules/blake2module.o Modules/blake2b_impl.o Modules/blake2s_impl.o  Modules/syslogmodule.o  Modules/binascii.o  Modules/zlibmodule.o  Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o  Modules/symtablemodule.o  Modules/pyexpat.o  Modules/xxsubtype.o)",
    "MODULE_OBJS": "\\",
    "MULTIARCH": "x86_64-linux-gnu",
    "MULTIARCH_CPPFLAGS": '-DMULTIARCH=\\"x86_64-linux-gnu\\"',
    "MVWDELCH_IS_EXPRESSION": 1,
    "NO_AS_NEEDED": "-Wl,--no-as-needed",
    "OBJECT_OBJS": "\\",
    "OPENSSL_INCLUDES": "",
    "OPENSSL_LDFLAGS": "",
    "OPENSSL_LIBS": "-lssl -lcrypto",
    "OPENSSL_RPATH": "",
    "OPT": "-DNDEBUG -g -fwrapv -O2 -Wall",
    "OTHER_LIBTOOL_OPT": "",
    "PACKAGE_BUGREPORT": 0,
    "PACKAGE_NAME": 0,
    "PACKAGE_STRING": 0,
    "PACKAGE_TARNAME": 0,
    "PACKAGE_URL": 0,
    "PACKAGE_VERSION": 0,
    "PARSER_HEADERS": "\\",
    "PARSER_OBJS": "\\ \\ Parser/myreadline.o Parser/tokenizer.o",
    "PEGEN_HEADERS": "\\",
    "PEGEN_OBJS": "\\",
    "PGO_PROF_GEN_FLAG": "-fprofile-generate",
    "PGO_PROF_USE_FLAG": "",
    "PLATLIBDIR": "lib",
    "POBJS": "\\",
    "POSIX_SEMAPHORES_NOT_ENABLED": 0,
    "PROFILE_TASK": "-m test --pgo --timeout=1200",
    "PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT": 1,
    "PTHREAD_SYSTEM_SCHED_SUPPORTED": 1,
    "PURIFY": "",
    "PY3LIBRARY": "libpython3.so",
    "PYLONG_BITS_IN_DIGIT": 0,
    "PYTHON": "python",
    "PYTHONFRAMEWORK": "",
    "PYTHONFRAMEWORKDIR": "no-framework",
    "PYTHONFRAMEWORKINSTALLDIR": "",
    "PYTHONFRAMEWORKPREFIX": "",
    "PYTHONPATH": "",
    "PYTHON_FOR_BUILD": "./python -E",
    "PYTHON_FOR_REGEN": "",
    "PYTHON_HEADERS": "\\",
    "PYTHON_OBJS": "\\",
    "PY_BUILTIN_HASHLIB_HASHES": '"md5,sha1,sha256,sha512,sha3,blake2"',
    "PY_BUILTIN_MODULE_CFLAGS": "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g       -fstack-protector-strong -Wformat -Werror=format-security  -g -fwrapv -O2    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I../Include/internal -IObjects -IInclude -IPython -I. -I../Include -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPy_BUILD_CORE_BUILTIN",
    "PY_CFLAGS": "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g       -fstack-protector-strong -Wformat -Werror=format-security  -g -fwrapv -O2   ",
    "PY_CFLAGS_NODIST": "-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I../Include/internal",
    "PY_COERCE_C_LOCALE": 1,
    "PY_CORE_CFLAGS": "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g       -fstack-protector-strong -Wformat -Werror=format-security  -g -fwrapv -O2    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I../Include/internal -IObjects -IInclude -IPython -I. -I../Include -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPy_BUILD_CORE",
    "PY_CORE_LDFLAGS": "-Wl,-Bsymbolic-functions      -g -fwrapv -O2   ",
    "PY_CPPFLAGS": "-IObjects -IInclude -IPython -I. -I../Include -Wdate-time -D_FORTIFY_SOURCE=2",
    "PY_ENABLE_SHARED": 1,
    "PY_FORMAT_SIZE_T": '"z"',
    "PY_LDFLAGS": "-Wl,-Bsymbolic-functions      -g -fwrapv -O2   ",
    "PY_LDFLAGS_NODIST": "",
    "PY_SSL_DEFAULT_CIPHERS": 1,
    "PY_SSL_DEFAULT_CIPHER_STRING": 0,
    "PY_STDMODULE_CFLAGS": "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g       -fstack-protector-strong -Wformat -Werror=format-security  -g -fwrapv -O2    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I../Include/internal -IObjects -IInclude -IPython -I. -I../Include -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC",
    "Py_DEBUG": 0,
    "Py_ENABLE_SHARED": 1,
    "Py_HASH_ALGORITHM": 0,
    "Py_TRACE_REFS": 0,
    "QUICKTESTOPTS": "-x test_subprocess test_io test_lib2to3 \\",
    "READELF": "readelf",
    "RESSRCDIR": "Mac/Resources/framework",
    "RETSIGTYPE": "void",
    "RUNSHARED": "LD_LIBRARY_PATH=/build/python3.10-rtDYKr/python3.10-3.10.12/build-shared",
    "SCRIPTDIR": "/usr/lib",
    "SETPGRP_HAVE_ARG": 0,
    "SHELL": "/bin/sh",
    "SHLIBS": "-lcrypt -ldl  -lm",
    "SHLIB_SUFFIX": ".so",
    "SHM_NEEDS_LIBRT": 0,
    "SIGNED_RIGHT_SHIFT_ZERO_FILLS": 0,
    "SITEPATH": "",
    "SIZEOF_DOUBLE": 8,
    "SIZEOF_FLOAT": 4,
    "SIZEOF_FPOS_T": 16,
    "SIZEOF_INT": 4,
    "SIZEOF_LONG": 8,
    "SIZEOF_LONG_DOUBLE": 16,
    "SIZEOF_LONG_LONG": 8,
    "SIZEOF_OFF_T": 8,
    "SIZEOF_PID_T": 4,
    "SIZEOF_PTHREAD_KEY_T": 4,
    "SIZEOF_PTHREAD_T": 8,
    "SIZEOF_SHORT": 2,
    "SIZEOF_SIZE_T": 8,
    "SIZEOF_TIME_T": 8,
    "SIZEOF_UINTPTR_T": 8,
    "SIZEOF_VOID_P": 8,
    "SIZEOF_WCHAR_T": 4,
    "SIZEOF__BOOL": 1,
    "SOABI": "cpython-310-x86_64-linux-gnu",
    "SRCDIRS": "Parser Objects Python Modules Modules/_io Programs",
    "SRC_GDB_HOOKS": "../Tools/gdb/libpython.py",
    "STATIC_LIBPYTHON": 1,
    "STDC_HEADERS": 1,
    "STRICT_SYSV_CURSES": "/* Don't use ncurses extensions */",
    "STRIPFLAG": "-s",
    "SUBDIRS": "",
    "SUBDIRSTOO": "Include Lib Misc",
    "SYSLIBS": "-lm",
    "SYS_SELECT_WITH_SYS_TIME": 1,
    "TCLTK_INCLUDES": "-I/usr/include/tcl8.6",
    "TCLTK_LIBS": "-ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6",
    "TESTOPTS": "",
    "TESTPATH": "",
    "TESTPYTHON": "LD_LIBRARY_PATH=/build/python3.10-rtDYKr/python3.10-3.10.12/build-shared ./python",
    "TESTPYTHONOPTS": "",
    "TESTRUNNER": "LD_LIBRARY_PATH=/build/python3.10-rtDYKr/python3.10-3.10.12/build-shared ./python ../Tools/scripts/run_tests.py",
    "TESTSUBDIRS": "ctypes/test \\",
    "TESTTIMEOUT": 1200,
    "TEST_MODULES": "yes",
    "THREAD_STACK_SIZE": 0,
    "TIMEMODULE_LIB": 0,
    "TIME_WITH_SYS_TIME": 1,
    "TM_IN_SYS_TIME": 0,
    "TZPATH": "/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/zoneinfo",
    "UNICODE_DEPS": "\\",
    "UNIVERSALSDK": "",
    "UPDATE_FILE": "../Tools/scripts/update_file.py",
    "USE_COMPUTED_GOTOS": 1,
    "VERSION": "3.10",
    "VPATH": "..",
    "WHEEL_PKG_DIR": "/usr/share/python-wheels/",
    "WINDOW_HAS_FLAGS": 1,
    "WITH_DECIMAL_CONTEXTVAR": 1,
    "WITH_DOC_STRINGS": 1,
    "WITH_DTRACE": 1,
    "WITH_DYLD": 0,
    "WITH_EDITLINE": 0,
    "WITH_LIBINTL": 0,
    "WITH_NEXT_FRAMEWORK": 0,
    "WITH_PYMALLOC": 1,
    "WITH_VALGRIND": 0,
    "X87_DOUBLE_ROUNDING": 0,
    "XMLLIBSUBDIRS": "xml xml/dom xml/etree xml/parsers xml/sax",
    "abs_builddir": "/build/python3.10-rtDYKr/python3.10-3.10.12/build-shared",
    "abs_srcdir": "/build/python3.10-rtDYKr/python3.10-3.10.12/build-shared/..",
    "datarootdir": "/usr/share",
    "srcdir": "/usr/lib/python3.10/config-3.10-x86_64-linux-gnu",
    "SO": ".cpython-310-x86_64-linux-gnu.so",
    "userbase": "/home/falinux/.local",
    "multiarchsubdir": "/x86_64-linux-gnu",
}

 

 대충검색해봐도 아키텍쳐 설정은 없는데 SSE, MMX, AVX 관련 설정은 없는 것 같고

-march=cpu-type
Generate instructions for the machine type cpu-type. In contrast to -mtune=cpu-type, which merely tunes the generated code for the specified cpu-type, -march=cpu-type allows GCC to generate code that may not run at all on processors other than the one indicated. Specifying -march=cpu-type implies -mtune=cpu-type, except where noted otherwise.

The choices for cpu-type are:

‘native’
This selects the CPU to generate code for at compilation time by determining the processor type of the compiling machine. Using -march=native enables all instruction subsets supported by the local machine (hence the result might not run on different machines). Using -mtune=native produces code optimized for the local machine under the constraints of the selected instruction set.

‘x86-64’
A generic CPU with 64-bit extensions, MMX, SSE, SSE2, and FXSR instruction set support.

[링크 : https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html]

 

그렇다고 해서 -O2 까지만 보이니 vectorization은 지원안할꺼 같고...

Vectorization in GCC is enabled at -O3. That's why at -O0, you see only the ordinary scalar SSE2 instructions (movsd, addsd, etc). 

[링크 : https://stackoverflow.com/questions/7919304/gcc-sse-code-optimization]

'Programming > python(파이썬)' 카테고리의 다른 글

pip 패키지 완전 삭제하기  (0) 2025.08.13
pip install cmake build multi core support  (0) 2025.08.13
python용 얼굴탐지, 인식  (0) 2025.08.04
python struct  (0) 2024.12.13
python matplotlib 동시 여러개 띄우기  (0) 2024.05.29
Posted by 구차니

테스트 해보니 haar 보다 프레임은 안나오고(한 10프레임?)

cpu 점유율은 1개 조지지만, 전체 로드율은 낮은 듯

 

[링크 : https://github.com/ageitgey/face_recognition]

     [링크 : https://wikidocs.net/227902]

[링크 : https://dlib.net/]

 

haar cascade

[링크 : https://bkshin.tistory.com/entry/컴퓨터-비전-1-하르-캐스케이드-얼굴-검출-Haar-Cascade-Face-Detection]



face_recognition 패키지

import cv2
import face_recognition

webcam = cv2.VideoCapture(0)

if not webcam.isOpened():
    print("Could not open webcam")
    exit()

while webcam.isOpened():
    status, frame = webcam.read()

    if status:
        face_locations = face_recognition.face_locations(frame)
        print(face_locations)
        if len(face_locations) > 0:
            for iter in face_locations:
                cv2.rectangle(frame, (iter[1], iter[0]), (iter[3], iter[2]), (0,255,0), 2)
        cv2.imshow("test", frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

webcam.release()
cv2.destroyAllWindows()

 

opencv2 / haar cascade

import cv2
import time

dirname = '/home/falinux/.local/lib/python3.10/site-packages/cv2/data/'

face_cascade = cv2.CascadeClassifier(dirname + 'haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier(dirname + 'haarcascade_eye.xml')

cam = cv2.VideoCapture(0)
# cam.set(3, 160) # CV_CAP_PROP_FRAME_WIDTH
# cam.set(4, 120) # CV_CAP_PROP_FRAME_HEIGHT
# cam.set(5, 20) # CV_CAP_PROP_FPS
# print(cam.get(3))
# print(cam.get(4))
# print(cam.get(5))

while True:
 ret_val, img = cam.read()
 gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
 
 faces = face_cascade.detectMultiScale(gray, 1.05, 5)
 print(faces)
 for (x, y, w, h) in faces:
  img = cv2.rectangle(img, (x, y), (x+w, y+h), (255, 0, 0), 2)
  roi_gray = gray[y:y+h, x:x+w]
  roi_color = img[y:y+h, x:x+w]
  eyes = eye_cascade.detectMultiScale(roi_gray)
  for (ex, ey, ew, eh) in eyes:
   cv2.rectangle(roi_color, (ex, ey), (ex+ew, ey+eh), (0, 255, 0), 2)

 time.sleep(0.15)
 cv2.imshow("Cam Viewer", img)
#  cv2.imshow("Cam Viewer gray", gray)
 if cv2.waitKey(1) == 27:
     break

'Programming > python(파이썬)' 카테고리의 다른 글

pip install cmake build multi core support  (0) 2025.08.13
python 빌드 정보  (0) 2025.08.04
python struct  (0) 2024.12.13
python matplotlib 동시 여러개 띄우기  (0) 2024.05.29
python matplotlib 그래프 갱신하기  (0) 2024.05.27
Posted by 구차니
Programming/openGL2025. 7. 30. 23:13

맨날 리눅스에서만 하다가 노트북 바꾸기 귀찮아서(!!) 윈도우에서도 해보려고 발악중

 

일단은 visual studio 에서 콘솔앱으로는 안되서

Windows 데스크탑 애플리케이션으로 프로젝트를 생성

 

프로젝트 설정에 링커 - 입력 - 추가 종속성에

 

opengl32.lib 와 glu32.lib를 추가해주면 끝

[링크 : https://makingrobot.tistory.com/155]

 

F5 눌러서 빌드하니 잘 뜬다.

 

 

아래는 gemini가 생성해준 소스코드.

더보기

#include <windows.h> // Win32 API 헤더
#include <gl/gl.h>   // OpenGL 핵심 헤더
#include <gl/glu.h>  // GLU 유틸리티 헤더

// OpenGL 렌더링 컨텍스트 핸들
HGLRC g_hRC = NULL;
// 디바이스 컨텍스트 핸들
HDC g_hDC = NULL;
// 윈도우 핸들
HWND g_hWnd = NULL;
// 인스턴스 핸들
HINSTANCE g_hInstance = NULL;

// 창 클래스 이름 (유니코드 문자열)
LPCWSTR szWindowClass = L"OpenGLWindow";
// 창 제목 (유니코드 문자열)
LPCWSTR szTitle = L"Simple OpenGL Triangle (No GLUT)";

// OpenGL 초기화 함수
void InitOpenGL() {
    // 배경색을 검정색으로 설정 (RGBA 값)
    glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
    // 현재 매트릭스를 프로젝션 매트릭스로 설정
    glMatrixMode(GL_PROJECTION);
    // 2D 직교 투영 설정 (좌표계: x=0.0~200.0, y=0.0~200.0)
    gluOrtho2D(0.0, 200.0, 0.0, 200.0);
}

// 그리기 함수
void DrawScene() {
    // 컬러 버퍼 클리어
    glClear(GL_COLOR_BUFFER_BIT);

    // 삼각형 그리기 시작
    glBegin(GL_TRIANGLES);
    // 첫 번째 꼭지점: 빨간색 (위쪽)
    glColor3f(1.0f, 0.0f, 0.0f);
    glVertex2i(100, 150);
    // 두 번째 꼭지점: 녹색 (왼쪽 아래)
    glColor3f(0.0f, 1.0f, 0.0f);
    glVertex2i(50, 50);
    // 세 번째 꼭지점: 파란색 (오른쪽 아래)
    glColor3f(0.0f, 0.0f, 1.0f);
    glVertex2i(150, 50);
    glEnd(); // 삼각형 그리기 끝

    // 프론트 버퍼와 백 버퍼 교체 (더블 버퍼링 사용 시)
    SwapBuffers(g_hDC);
}

// OpenGL 활성화 함수
// 창 핸들(hWnd), 디바이스 컨텍스트 포인터(hDC), 렌더링 컨텍스트 포인터(hRC)를 인자로 받음
void EnableOpenGL(HWND hWnd, HDC* hDC, HGLRC* hRC) {
    PIXELFORMATDESCRIPTOR pfd;
    int iFormat;

    // 픽셀 형식 기술자 구조체를 0으로 초기화
    ZeroMemory(&pfd, sizeof(pfd));
    // 픽셀 형식 기술자 구조체의 크기 설정
    pfd.nSize = sizeof(pfd);
    // 픽셀 형식 기술자 버전 설정
    pfd.nVersion = 1;
    // 픽셀 형식 플래그 설정: 윈도우에 그리기, OpenGL 지원, 더블 버퍼링 사용
    pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
    // 픽셀 타입 설정: RGBA 색상 모드
    pfd.iPixelType = PFD_TYPE_RGBA;
    // 색상 비트 깊이 설정: 32비트 색상
    pfd.cColorBits = 32;
    // 깊이 버퍼 비트 깊이 설정: 16비트 깊이 버퍼
    pfd.cDepthBits = 16;
    // 레이어 타입 설정: 메인 평면
    pfd.iLayerType = PFD_MAIN_PLANE;

    // 윈도우의 디바이스 컨텍스트를 얻음
    *hDC = GetDC(hWnd);

    // 주어진 픽셀 형식 기술자에 가장 적합한 픽셀 형식을 찾음
    iFormat = ChoosePixelFormat(*hDC, &pfd);
    // 디바이스 컨텍스트에 픽셀 형식을 설정
    SetPixelFormat(*hDC, iFormat, &pfd);

    // OpenGL 렌더링 컨텍스트 생성
    *hRC = wglCreateContext(*hDC);
    // 현재 스레드의 디바이스 컨텍스트에 렌더링 컨텍스트를 연결
    wglMakeCurrent(*hDC, *hRC);

    // OpenGL 초기화 함수 호출
    InitOpenGL();
}

// OpenGL 비활성화 함수
// 창 핸들(hWnd), 디바이스 컨텍스트(hDC), 렌더링 컨텍스트(hRC)를 인자로 받음
void DisableOpenGL(HWND hWnd, HDC hDC, HGLRC hRC) {
    // 현재 렌더링 컨텍스트를 해제
    wglMakeCurrent(NULL, NULL);
    // 렌더링 컨텍스트를 삭제
    wglDeleteContext(hRC);
    // 디바이스 컨텍스트를 해제
    ReleaseDC(hWnd, hDC);
}

// 윈도우 프로시저 (메시지 처리 콜백 함수)
// 윈도우 핸들, 메시지 코드, 추가 정보(wParam, lParam)를 인자로 받음
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
    switch (message) {
        // 윈도우 생성 시 발생하는 메시지
    case WM_CREATE:
        // OpenGL 활성화 함수 호출
        EnableOpenGL(hWnd, &g_hDC, &g_hRC);
        break;

        // 윈도우가 다시 그려져야 할 때 발생하는 메시지
    case WM_PAINT:
        // 그리기 함수 호출
        DrawScene();
        // WM_PAINT 메시지를 유효화 (반복적인 WM_PAINT 메시지 방지)
        ValidateRect(hWnd, NULL);
        break;

        // 윈도우 크기 변경 시 발생하는 메시지
    case WM_SIZE:
        // 뷰포트 크기를 윈도우 크기에 맞게 조정 (선택 사항)
        // L_PARAM에서 새 너비와 높이를 추출하여 glViewport 함수에 전달
        // glViewport(0, 0, LOWORD(lParam), HIWORD(lParam));
        break;

        // 윈도우 닫기 버튼 클릭 시 발생하는 메시지
    case WM_CLOSE:
        // 윈도우 파괴 메시지를 보냄
        DestroyWindow(hWnd);
        break;

        // 윈도우가 파괴될 때 발생하는 메시지
    case WM_DESTROY:
        // OpenGL 비활성화 함수 호출
        DisableOpenGL(hWnd, g_hDC, g_hRC);
        // 메시지 루프를 종료하는 메시지를 보냄
        PostQuitMessage(0);
        break;

        // 처리하지 않는 다른 메시지들은 기본 윈도우 프로시저로 전달
    default:
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    return 0;
}

// WinMain 함수 (Windows 애플리케이션의 진입점)
// 인스턴스 핸들, 이전 인스턴스 핸들, 명령줄 문자열, 표시 상태 플래그를 인자로 받음
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
    WNDCLASS wc; // 윈도우 클래스 구조체
    MSG msg;     // 메시지 구조체
    BOOL bDone = FALSE; // 메시지 루프 종료 플래그

    g_hInstance = hInstance; // 현재 인스턴스 핸들 저장

    // 윈도우 클래스 스타일 설정: 고유한 DC, 수평/수직 리드로우 시 다시 그리기
    wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
    // 윈도우 프로시저 함수 포인터 설정
    wc.lpfnWndProc = WndProc;
    // 추가 클래스 메모리 (0)
    wc.cbClsExtra = 0;
    // 추가 윈도우 메모리 (0)
    wc.cbWndExtra = 0;
    // 인스턴스 핸들 설정
    wc.hInstance = hInstance;
    // 아이콘 설정 (기본 애플리케이션 아이콘)
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    // 커서 설정 (기본 화살표 커서)
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    // 배경 브러시 설정 (검정색 솔리드 브러시)
    wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
    // 메뉴 이름 (없음)
    wc.lpszMenuName = NULL;
    // 윈도우 클래스 이름 설정 (LPCWSTR)
    wc.lpszClassName = szWindowClass;

    // 윈도우 클래스 등록 시도
    if (!RegisterClass(&wc)) {
        // 등록 실패 시 메시지 박스 표시 (유니코드 문자열 사용)
        MessageBox(NULL, L"Window Registration Failed!", L"Error", MB_ICONEXCLAMATION | MB_OK);
        return 0; // 프로그램 종료
    }

    // 윈도우 생성 시도
    g_hWnd = CreateWindowEx(
        WS_EX_APPWINDOW, // 확장된 윈도우 스타일: 작업 표시줄에 앱으로 표시
        szWindowClass,   // 윈도우 클래스 이름 (LPCWSTR)
        szTitle,         // 윈도우 제목 (LPCWSTR)
        // 윈도우 스타일: 오버랩된 창, 형제 윈도우 영역 클리핑, 자식 윈도우 영역 클리핑
        WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
        CW_USEDEFAULT, CW_USEDEFAULT, // x, y 위치 (기본값 사용)
        400, 400, // 윈도우 너비, 높이
        NULL,    // 부모 윈도우 핸들 (없음)
        NULL,    // 메뉴 핸들 (없음)
        hInstance, // 인스턴스 핸들
        NULL     // 추가 생성 데이터 (없음)
    );

    // 윈도우 생성 실패 시
    if (!g_hWnd) {
        // 메시지 박스 표시 (유니코드 문자열 사용)
        MessageBox(NULL, L"Window Creation Failed!", L"Error", MB_ICONEXCLAMATION | MB_OK);
        return 0; // 프로그램 종료
    }

    // 윈도우를 화면에 표시
    ShowWindow(g_hWnd, nCmdShow);
    // 윈도우를 업데이트하여 WM_PAINT 메시지 발생
    UpdateWindow(g_hWnd);

    // 메시지 루프
    while (!bDone) {
        // 메시지 큐에서 메시지를 확인 (메시지가 없어도 즉시 반환)
        if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
            // 종료 메시지 (WM_QUIT) 수신 시
            if (msg.message == WM_QUIT) {
                bDone = TRUE; // 루프 종료 플래그 설정
            }
            else {
                // 키보드 메시지를 번역 (예: VK_SHIFT -> WM_KEYDOWN)
                TranslateMessage(&msg);
                // 메시지를 해당 윈도우의 윈도우 프로시저로 디스패치
                DispatchMessage(&msg);
            }
        }
        else {
            // 메시지가 없을 때 지속적으로 그리기 (게임 루프와 유사)
            DrawScene();
        }
    }

    // 프로그램 종료 코드 반환
    return (int)msg.wParam;
}

'Programming > openGL' 카테고리의 다른 글

openGL light  (0) 2025.07.30
openGL shade  (0) 2025.07.30
openGL 은선제거  (0) 2025.07.29
openGL 스터디용 gemini 생성 코드  (0) 2025.07.16
blender in openGL  (0) 2025.04.28
Posted by 구차니
Programming/openGL2025. 7. 30. 19:33

양면을 모두 조명처리하도록 설정하려면 아래의 명령을 쓰면 된다고 한다.

폴리곤을 줄이기 위해서 두께가 없는 면으로 구성된 녀석을 광원을 주려면 이렇게 해야만 culling 에서 문제가 안되려나?

glLightModeli(GL_LIGHT_MODEL_TWO_SIDED, GL_TRUE);

[링크 : https://wjdgh283.tistory.com/m/entry/OpenGL로-배우는-컴퓨터-그래픽스-Chapter-03-그래픽-컬러처리-1]

 

광원을 켜면 glColor로 설정한 건 무시된다고.

그래서 glMaterialfv()로 값을 설정해야 한다고 하는데, 광원의 종류를 객체별로 지정해주는 건가?

glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, materialAmbient );
glMaterialfv( GL_FORNT, GL_SPECULAR, materialSpecular );
glMaterialf( GL_FRONT, GL_SHININESS, 60.0f );

[링크 : https://sungcheol-kim.gitbook.io/opengl-tutorial/chapter10]

'Programming > openGL' 카테고리의 다른 글

visual studio 2002 에서 openGL 예제 실행  (0) 2025.07.30
openGL shade  (0) 2025.07.30
openGL 은선제거  (0) 2025.07.29
openGL 스터디용 gemini 생성 코드  (0) 2025.07.16
blender in openGL  (0) 2025.04.28
Posted by 구차니
Programming/openGL2025. 7. 30. 19:27

opengl에서 지원하는 쉐이드(면 색상 칠하기)는 flat과 gouraud 뿐이라는데

한 20년 전에 퐁은 어떻게 한거였지?

 

I digged around a bit. You can use the fixed function pipeline and set glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 1); GL will then light backfaces with your back material and reversed normals. 

[링크 : https://gamedev.stackexchange.com/questions/9228/double-sides-face-with-two-normals]

 

flat / Gouraud

[링크 : https://gofo-coding.tistory.com/entry/OpenGL-Lighting-Shading]

 

phong은 쉐이더 써야한다고

[링크 : https://dev-sbee.tistory.com/35]

 

'Programming > openGL' 카테고리의 다른 글

visual studio 2002 에서 openGL 예제 실행  (0) 2025.07.30
openGL light  (0) 2025.07.30
openGL 은선제거  (0) 2025.07.29
openGL 스터디용 gemini 생성 코드  (0) 2025.07.16
blender in openGL  (0) 2025.04.28
Posted by 구차니
Programming/openGL2025. 7. 29. 18:14

숨겨진 선이나 면을 제거하는 건데

폴리곤의 방향에 따라서 해당 면을 앞면으로 판단해 렌더하냐 안하냐를 설정해 주어야 한다.

그런데 폴리곤의 normal vector를 이용해 cpu로 처리하는거 보다 이렇게 gpu에서 처리하도록 구현되어 있...겠지?

 

glEnable(GL_CULL_FACE);
glFrontFace(GL_CW);
glCullFace(GL_BACK);

glEnable(GL_DEPTH_TEST);

[링크 : https://blog.naver.com/thooy/10097790648]

 

Name
glCullFace — specify whether front- or back-facing polygons can be culled

C Specification
void glCullFace( GLenum mode);
 
Parameters
mode
Specifies whether front- or back-facing polygons are candidates for culling. Symbolic constants GL_FRONT, GL_BACK, and GL_FRONT_AND_BACK are accepted. The initial value is GL_BACK.

[링크 : https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glCullFace.xml]

 

은선 제거 기법에는 다음과 같은 기법들이 있다.


. 최대 최소법에 의한 은선 처리
. 법선 벡터법에 의한 은선 처리
. 능선 탐색법에 의한 은선 처리
. 공간 접근
. 객체 공간 알고리즘
. 리스트 순위 알고리즘
. 이미지 공간 알고리즘
. 워노크 알고리즘
. 프랭크린 알고리즘
. 웨일러-아델톤 알고리즘

[링크 : https://blog.naver.com/hwa7132/100096580196]

[링크 : https://learnopengl.com/Advanced-OpenGL/Face-culling]

[링크 : https://funnypr.tistory.com/m/entry/OpenGL-Normal-Vector]

[링크 : https://usingsystem.tistory.com/m/487]

[링크 : https://www.gamedev.net/forums/topic/620304-opengl-frustum-culling-with-glrotatef/]

 

'Programming > openGL' 카테고리의 다른 글

openGL light  (0) 2025.07.30
openGL shade  (0) 2025.07.30
openGL 스터디용 gemini 생성 코드  (0) 2025.07.16
blender in openGL  (0) 2025.04.28
opengl glortho gluperspective  (0) 2023.08.28
Posted by 구차니