《臨時筆記》caffe2使用記錄

本文作爲臨時筆記,記錄筆者在使用caffe2時候的一些問題和解決方法,有空再進行詳細整理。

  1. caffe2中對視頻的單幀進行了零均值標準化處理,也就是如式子(1.1)所示:
    x^=xmeanstd(1.1) \hat{x} = \dfrac{x-\mathrm{mean}}{\mathrm{std}} \tag{1.1}
    從源碼上看[1],這裏的均值mean和方差std分別是:
    // 7 channels: (flow_x, flow_y, flow_magitude, gray, Red, Green, Blue)
    const std::vector<float> InputDataMean = {
        0.0046635, 0.0046261, 0.963986, 102.976, 110.201, 100.64, 95.9966};
    const std::vector<float> InputDataStd = {
        0.972347, 0.755146, 1.43588, 55.3691, 58.1489, 56.4701, 55.3324};

方差是[58.1489, 56.4701, 55.3324], 均值是[110.201, 100.64, 95.9966],排序是RGB


Reference

[1]. https://github.com/pytorch/pytorch/blob/master/caffe2/video/video_input_op.h#L374-L378

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