項目開發中如何寫說明文檔

第一節 總流程
一、(原理介紹)
XXXXXXXXXXXXXXXXXX
二、(總的流程圖)

第二節:主接口1
一、(原理介紹)
XXXXXXXXXXXXXXXXXXXXXXXXX
二、(總的流程圖)

例子:
流程圖
這裏寫圖片描述

步驟描述:步驟描述需要一定的邏輯性。但不一定是純文字形式,可以用公式,便於理解的僞代碼+文字等方式進行步驟描述
這裏寫圖片描述
這裏寫圖片描述
這裏寫圖片描述

這裏寫圖片描述
這裏寫圖片描述

三、分模塊介紹
1、邏輯模塊一:
1.1 代碼
1.2 流程圖
1.3 詳細說明

例子:
1、 三個框相交,則去掉中間的
這裏寫圖片描述
這裏寫圖片描述

1.  if(detectResult.size() > 1)  
2.      for(int i=1;i<detectResult.size()-1;i++){  
3.          if (((detectResult[i].x + detectResult[i].width + 2) >= detectResult[i + 1].x) &&  
4.              (detectResult[i].x <= (detectResult[i - 1].x + detectResult[i - 1].width - 2))){  
5.          }  
6.          if (((detectResult[i].x + detectResult[i].width + 2) >= detectResult[i + 1].x) &&  
7.              (detectResult[i].x <= (detectResult[i - 1].x + detectResult[i - 1].width - 2))  
8.              && ((detectResult[i + 1].x - detectResult[i - 1].x - detectResult[i - 1].width) < (0.7*(ROIWIDTH + avg_distance_of_chars)))){  
9.              detectResult.erase(detectResult.begin() + i);  
10.             i--;  
11.         }                     
12.     }

2、接口模塊:
2.1 代碼
2.2 功能描述
2.3 接口描述
2.4 核心原理

例子1:
以cifar-10爲例說明,具體的運算過程,對應代碼:
這裏寫圖片描述
1、卷積:
1.

inline void Conv(const int *restrict pSrc, int *restrict pDst, const int *restrict pKer, const int input_w, const int input_h, int k_size, int stride)  
2.  {  
3.      int   y, i, j, k;  
4.      int tSum;  
5.      const int *pSS = pSrc;  
6.    
7.    
8.      for (y = 0; y< (input_h + stride - 1) - k_size + 1; y += stride, pSS += (stride*input_w))  
9.      {  
10.         for (i = 0; i<(input_w + stride - 1) - k_size + 1; i += stride)  
11.         {  
12.             tSum = 0;  
13.             for (j = 0; j<k_size; j++)  
14.             {  
15.                 for (k = 0; k<k_size; k++)  
16.                 {  
17.                     tSum += pSS[j * input_w + i + k] * pKer[j * k_size + k];                      
18.                 }  
19.             }  
20.   
21.             *pDst++ = tSum;   
22.         }  
23.     }  
24. }  

1.1 功能描述
寬爲input_w、高爲input_h的輸入圖像pSrc,與k_size x k_size的卷積核pKer進行卷積,得到寬爲input_w、高爲input_h特徵圖pDst。

1.2 接口描述
這裏寫圖片描述

名稱  In/out/Par  Size/precision  Description/value
pSrc    in  input_w* input_h    輸入圖像
pDst    out input_w* input_h    輸出圖像
pKer    in  k_size * k_size 卷積核
input_w parameter   int 輸入圖像寬
input_h parameter   int 輸入圖像高
k_size  parameter   int 卷積核寬,一般爲奇數
stride  parameter   int 卷積核在圖像上上下左右滑動的平移像素幅度

1.3 核心原理(以cifar-10爲例進行說明):
(1)輸入是3個32*32, 共3*1024=3072。每條邊padding爲2,則內存裏實際爲3個36*36.
(2)卷積核個數是3維的5*5分別與3個輸入進行卷積運算,得到3維的32*32的輸出,這裏將3維的32*32對應位相加得到一張32*32的feature Map
(3)輸出:如果有64個3維的5*5卷積核就有64張feature Map
具體過程圖示爲:
這裏寫圖片描述
卷積的權值讀取方式爲:
(1)第1個5*5作用於第一張輸入全圖,
(2)第2個5*5作用於第二張輸入全圖,
(3)第3個5*5作用於第三張輸入全圖,
(4)再把這三個對應位置相加,在加上biases,得到第一張feature map
(5)最後64個5*5*3重複上面的過程,得到64個featuremap
(6)這裏weights有3*5*5*64個,biases有64個.
這裏輸入是3 個圖像,輸出是64個特徵圖,卷積核是5*5權值個數是64* 5*5*3

例子2:

這裏寫圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章