# aimodel **Repository Path**: vanlance8/aimodel ## Basic Information - **Project Name**: aimodel - **Description**: aimodel模块代码 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-28 - **Last Updated**: 2025-08-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 开发手册 # 开发记录 - 20240725 刘峰 - 从aimodel master分支中添加新开发分支develop,后续本人的推理框架算法适配工作均在此分支中提交。 - aimodel子模块rockchip文件夹中新增通用字符识别模块ocr目录,适配车牌文字段关键点检测算法接口。 - aimodel子模块rockchip文件夹中通用字符识别模块ocr目录,适配车牌号码字符串识别算法接口。 - 算法接口调用经过独立的测试及推理框架的长时间测试,均未发现内存泄漏。 - 20240710 孙杰 - 使用imageblob作为预处理数据载荷时,对应模型配置文件中Transforms部分必须要有Normalize,参数可以看文档,如果配置文件缺失Normalize将会提前return - 20240709 孙杰 - 新增支持rockchip下使用YOLOV8模型推理代码 - 20240704 孙杰 - 新增支持nvidia下使用onnx推理代码 - 遗留问题1:单显卡上多模型初始化会报错,目前只是跑的单模型,yolov8速度65fps - 针对每种平台编译的CMakeLists.txt在各自的文件夹下 `onnxruntime::CudaCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*) [with ERRTYPE = cudaError; bool THRW = true; std::conditional_t = void] CUDA failure 2: out of memory ; GPU=0 ; hostname=zqdlai2060 ; expr=cudaMalloc((void**)&p, size);` - 20240702 孙杰 - `ImageBlob` 类使用时/修改时需要注意多平台下兼容性问题 - 目前只适配了rk3588平台代码 - 支持视频识别,支持性能测试 - 遗留问题1: 指定npu下无法提高npu负载 - 遗留问题2: 6线程下推理,npu负载能提高,但是会蹦 - 参考代码: aimodel/rockchip/main.npu.cpp # rockchip rk3588 ## horizon x3 # 模型配置文件示例 ```yaml algorithm: det use_gpu: 0 # gpu gpu_id: 0 gpu_mem: 2000 use_mkldnn: false # cpu cpu_threads: 4 arch: YOLOV5 # YOLO, SSD, RetinaNet, RCNN, Face. min_subgraph_size: 3 draw_threshold: 0.4 nms_threshold: 0.3 # 0.6 表示NMS的阈值,重叠度高于该阈值的边界框会被抑制 input_shape: [640, 640] strides: [8, 16, 32] anchors_table: [[[10, 13],[16, 30],[33, 23]], [[30, 61],[62, 45],[59, 119]], [[116, 90],[156, 198],[373, 326]]] predictor_type: analysis # analysis, fp16, fp32 image_type: RGB channels: 3 data_format: CHW batch_size: 1 label_list: - safehat - nonsafehat - handphone - face2smoke - person - face2nosmoke - hand2smoke - handnophone - hand2nosmoke Transforms: # - Resize: # target_size: [768, 768] - ResizeByLong: fix_size: 640 - Padding: target_size: [640, 640] im_padding_value: [114, 114, 114] - Normalize: scale: 1 mean: [0, 0, 0] std: [1, 1, 1] min_val: [0., 0., 0.] max_val: [255., 255., 255.] ```