设置首页收藏本站
123
返回列表 发新帖
开启左侧

大恒深度学习

 关闭 [复制链接]
 楼主| wenluderen 发表于 2020-5-26 12:56:59 | 显示全部楼层
  1. SamplingSize := 7
  2. FeatureSize := 80
  3. for I := 0 to |ValidationImages|-1 by 1
  4.     read_image (ImageSelected, ValidationImages[I])
  5.     dev_resize_window_fit_image (ImageSelected, 0, 0, -1, -1)
  6.     dev_display_dl_classifier_heatmap (ImageSelected, DLModelHandle, ['feature_size','sampling_size'], [FeatureSize,SamplingSize], WindowHandle)
  7.     dev_disp_heatmap_result_text (ValidationLabels[I], Top1ClassValidation[I])   
  8.     dump_window(WindowHandle, 'png', 'heatmap')///Write the window content to a file.  将窗口整体变成一个图片写入到硬盘
  9.     stop()
  10. endfor
  11. clear_dl_classifier (DLModelHandle)//释放句柄,避免内存泄露
复制代码


5555555555.jpg

奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
 楼主| wenluderen 发表于 2020-5-26 13:05:10 | 显示全部楼层
最后一步就是训练了
  1. TestImageDir := 'test/'
  2. ClassifyThreshold := 0.8

  3. TestImageDir := 'test/'

  4. ClassifyThreshold := 0.8
  5. dev_update_off()
  6. dev_close_window ()
  7. read_dl_classifier ('model_best.hdl', DLModelHandle)
  8. set_dl_classifier_param (DLModelHandle, 'batch_size', 1)
  9. get_dl_classifier_param(DLModelHandle, 'image_dimensions', ImageSize)
  10. get_dl_classifier_param(DLModelHandle, 'classes', Classes)

  11. for I := 0 to |Classes|-1 by 1
  12.     OutputDir:= TestImageDir+Classes[I] + '/'
  13.     file_exists (OutputDir, FileExists)
  14.     if (not FileExists)
  15.         make_dir (OutputDir)
  16.     endif
  17. endfor

  18. SamplingSize := 7
  19. FeatureSize := 80
  20. list_image_files (TestImageDir, 'default', 'recursive', ImageFiles)
  21. read_image (Image, ImageFiles[0])
  22. get_image_size(Image, Width, Height)
  23. count_channels(Image, Channels)
  24. tuple_max2(Width, Height, Max)
  25. WndWidth := Width * 600 / Max
  26. WndHeight := Height * 600 / Max
  27. dev_open_window(0, 0, WndWidth, WndHeight, 'black', WindowHandle)
  28. set_font(WindowHandle, 'default-24')
  29. Seconds := 0

  30. for I := 0 to |ImageFiles|-1 by 1
  31.     read_image (Image, ImageFiles[I])
  32.     count_seconds(Start)
  33.     zoom_image_size (Image, ImagePreprocessed, ImageSize[0], ImageSize[1], 'constant')
  34.     convert_image_type (ImagePreprocessed, ImagePreprocessed, 'real')
  35.     scale_image (ImagePreprocessed, ImagePreprocessed, 1, -127)
  36.     apply_dl_classifier (ImagePreprocessed, DLModelHandle, DLResult)
  37.     count_seconds(End)
  38.     Seconds := Seconds + End - Start
  39.     get_dl_classifier_result (DLResult, 'all', 'predicted_classes', PredictedClass)
  40.     get_dl_classifier_result (DLResult, 'all', 'confidences', Confidence)
  41.     dev_display(Image)
  42.         dev_disp_text (PredictedClass + ', ' + Confidence$'.2f' + '   ' + (I+1) + '/' + |ImageFiles|, 'window', 'top', 'left', 'green', 'box', 'true')        
  43.      if(Confidence > ClassifyThreshold)
  44.         parse_filename (ImageFiles[I], BaseName, Extension, Directory)
  45.         write_image(Image, 'png', 0, TestImageDir + PredictedClass + '/' + BaseName + '.' + Extension)
  46.         delete_file (ImageFiles[I])
  47.      endif
  48. endfor

  49. ImageProcTimeMs :=  1000.0 * Seconds / |ImageFiles|
  50. FPS :=  |ImageFiles| / Seconds
  51. dev_disp_text ('image:' + Width + '×' + Height + '×' + Channels + '×' + |ImageFiles| + ', fps=' + FPS$'.2f', 'window', 'center', 'left', 'green', 'box', 'true')
复制代码


2020-05-26_130450.jpg
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
cv_scx 发表于 2020-5-29 14:24:48 | 显示全部楼层
缺少目标检测的视频
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
彬1106 发表于 2020-5-29 18:12:09 | 显示全部楼层
wenluderen 发表于 2020-5-26 08:23
第一节课主题是分类识别,是李东平老师讲解的
***
分类识别是目标检测 和分割的基础,

版主,代码再哪里 实例代码再哪里 分享下
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
lun1127 发表于 2020-5-30 15:13:07 | 显示全部楼层
thanks! for your share..........
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
feel 发表于 2020-12-3 10:29:19 | 显示全部楼层
onedrivelive....    this item might note exist or is no longer available~~~ 大佬求一个百度盘的链接。
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
superzrz 发表于 2021-8-3 10:46:35 | 显示全部楼层
可不可以发我一份到邮箱3137179791@qq.com 非常感谢
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
jlee323 发表于 2022-12-26 10:22:21 | 显示全部楼层
可以不要分享出来,网址打不开了,网上只找到第一章的PDF
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
笑忘痴999 发表于 2023-2-7 09:57:07 | 显示全部楼层
网址打不开了,能麻烦您把视频和源代码传一份到百度网盘上吗?
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
多看就会 发表于 2023-7-27 08:49:53 | 显示全部楼层
(大恒深度学习)插个眼,有空再来看看。。。
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表