概要
JetPackは,UbuntuベースのJetson向けOSとJetson SDKコンポーネントのパッケージです.このJetPackにはOpenCVも含まれています. 本記事では,このOpenCVの情報の確認方法を備忘録としてメモします.
Jetson | Jetson Nano |
---|---|
JetPack | 4.6 |
JetPackにインストールされているOpenCVのバージョン
JetPack 4.6
JetPackのリリースページにインストールされているOpenCVのバージョンが記載されています. 「KEY FEATURES IN JETPACK」の「Computer Vision」の項目を参照してください.
JetPack 4.6にはOpenCV 4.1.1が含まれていることがわかります. ただし,このOpenCVはCUDAサポートがOFFになっています.OpenCVのサンプルコードを試しに実行する程度であれば,まずはこのOpenCVで良いケースが多いと思います.
なお,CUDAサポートがONのOpenCVは主に下記2通りの方法で入手できます.NVIDIA L4T MLを使用する方法が比較的手軽だと思います.
- CUDAサポートがONのOpenCVが含まれている,NVIDIA L4T MLのDockerイメージを使用する
- JetsonHacksNano/buildOpenCVなどを使用して,OpenCVをビルドする
JetPack 4.6以外
過去のバージョンなど,JetPack 4.6以外のリリースページには下記のリンクからアクセスすることができます.
Jetson statsでOpenCVライブラリの情報を確認する
Jetson statsをインストールする
Jetson statsは,Jetsonのモニタリングや制御ができるユーティリティです.後述のようにPython 3でもOpenCVライブラリの情報を確認することができますが,Jetson statsではコマンド1つでより簡単に確認できます.
下記のコマンドを実行することでインストールできます.インストール後に再起動してください.
1 2 3 | $ sudo apt install -y python3-pip $ sudo -H pip3 install -U jetson-stats $ sudo reboot |
Jetson statsでOpenCVライブラリの情報を確認する
jetson_releaseコマンドを実行します.「OpenCV: 4.1.1 compiled CUDA: NO」という情報から,CUDAサポートがOFFのOpenCV 4.1.1がインストールされていることが確認できます.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | $ jetson_release -v - NVIDIA Jetson Nano (Developer Kit Version) * Jetpack 4.6 [L4T 32.6.1] * NV Power Mode: MAXN - Type: 0 * jetson_stats.service: active - Board info: * Type: Nano (Developer Kit Version) * SOC Family: tegra210 - ID:33 * Module: P3448-0000 - Board: P3449-0000 * Code Name: porg * Boardids: 3448 * CUDA GPU architecture (ARCH_BIN): 5.3 * Serial Number: 0421319028141 - Libraries: * CUDA: 10.2.300 * cuDNN: 8.2.1.32 * TensorRT: 8.0.1.6 * Visionworks: 1.6.0.501 * OpenCV: 4.1.1 compiled CUDA: NO * VPI: ii libnvvpi1 1.1.15 arm64 NVIDIA Vision Programming Interface library * Vulkan: 1.2.70 - jetson-stats: * Version 3.1.2 * Works on Python 3.6.9 |
Python 3でOpenCVライブラリの情報を確認する
バージョンを確認する
Python 3では,OpenCVがインストールされていることと,インストールされているOpenCVのバージョンを下記のように確認できます.
1 2 3 4 5 6 7 8 | $ python3 Python 3.6.9 (default, Dec 8 2021, 21:08:43) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import cv2 >>> print(cv2.__version__) 4.1.1 >>> exit() |
ビルド情報を確認する
インストールされているOpenCVのビルド情報も確認することができます.
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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | $ python3 Python 3.6.9 (default, Dec 8 2021, 21:08:43) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import cv2 >>> print(cv2.getBuildInformation()) General configuration for OpenCV 4.1.1 ===================================== Version control: 4.1.1-2-gd5a58aa75 Platform: Timestamp: 2019-12-13T17:25:11Z Host: Linux 4.9.140-tegra aarch64 CMake: 3.10.2 CMake generator: Unix Makefiles CMake build tool: /usr/bin/make Configuration: Release CPU/HW features: Baseline: NEON FP16 required: NEON disabled: VFPV3 C/C++: Built as dynamic libs?: YES C++ Compiler: /usr/bin/c++ (ver 7.4.0) C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -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): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -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: /usr/bin/cc C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -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): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -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): -Wl,--gc-sections Linker flags (Debug): -Wl,--gc-sections ccache: NO Precompiled headers: NO Extra dependencies: dl m pthread rt 3rdparty dependencies: OpenCV modules: To be built: calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python2 python3 stitching ts video videoio Disabled: world Disabled by dependency: - Unavailable: java js Applications: tests perf_tests examples apps Documentation: NO Non-free algorithms: NO GUI: GTK+: YES (ver 2.24.32) GThread : YES (ver 2.56.4) GtkGlExt: NO Media I/O: ZLib: /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11) JPEG: /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80) WEBP: build (ver encoder: 0x020e) PNG: /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.34) TIFF: /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.0.9) JPEG 2000: build (ver 1.900.1) HDR: YES SUNRASTER: YES PXM: YES PFM: YES Video I/O: FFMPEG: YES avcodec: YES (57.107.100) avformat: YES (57.83.100) avutil: YES (55.78.100) swscale: YES (4.8.100) avresample: NO GStreamer: YES (1.14.5) v4l/v4l2: YES (linux/videodev2.h) Parallel framework: TBB (ver 2017.0 interface 9107) Trace: YES (with Intel ITT) Other third-party libraries: Lapack: NO Eigen: YES (ver 3.3.4) Custom HAL: YES (carotene (ver 0.0.1)) Protobuf: build (3.5.1) Python 2: Interpreter: /usr/bin/python2.7 (ver 2.7.15) Libraries: /usr/lib/aarch64-linux-gnu/libpython2.7.so (ver 2.7.15+) numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.13.3) install path: lib/python2.7/dist-packages/cv2/python-2.7 Python 3: Interpreter: /usr/bin/python3 (ver 3.6.9) Libraries: /usr/lib/aarch64-linux-gnu/libpython3.6m.so (ver 3.6.9) numpy: /usr/lib/python3/dist-packages/numpy/core/include (ver 1.13.3) install path: lib/python3.6/dist-packages/cv2/python-3.6 Python (for build): /usr/bin/python2.7 Java: ant: NO JNI: NO Java wrappers: NO Java tests: NO Install to: /usr ----------------------------------------------------------------- >>> exit() |
0 件のコメント:
コメントを投稿