当前位置: 首页 > news >正文

关于HalconDeeplearn中的语义分割的实现

1.读取数据和数据集

read_dl_model ('C:/Users/user/Desktop/大蒜测试/包裹/model_训练-240926-191345_opt.hdl', DLModelHandle)
read_dict('C:/Users/user/Desktop/大蒜测试/包裹/model_训练-240926-162708_opt_dl_preprocess_params.hdict',[], [], DLDataset)

2.读取识别图片

ImageFiles := []
ImageFiles[0] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-083830-959230.jpg'
ImageFiles[1] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-083834-273746.jpg'
ImageFiles[2] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-083836-991845.jpg'
ImageFiles[3] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-083846-42125.jpg'
ImageFiles[4] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-083954-81354.jpg'
ImageFiles[5] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-084011-874589.jpg'
ImageFiles[6] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-084046-108724.jpg'
ImageFiles[7] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-084055-229775.jpg'
ImageFiles[8] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-084133-608364.jpg'
ImageFiles[9] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-084135-931095.jpg'
ImageFiles[10] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-084248-960299.jpg'
ImageFiles[11] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-084258-532255.jpg'
ImageFiles[12] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-084302-415268.jpg'
ImageFiles[13] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-085633-799217.jpg'
ImageFiles[14] := 'C:/Users/user/Desktop/大蒜测试/包裹/测试/chn5-w2560-h1440-19700101-085640-892212.jpg'

 3.识别
* Create dictionaries used for the visualization.
WindowDict := dict{}
get_dl_model_param (DLModelHandle, 'class_ids', ClassIds)
get_dl_model_param (DLModelHandle, 'class_names', ClassNames)
DLDatasetInfo := dict{class_ids: ClassIds, class_names: ClassNames}
create_dl_preprocess_param_from_model(DLModelHandle, 'none', 'full_domain', [], [], [], DLPreprocessParam)
for IndexInference := 0 to |ImageFiles|-1 by 1read_image (Image, ImageFiles[IndexInference])gen_dl_samples_from_images (Image, DLSampleInference)preprocess_dl_samples (DLSampleInference, DLPreprocessParam)apply_dl_model (DLModelHandle, DLSampleInference, [], DLResult)* dev_display_dl_data (DLSampleInference, DLResult, DLDatasetInfo, 'bbox_result', [], WindowDict)dev_disp_text ('Press F5 to continue', 'window', 'bottom', 'right', 'black', [], [])stop ()
endfor
dev_close_window_dict (WindowDict)

 

http://www.lryc.cn/news/460272.html

相关文章:

  • 【STL】AVLTree模拟实现
  • 无极低码课程【tomcat部署windows环境厂家乱码处理】
  • 注册安全分析报告:惠农网
  • Qualitor checkAcesso.php 任意文件上传漏洞复现(CVE-2024-44849)
  • PHP-FPM和FastCGI
  • 【Linux快速入门(二)】Linux与ROS学习之编译基础(make编译)
  • jupyterlab的安装与使用攻略/包括汉化方法
  • std::list
  • opencv-rust 系列2: camera_calibration
  • JVM和GC案例详解
  • postgreSql下载安装
  • GPT-SOVIT模型部署指南
  • 怎么定时发朋友圈?
  • 如何利用phpstudy创建mysql数据库
  • 五、Linux之Vi和Vim编辑器
  • git删除错误的commit
  • 代码随想录算法训练营Day08 | 344.反转字符串、541. 反转字符串II、卡码网:54.替换数字
  • mysql锁之乐观锁、悲观锁、表锁、行锁、共享锁、排他锁
  • 【软件干货】Android应用进程如何保活?
  • neo4j部署保姆级教程
  • 【STM32CubeMX开发】-2.2-TIM_输出一个PWM信号
  • Ngx+Lua+Redis 快速存储POST数据
  • go-delve的使用
  • Python网络爬虫技术详解
  • Golang | Leetcode Golang题解之第474题一和零
  • 算法刷题技巧
  • BMS、EMS PCS 简介
  • spug3发布项目
  • 鸿蒙HarmonyOS开发:应用权限的基本概念及如何申请应用权限详细介绍
  • mac 桌面版docker no space left on device