抓圖後處理優化之圖優化git
定義一系列虛擬抓圖設置G1,G2,G3,.. GNgithub
每一個虛擬抓圖對應一系列的抓圖和後處理,express
Gi = grab(i,1) + .. grab(i,m) + pp(i, 1) +.. + pp(i, k)api
如何以最快的時間拿到全部圖?ide
假設: 不一樣的grab有機會相同,pp有機會相同。這種狀況不須要重複處理函數
把處理用data flow表達的graph表示,該graph的輸入爲N個Grabsetting,輸出爲N個image優化
消除公共子表達式ui
graph優化this
Includes a 「graph optimizer」 that looks at the entire processing pipeline and removes/replaces/merges functions to improve performance and minimize bandwidth at runtime
https://gpuopen-professionalcompute-libraries.github.io/MIVisionX/amd_openvx/#amd-openvx-amd_openvx
https://github.com/GPUOpen-ProfessionalCompute-Libraries/MIVisionX/blob/master/amd_openvx/README.md
openvx
https://software.intel.com/en-us/openvino-ovx-guide-whats-new-in-this-release#
https://zhuanlan.zhihu.com/p/52019183
Tensorflow也使用了編譯原理中經常使用的3中優化方案 1. 常量摺疊 constant folding 2. 內聯函數展開 3. 公共表達式摺疊CSE(common-subexpression elimination)。
GraphOptimizer類(http://graph_optimizer.cc)
https://zhuanlan.zhihu.com/p/25932160
http://www.javashuo.com/article/p-kbuagtna-kw.html
http://www.javashuo.com/article/p-mnzmzcof-er.html
XLA
XLA(Accelerated Linear Algebra)
內核融合,就是將一個計算圖中的節點所對應的內核函數融合成一個函數,使得整個數據流圖只須要經過一次函數調用便可完成
https://www.google.com/search?newwindow=1&sxsrf=ACYBGNTM-33yYNB6t-YxjZgxn5z3px1mng%3A1571064645210&ei=RYukXY-xDNHahwPkv4HICA&q=dag+optimization&oq=DAG+optimi&gs_l=psy-ab.3.0.0i19j0i8i30i19j0i5i30i19l2j0i8i30i19j0i10i30i19.4196264.4199390..4200506...0.0..0.64.587.10......0....1..gws-wiz.......35i39j0i67j0j0i131j0i12j0i12i30j0i30j0i12i30i19j0i30i19j0i12i10i30i19.pNwN6S1iSEI
https://docs.opencv.org/4.0.0/d3/d7a/tutorial_gapi_anisotropic_segmentation.html
他的api設計很值得參考