
D-Robotics RDK X3 入門 (5) - 画像分類
「RDK X3」の画像分類のサンプルを試したのでまとめました。
前回
1. mobilenet v1
「mobilenet v1」は有名な画像分類モデルの1つです。軽量で効率的なディープニューラルネットワークアーキテクチャで、特にモバイルデバイスやリソース制約のある環境での利用を念頭に置いて設計されています。
2. mobilenet v1 のサンプルコード実行
「RDK X3」には、「mobilenet v1」のサンプルコード「test_mobilenetv1.py」が提供されています。
(1) メニュー「Terminal Emulator」を選択。
(2) 「/app/pydev_demo/01_basic_sample/」に移動して「test_mobilenetv1.py」を実行。
画像「zebra_cls.jpg」を入力して分類結果 (zebura) を出力します。
cd /app/pydev_demo/01_basic_sample/
sudo ./test_mobilenetv1.py
[BPU_PLAT]BPU Platform Version(1.3.3)!
[HBRT] set log level as 0. version = 3.15.25.0
[DNN] Runtime version = 1.18.6_(3.15.25 HBRT)
[A][DNN][packed_model.cpp:234][Model](2024-11-11,20:39:56.88.839) [HorizonRT] The model builder version = 1.6.8
========== inputs[0] properties ==========
tensor type: NV12
data type: uint8
layout: NCHW
shape: (1, 3, 224, 224)
inputs[0] name is: data
========== outputs[0] properties ==========
tensor type: float32
data type: float32
layout: NCHW
shape: (1, 1000, 1, 1)
outputs[0] name is: prob
postprocess time is : 0.0006458759307861328
cls id: 340, Confidence: 0.99185, class_name: zebra


【おまけ】 サンプルコード一覧
サンプルコード一覧は次のとおりです。
・01_basic_sample
・02_usb_camera_sample
・03_mipi_camera_sample
・04_segment_sample
・05_web_display_camera_sample
・06_yolov3_sample
・07_yolov5_sample
・08_decode_rtsp_stream
・09_yolov5x_sample
・10_ssd_mobilenetv1_sample
・11_centernet_sample
・12_efficientdet_sample
・13_yolov5s_v6_v7_sample
・models
・centernet_512x512_nv12.bin
・centernet_resnet101_512x512_nv12.bin
・efficient_det_512x512_nv12.bin
・efficientdetd0_512x512_nv12.bin
・efficient_det_no_dequanti_512x512_nv12.bin
・efficientnasnet_m_300x300_nv12.bin
・efficientnet_lite0_224x224_nv12.bin
・efficientnet_lite1_240x240_nv12.bin
・efficientnet_lite2_260x260_nv12.bin
・efficientnet_lite3_280x280_nv12.bin
・efficientnet_lite4_300x300_nv12.bin
・fcos_512x512_nv12.bin
・googlenet_224x224_nv12.bin
・googlenet_cop_224x224_nv12.bin
・lenet_28x28_gray.bin
・mobilenet_multi_224x224_gray.bin
・mobilenet_ssd_300x300_nv12.bin
・mobilenet_unet_1024x2048_nv12.bin
・mobilenetv1_224x224_nv12.bin
・mobilenetv1_224x224_nv12_dump.bin
・mobilenetv2_224x224_nv12.bin
・resnet18_224x224_nv12.bin
・resnet50_64x56x56_featuremap.bin
・ssd_mobilenetv1_300x300_nv12.bin
・vargconvnet_224x224_nv12.bin
・yolov2_608x608_nv12.bin
・yolov2_preempted_608x608_nv12.bin
・yolov3_416x416_nv12.bin
・yolov3_darknet53_416x416_nv12.bin
・yolov3_preempted_416x416_nv12.bin
・yolov5_672x672_nv12.bin
・yolov5s_672x672_nv12.bin
・yolov5s_v6_640x640_nv12.bin
・yolov5s_v7_640x640_nv12.bin
・yolov5x_672x672_nv12.bin